Inherited: Collider


The MeshCollider class provides a way to create a collider based on a 3D mesh. The collider can be attached to a physics world, and its properties, such as the mesh, material, and enabled state, can be manipulated dynamically.

Public Methods

PhysicMaterial *

material () const

Mesh *

mesh () const


setMaterial (PhysicMaterial * material)


setMesh (Mesh * mesh)

Static Methods


Methods Description

:ref:`PhysicMaterial<api_PhysicMaterial>`* MeshCollider::material () const

Returns a pointer to the physical material associated with the collider.

See also setMaterial().

:ref:`Mesh<api_Mesh>`* MeshCollider::mesh () const

Returns a pointer to the mesh used by the collider.

See also setMesh().

void MeshCollider::setMaterial (PhysicMaterial * material)

Sets the physical material for the collider. This method updates the friction and restitution properties of the collider.

See also *material*().

void MeshCollider::setMesh (Mesh * mesh)

Sets the mesh for the collider. This method recreates the collider’s shape and updates its properties.

See also *mesh*().