Xors3d Engine
Shapes

Modules

 Compound

Functions

BBDECL void BBCALL xEntityAddBoxShape (Entity *entity, float mass, float width=0.0f, float height=0.0f, float depth=0.0f)
 Creates a box shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddCapsuleShape (Entity *entity, float mass, float radius=0.0f, float height=0.0f)
 Creates a capsule shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddConcaveShape (Entity *entity, float mass)
 Creates a concave shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddConcaveShapeProxy (Entity *entity, Entity *proxy, float mass)
 Creates a concave shape using information about vertices and indices of the proxy entity and attaches it to the main entity.
BBDECL void BBCALL xEntityAddConeShape (Entity *entity, float mass, float radius=0.0f, float height=0.0f)
 Creates a cone shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddConvexShape (Entity *entity, float mass)
 Creates a convex shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddConvexShapeProxy (Entity *entity, Entity *proxy, float mass)
 Creates a convex shape using information about vertices and indices of the proxy entity and attaches it to the main entity.
BBDECL void BBCALL xEntityAddCylinderShape (Entity *entity, float mass, float width=0.0f, float height=0.0f, float depth=0.0f)
 Creates a cylinder shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddDummyShape (Entity *entity)
 Creates a dummy shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddSphereShape (Entity *entity, float mass, float radius=0.0f)
 Creates a sphere shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddTerrainShape (Entity *entity)
 Creates a static shape for a terrain.
BBDECL void BBCALL xEntityAddTriMeshShape (Entity *entity)
 Creates a trimesh (triangle mesh) shape and attaches it to the entity.
BBDECL void BBCALL xEntityAddTriMeshShapeProxy (Entity *entity, Entity *proxy)
 Creates a trimesh (triangle mesh) shape using information about vertices and indices of the proxy entity and attaches it to the main entity.
BBDECL void BBCALL xEntityAttachBody (Entity *entity, IBody *body)
 Attaches a previously detached body.
BBDECL IBody *BBCALL xEntityDetachBody (Entity *entity)
 Detaches a body from an entity.
BBDECL void BBCALL xFreeEntityBody (Entity *entity)
 Frees the body of an entity.

Function Documentation

BBDECL void BBCALL xEntityAddDummyShape ( Entity *  entity)

Creates a dummy shape and attaches it to the entity.

A dummy shape has no mass and collision body.

Parameters:
entityEntity handle
BBDECL void BBCALL xEntityAddBoxShape ( Entity *  entity,
float  mass,
float  width = 0.0f,
float  height = 0.0f,
float  depth = 0.0f 
)

Creates a box shape and attaches it to the entity.

Set any dimension of the box shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Parameters:
entityEntity handle
massMass of the body
widthWidth of the body
heightHeight of the body
depthDepth of the body
BBDECL void BBCALL xEntityAddSphereShape ( Entity *  entity,
float  mass,
float  radius = 0.0f 
)

Creates a sphere shape and attaches it to the entity.

Set the radius of the sphere shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Parameters:
entityEntity handle
massMass of the body
radiusRadius of the body
BBDECL void BBCALL xEntityAddCapsuleShape ( Entity *  entity,
float  mass,
float  radius = 0.0f,
float  height = 0.0f 
)

Creates a capsule shape and attaches it to the entity.

Set any dimension of the capsule shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Parameters:
entityEntity handle
massMass of the body
radiusRadius of the body
heightHeight of the body
BBDECL void BBCALL xEntityAddConeShape ( Entity *  entity,
float  mass,
float  radius = 0.0f,
float  height = 0.0f 
)

Creates a cone shape and attaches it to the entity.

Set any dimension of the cone shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Parameters:
entityEntity handle
massMass of the body
radiusRadius of the body
heightHeight of the body
BBDECL void BBCALL xEntityAddCylinderShape ( Entity *  entity,
float  mass,
float  width = 0.0f,
float  height = 0.0f,
float  depth = 0.0f 
)

