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

A collision shape generated from a 3D mesh prefab. More...

#include <Collider/CMeshCollider.h>

Inheritance diagram for Skylicht::Physics::CMeshCollider:
Skylicht::Physics::CCollider Skylicht::CComponentSystem Skylicht::IActivatorObject Skylicht::Physics::CBvhMeshCollider Skylicht::Physics::CConvexMeshCollider

Public Member Functions

void releaseMesh ()
 Releases the internal triangle mesh data.
virtual void updateComponent ()
virtual CObjectSerializablecreateSerializable ()
virtual void loadSerializable (CObjectSerializable *object)
void setMeshSource (const char *source)
 Sets the source path for the mesh prefab.
const char * getMeshSource ()
 Gets the source path for the mesh prefab.
CEntityPrefabgetMeshPrefab ()
 Loads and returns the mesh prefab from the source path.
core::matrix4 getWorldTransform ()
 Gets the world transform matrix of the collider.
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

std::string m_source
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 collision shape generated from a 3D mesh prefab.

This uses GImpact for moving triangle meshes.

Example:

Physics::CMeshCollider* mesh = gameObject->addComponent<Physics::CMeshCollider>();
mesh->setMeshSource("Assets/Models/MyMesh.fbx");
A collision shape generated from a 3D mesh prefab.
Definition CMeshCollider.h:48
void setMeshSource(const char *source)
Sets the source path for the mesh prefab.
Definition CMeshCollider.h:75

Member Function Documentation

◆ createSerializable()

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

Reimplemented from Skylicht::CComponentSystem.

◆ getMeshPrefab()

CEntityPrefab * Skylicht::Physics::CMeshCollider::getMeshPrefab ( )

Loads and returns the mesh prefab from the source path.

Returns
Pointer to CEntityPrefab.

◆ getMeshSource()

const char * Skylicht::Physics::CMeshCollider::getMeshSource ( )
inline

Gets the source path for the mesh prefab.

Returns
Path string.

◆ getWorldTransform()

core::matrix4 Skylicht::Physics::CMeshCollider::getWorldTransform ( )

Gets the world transform matrix of the collider.

Returns
4x4 matrix.

◆ loadSerializable()

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

Reimplemented from Skylicht::CComponentSystem.

◆ setMeshSource()

void Skylicht::Physics::CMeshCollider::setMeshSource ( const char * source)
inline

Sets the source path for the mesh prefab.

Parameters
sourcePath to the .dae, .fbx, or .obj file.

◆ updateComponent()

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

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