Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::Physics::CCollider Class Reference

Base class for all collision shapes. More...

#include <Collider/CCollider.h>

Inheritance diagram for Skylicht::Physics::CCollider:
Skylicht::CComponentSystem Skylicht::IActivatorObject Skylicht::Physics::CBoxCollider Skylicht::Physics::CCapsuleCollider Skylicht::Physics::CCylinderCollider Skylicht::Physics::CMeshCollider Skylicht::Physics::CSphereCollider Skylicht::Physics::CStaticPlaneCollider Skylicht::Physics::CBvhMeshCollider Skylicht::Physics::CConvexMeshCollider

Public Types

enum  EColliderType {
  Box , Sphere , Plane , Cylinder ,
  Capsule , BvhMesh , ConvexMesh , Mesh ,
  Unknown
}
 Supported collider types.

Public Member Functions

virtual void initComponent ()
EColliderType getColliderType ()
 Gets the type of the collider.
void initRigidbody ()
 Triggers the initialization of the attached CRigidbody.
void clampSize (core::vector3df &size)
 Clamps the size vector to ensure no negative dimensions.
bool isDynamicSupport ()
 Checks if this collider type supports dynamic rigid bodies.
CMeshgenerateMesh (const core::aabbox3df &maxBBox)
 Generates a visual mesh representing the collision shape.
core::aabbox3df getBBox ()
 Gets the axis-aligned bounding box of the collider in world space.
Public Member Functions inherited from Skylicht::CComponentSystem
const char * getName ()
virtual void reset ()
virtual void startComponent ()
virtual void updateComponent ()=0
virtual void endUpdate ()
virtual void onEnable (bool b)
virtual void onUpdateCullingLayer (u32 mask)
virtual CObjectSerializablecreateSerializable ()
virtual void loadSerializable (CObjectSerializable *object)
void setEnable (bool b)
bool isEnable ()
CGameObject * getGameObject ()
void setEnableSerializable (bool b)
bool isSerializable ()
void addLinkComponent (CComponentSystem *comp)
void removeAllLink ()
Public Member Functions inherited from Skylicht::IActivatorObject
virtual ~IActivatorObject ()
 Virtual destructor for polymorphic activator objects.

Protected Member Functions

CMeshgenerateMesh (IMesh *primitive, bool tangent)
 Helper to generate a mesh from a primitive.
CMeshgetPlane (const core::plane3df &plane, float sizeX, float sizeZ)
 Helper to generate a plane mesh.
Protected Member Functions inherited from Skylicht::CComponentSystem
void setOwner (CGameObject *obj)

Protected Attributes

EColliderType m_colliderType
core::vector3df m_offset
bool m_dynamicSupport
Protected Attributes inherited from Skylicht::CComponentSystem
CGameObject * m_gameObject
bool m_enable
bool m_serializable
std::vector< CComponentSystem * > m_linkComponent

Additional Inherited Members

Static Public Member Functions inherited from Skylicht::CComponentSystem
static int useComponent (CComponentSystem *used)

Detailed Description

Base class for all collision shapes.

Colliders define the physical shape of a GameObject for collision detection. They are used by CRigidbody and CCharacterController.

Member Function Documentation

◆ clampSize()

void Skylicht::Physics::CCollider::clampSize ( core::vector3df & size)

Clamps the size vector to ensure no negative dimensions.

Parameters
sizeVector to clamp.

◆ generateMesh()

CMesh * Skylicht::Physics::CCollider::generateMesh ( const core::aabbox3df & maxBBox)

Generates a visual mesh representing the collision shape.

Parameters
maxBBoxThe maximum bounding box for plane generation.
Returns
Pointer to the generated CMesh.

◆ getBBox()

core::aabbox3df Skylicht::Physics::CCollider::getBBox ( )

Gets the axis-aligned bounding box of the collider in world space.

Returns
AABB in world space.

◆ getColliderType()

EColliderType Skylicht::Physics::CCollider::getColliderType ( )
inline

Gets the type of the collider.

Returns
EColliderType value.

◆ initComponent()

virtual void Skylicht::Physics::CCollider::initComponent ( )
virtual

◆ isDynamicSupport()

bool Skylicht::Physics::CCollider::isDynamicSupport ( )
inline

Checks if this collider type supports dynamic rigid bodies.

Returns
True if dynamic support is available.

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