Creates a cylinder shape and attaches it to the entity.

Set any dimension of the cylinder shape to zero or less than zero and the shape will fit the dimensions of the entity automatically.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Parameters:
entityEntity handle
massMass of the body
widthWidth of the body
heightHeight of the body
depthDepth of the body
BBDECL void BBCALL xEntityAddTriMeshShape ( Entity *  entity)

Creates a trimesh (triangle mesh) shape and attaches it to the entity.

Created trimesh shape is static which means that moving of vertices won't affect the shape.

Parameters:
entityEntity handle
BBDECL void BBCALL xEntityAddTriMeshShapeProxy ( Entity *  entity,
Entity *  proxy 
)

Creates a trimesh (triangle mesh) shape using information about vertices and indices of the proxy entity and attaches it to the main entity.

Created trimesh shape is static which means that moving of vertices won't affect the shape.
Usually proxy entity is a lowpoly version of the main entity. Proxy entity may be freed after using in this function.

Parameters:
entityEntity handle
proxyProxy entity handle
BBDECL void BBCALL xEntityAddConvexShape ( Entity *  entity,
float  mass 
)

Creates a convex shape and attaches it to the entity.

The convex shape works much faster than the concave one. That's why the use of the convex shape is more preferable if it fits your needs.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Parameters:
entityEntity handle
massMass of the body
BBDECL void BBCALL xEntityAddConvexShapeProxy ( Entity *  entity,
Entity *  proxy,
float  mass 
)

Creates a convex shape using information about vertices and indices of the proxy entity and attaches it to the main entity.

The convex shape works much faster than the concave one. That's why the use of the convex shape is more preferable if it fits your needs.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body. Usually proxy entity is a lowpoly version of the main entity. Proxy entity may be freed after using in this function.
Parameters:
entityEntity handle
proxyProxy entity handle
massMass of the body
BBDECL void BBCALL xEntityAddConcaveShape ( Entity *  entity,
float  mass 
)

Creates a concave shape and attaches it to the entity.

Unlike a convex shape a concave shape can have dents and holes. For instance, a torus will have a hole if it was created as a concave shape.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Parameters:
entityEntity handle
massMass of the body
BBDECL void BBCALL xEntityAddConcaveShapeProxy ( Entity *  entity,
Entity *  proxy,
float  mass 
)

Creates a concave shape using information about vertices and indices of the proxy entity and attaches it to the main entity.

Unlike a convex shape a concave shape can have dents and holes. For instance, a torus will have a hole if it was created as a concave shape.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body. Usually proxy entity is a lowpoly version of the main entity. Proxy entity may be freed after using in this function.
Parameters:
entityEntity handle
proxyProxy entity handle
massMass of the body
BBDECL void BBCALL xEntityAddTerrainShape ( Entity *  entity)

Creates a static shape for a terrain.

Can be used only with the terrains.

Parameters:
entityEntity handle
BBDECL void BBCALL xEntityAttachBody ( Entity *  entity,
IBody *  body 
)

Attaches a previously detached body.

In combination with xEntityDetachBody() this function is useful if you need to switch bodies between two or more shapes.

Parameters:
entityEntity handle
bodyBody handle
BBDECL IBody* BBCALL xEntityDetachBody ( Entity *  entity)

Detaches a body from an entity.

In combination with xEntityAttachBody() this function is useful if you need to switch bodies between two or more shapes.

Note:
A detached body is still active and takes part in the physics simulation. Use xEntityDisableSimulation() if the body is detached for a long time and should be disabled.
Warning:
Currently only primitive-shape bodies (box, sphere, cone, capsule, cylinder) are detachable.
Concave, convex, trimesh, terrain are not detachable.
Parameters:
entityEntity handle
BBDECL void BBCALL xFreeEntityBody ( Entity *  entity)

Frees the body of an entity.

Parameters:
entityEntity handle.