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

A capsule collision shape. More...

#include <Collider/CCapsuleCollider.h>

Inheritance diagram for Skylicht::Physics::CCapsuleCollider:
Skylicht::Physics::CCollider Skylicht::CComponentSystem Skylicht::IActivatorObject

Public Member Functions

virtual void updateComponent ()
virtual CObjectSerializablecreateSerializable ()
virtual void loadSerializable (CObjectSerializable *object)
float getRadius ()
 Gets the radius of the capsule.
float getHeight ()
 Gets the height of the capsule.
void setCapsule (float radius, float height)
 Sets the capsule dimensions.
Public Member Functions inherited from Skylicht::Physics::CCollider
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 endUpdate ()
virtual void onEnable (bool b)
virtual void onUpdateCullingLayer (u32 mask)
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 Attributes

float m_radius
float m_height
Protected Attributes inherited from Skylicht::Physics::CCollider
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

Public Types inherited from Skylicht::Physics::CCollider
enum  EColliderType {
  Box , Sphere , Plane , Cylinder ,
  Capsule , BvhMesh , ConvexMesh , Mesh ,
  Unknown
}
 Supported collider types.
Static Public Member Functions inherited from Skylicht::CComponentSystem
static int useComponent (CComponentSystem *used)
Protected Member Functions inherited from Skylicht::Physics::CCollider
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)

Detailed Description

A capsule collision shape.

Example:

Physics::CCapsuleCollider* capsule = gameObject->addComponent<Physics::CCapsuleCollider>();
capsule->setCapsule(0.5f, 2.0f);
A capsule collision shape.
Definition CCapsuleCollider.h:44
void setCapsule(float radius, float height)
Sets the capsule dimensions.
Definition CCapsuleCollider.h:83

Member Function Documentation

◆ createSerializable()

virtual CObjectSerializable * Skylicht::Physics::CCapsuleCollider::createSerializable ( )
virtual

Reimplemented from Skylicht::CComponentSystem.

◆ getHeight()

float Skylicht::Physics::CCapsuleCollider::getHeight ( )
inline

Gets the height of the capsule.

Returns
Height value.

◆ getRadius()

float Skylicht::Physics::CCapsuleCollider::getRadius ( )
inline

Gets the radius of the capsule.

Returns
Radius value.

◆ loadSerializable()

virtual void Skylicht::Physics::CCapsuleCollider::loadSerializable ( CObjectSerializable * object)
virtual

Reimplemented from Skylicht::CComponentSystem.

◆ setCapsule()

void Skylicht::Physics::CCapsuleCollider::setCapsule ( float radius,
float height )
inline

Sets the capsule dimensions.

Parameters
radiusRadius value.
heightHeight value.

◆ updateComponent()

virtual void Skylicht::Physics::CCapsuleCollider::updateComponent ( )
virtual

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