Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate bullet physics #83

Open
ArturoKuang opened this issue Oct 13, 2019 · 1 comment
Open

Integrate bullet physics #83

ArturoKuang opened this issue Oct 13, 2019 · 1 comment
Labels
big feature This is a large feature of the engine PRI 2 Priority 2; Important

Comments

@ArturoKuang
Copy link
Contributor

ArturoKuang commented Oct 13, 2019

Integrate bullet physics with our entity component system.
https://github.com/bulletphysics/bullet3

Basic rough draft of the physic system

// Add a 3D rigidbody component
entt::entitty e = reg.create();
Rigidbody& c = reg.assign<Rigidbody>(e, transform, force, velocity, acceleration, mass, etc....);

// Add collision body component for collision detection
entt::entitty e = reg.create();
SphereCollider& c = reg.assign<SphereCollider>(e, transform, radius);

// Add 
entt::entitty e = reg.create();
Transform& c = reg.assign<Transform>(e, Transform{});
Rigidbody& c = reg.assign<Rigidbody>(e, transform, force, velocity, acceleration, mass, etc....);
SphereCollider& c = reg.assign<SphereCollider>(e, transform, radius);

class PhysicSystem
{
   // Update all active physics component
   void Update(entt::registry reg);
};

@ArturoKuang ArturoKuang added PRI 2 Priority 2; Important big feature This is a large feature of the engine labels Oct 13, 2019
@ArturoKuang ArturoKuang added this to the Final Deliverable milestone Oct 13, 2019
@BenjaFriend
Copy link
Member

That outline looks good. This article explains how we can make relationships with Entt: https://skypjack.github.io/2019-04-12-entt-tips-and-tricks-part-1/

(i.e. rigidbody HAS A transform)

@ArturoKuang ArturoKuang self-assigned this Nov 13, 2019
@BenjaFriend BenjaFriend removed this from the Final Deliverable milestone Dec 31, 2019
@BenjaFriend BenjaFriend pinned this issue Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
big feature This is a large feature of the engine PRI 2 Priority 2; Important
Projects
None yet
Development

No branches or pull requests

2 participants