Skip to content

Integrate bullet physics #83

@ArturoKuang

Description

@ArturoKuang

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);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRI 2Priority 2; Importantbig featureThis is a large feature of the engine

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions