ReactPhysics3D: reactphysics3d::ColliderComponents Class Reference

| ReactPhysics3D v0.10.2 C++ Physics engine library

Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
reactphysics3d::ColliderComponents Class Reference

This class represent the component of the ECS that contains data about the the colliders of the different bodies. More...

`#include <include/reactphysics3d/components/ColliderComponents.h>`

Inheritance diagram for reactphysics3d::ColliderComponents:

## Classes
struct | ColliderComponent
| Structure for the data of a collider component. More...

## Public Member Functions
| ColliderComponents (MemoryAllocator &allocator)
| Constructor.
virtual | ~ColliderComponents () override=default
| Destructor.
void | addComponent (Entity colliderEntity, bool isDisabled, const ColliderComponent &component)
| Add a component.
Entity | getBody (Entity colliderEntity) const
| Return the body entity of a given collider.
Collider * | getCollider (Entity colliderEntity) const
| Return a pointer to a given collider.
const Transform & | getLocalToBodyTransform (Entity colliderEntity) const
| Return the local-to-body transform of a collider.
void | setLocalToBodyTransform (Entity colliderEntity, const Transform &transform)
| Set the local-to-body transform of a collider.
CollisionShape * | getCollisionShape (Entity colliderEntity) const
| Return a pointer to the collision shape of a collider.
int32 | getBroadPhaseId (Entity colliderEntity) const
| Return the broad-phase id of a given collider.
void | setBroadPhaseId (Entity colliderEntity, int32 broadPhaseId)
| Set the broad-phase id of a given collider.
unsigned short | getCollisionCategoryBits (Entity colliderEntity) const
| Return the collision category bits of a given collider.
void | setCollisionCategoryBits (Entity colliderEntity, unsigned short collisionCategoryBits)
| Set the collision category bits of a given collider.
unsigned short | getCollideWithMaskBits (Entity colliderEntity) const
| Return the "collide with" mask bits of a given collider.
void | setCollideWithMaskBits (Entity colliderEntity, unsigned short collideWithMaskBits)
| Set the "collide with" mask bits of a given collider.
const Transform & | getLocalToWorldTransform (Entity colliderEntity) const
| Return the local-to-world transform of a collider.
void | setLocalToWorldTransform (Entity colliderEntity, const Transform &transform)
| Set the local-to-world transform of a collider.
Array< uint64 > & | getOverlappingPairs (Entity colliderEntity)
| Return a reference to the array of overlapping pairs for a given collider.
bool | getHasCollisionShapeChangedSize (Entity colliderEntity) const
| Return true if the size of collision shape of the collider has been changed by the user.
void | setHasCollisionShapeChangedSize (Entity colliderEntity, bool hasCollisionShapeChangedSize)
| Set whether the size of collision shape of the collider has been changed by the user.
bool | getIsTrigger (Entity colliderEntity) const
| Return true if a collider is a trigger.
void | setIsTrigger (Entity colliderEntity, bool isTrigger)
| Set whether a collider is a trigger.
bool | getIsSimulationCollider (Entity colliderEntity) const
| Return true if a collider is a simulation collider.
void | setIsSimulationCollider (Entity colliderEntity, bool isSimulationCollider)
| Set whether a collider is a simulation collider.
bool | getIsWorldQueryCollider (Entity colliderEntity) const
| Return true if a collider is a world query collider.
void | setIsWorldQueryCollider (Entity colliderEntity, bool isWorldQueryCollider)
| Set whether a collider is a world query collider.
Material & | getMaterial (Entity colliderEntity)
| Return a reference to the material of a collider.
void | setMaterial (Entity colliderEntity, const Material &material)
| Set the material of a collider.
Public Member Functions inherited from reactphysics3d::Components
| Components (MemoryAllocator &allocator, size_t componentDataSize, size_t alignmentMarginSize)
| Constructor.
virtual | ~Components ()
| Destructor.
void | init ()
| Initialize the components:
void | removeComponent (Entity entity)
| Remove a component.
bool | getIsEntityDisabled (Entity entity) const
| Return true if an entity is disabled.
void | setIsEntityDisabled (Entity entity, bool isDisabled)
| Notify if a given entity is disabled.
bool | hasComponent (Entity entity) const
| Return true if there is a component for a given entity.
bool | hasComponentGetIndex (Entity entity, uint32 &entityIndex) const
| Return true if there is a component for a given entiy and if so set the entity index.
uint32 | getNbComponents () const
| Return the number of components.
uint32 | getNbEnabledComponents () const
| Return the number of enabled components.
uint32 | getEntityIndex (Entity entity) const
| Return the index in the arrays for a given entity.

## Detailed Description

This class represent the component of the ECS that contains data about the the colliders of the different bodies.

We also make sure that colliders of sleeping entities (bodies) are always stored at the end of the array.

The documentation for this class was generated from the following files:

- include/reactphysics3d/components/ColliderComponents.h
- src/components/ColliderComponents.cpp