A collider is a collision shape that is used for physics simulation and it is attached to a PhysicObject (its root). Colliders are invisible, and they do not necessary need to exactly match the object you want to include in the physics simulation; it can simply be an rough approximation of it, consequently it will be unnoticeable at runtime (also more efficient for the CPU).
When creating a new Collider you will be asked to select a CollisionBounds; which range from simple shapes like a Cube
or a Sphere
to more complex and precise shapes including Triangle Mesh
or ConvexHull
. The more complex the collision bounds is the more demanding it will be for the physics simulation to process them.
Multiple basic shapes can also be combined to create more complex shape; it is called a Compound Shape. Using a compound shape is ideal to approximate complex objects using multiple simple shapes.
See Also
Name | Description |
---|---|
physicobject | The parent PhysicObject that Collider is associated with. |
data | Access the settings and properties for the active type of collider's CollisionBounds. |
physicmaterial_count | The amount of PhysicMaterial the collider contains. |
uid | Unique universal id to identify the Collider. |
Name | Description |
---|---|
name | Unique name to identify the Collider from its parent PhysicObject. |
margin | Controls the margin of the Collider improving stability by reducing penetration. |
local_matrix | 4x4 matrix that contains the local Collider transformation. |
dynamic | Force the Collider to be updated using its parent Object bounds to dynamically adjust the collider at runtime. |
Name | Description |
---|---|
SetPhysicMaterial | Set a PhysicMaterial to a specific primitive slot index. |
GetPhysicMaterial | Retrive the PhysicMaterial connected to a specific primitive slot. |
SetGeometry | Set an existing geometry to use for the active Collider. |
Update | Manually trigger a Collider update. |
The list below contains all types of collision shape a Collider can be created with (one type per Collider). Ranging from fast basic primitive shapes to more precise, complex and demanding (CPU intensive).
kBox
: Use a box shape to define the collision shape.kSphere
: Spherical collision shape.kCylinder
: Cylindrical collision shape.kCapsule
: Similar as cylinder at the exception that the caps are represented as hemispheres.kCone
: Conical collision shape representation.kConvexHull
: Use the geometry vertices to approximate a tri-dimensional hull to define the collision shape.kTriangleMesh
: Use the actual geometry triangles to define the collision shape.Box shape collision bounds.
Name | Description |
---|---|
size | Define the size of the box all axes. |
margin | The inner section of the box collider (Region only). |
Spherical shaped collision bounds.
Name | Description |
---|---|
radius | The dimension of the sphere radius. |
margin | The inner section of the sphere collider (Region only). |
Cylindrical shaped collision bounds.
Name | Description |
---|---|
height | The height of the cylinder. |
radius | Defines the radius of the cylinder. |
margin | The inner section of the Cylinder collider (Region only). |
Capsule shape collision bounds.
Name | Description |
---|---|
height | Defines the height of the capsule. |
radius | Specify the capsule's radius. |
Cone shape collision bounds.
Name | Description |
---|---|
height | The height of the cone collision shape. |
radius | Controls the size of the base radius of the cone. |
Collision shape that uses the triangle information of an existing Mesh Geometry.
Name | Description |
---|---|
geometry | Internal geometry used by the triangle mesh collider. |
Name | Description |
---|---|
compression | Enable or disable quantized AABB compression. |
Use an existing Mesh Geometry vertices to create a 3d hull.
Name | Description |
---|---|
geometry | The internal geometry used by the convex hull. |
Name | Description |
---|---|
reduction | Enable or disable vertex reduction. |
Accessible via the data
member variable of the Collider. This field gives you access to all settings and properties for the CollisionBounds type you used to create your Collider.
Name | Description |
---|---|
type | The type of CollisionBounds currently in use by the Collider. |
box | Box collider properties. |
sphere | Sphere collider properties. |
cylinder | Cylinder collider properties. |
capsule | Capsule collider properties. |
cone | Cone collider properties. |
trianglemesh | TriangleMesh collider properties. |
convexhull | ConvexHull collider properties. |
|