Struct physicsComponent

Struct Documentation

struct legion::physics::physicsComponent

Public Functions

void calculateNewLocalCenterOfMass()

given the colliders this physicsComponent, calculates the new local center of mass.

Note

This is called internally by the physicsComponent every time a collider is added.

std::shared_ptr<ConvexCollider> ConstructConvexHull(legion::core::mesh_handle meshHandle, bool shouldDebug = false)

Instantiates a ConvexCollider and calls ConstructConvexHullWithMesh on it and passes the given mesh. This ConvexCollider is then added to the list of PhysicsColliders.

Parameters
  • meshHandle: - The mesh handle to lock the mesh and the mesh to create a hull from

void ConstructConvexHull(legion::core::mesh_handle meshHandle, ConvexCollider &col)
void ConstructBox()

Instantiates a ConvexCollider and calls ConstructBoxWithMesh on it and passes the given mesh. This ConvexCollider is then added to the list of PhysicsColliders.

void AddBox(const cube_collider_params &cubeParams)

Instantiates a ConvexCollider and calls CreateBox on it and passes the given mesh. This ConvexCollider is then added to the list of PhysicsColliders.

void AddSphere()

Instantiates a SphereCollider and creates a sphere that encompasses the given mesh. This ConvexCollider is then added to the list of PhysicsColliders.

Public Members

std::vector<std::shared_ptr<PhysicsCollider>> colliders
bool isTrigger = false
math::vec3 localCenterOfMass = {}