Xors3d Engine
Compound

Functions

BBDECL void BBCALL xEntityAddCompoundShape (Entity *entity, float mass)
 Creates a compound shape and attaches it to an entity.
BBDECL int BBCALL xEntityCompoundAddBox (Entity *entity, float width, float height, float depth)
 Adds a box subshape to an entity's compound shape.
BBDECL int BBCALL xEntityCompoundAddCapsule (Entity *entity, float radius, float height)
 Adds a capsule subshape to an entity's compound shape.
BBDECL int BBCALL xEntityCompoundAddCone (Entity *entity, float radius, float height)
 Adds a cone subshape to an entity's compound shape.
BBDECL int BBCALL xEntityCompoundAddCylinder (Entity *entity, float radius, float height)
 Adds a cylinder subshape to an entity's compound shape.
BBDECL int BBCALL xEntityCompoundAddSphere (Entity *entity, float radius)
 Adds a sphere subshape to an entity's compound shape.
BBDECL float BBCALL xEntityCompoundChildGetPitch (Entity *entity, int index)
 Returns a pitch angle of the compound's subshape.
BBDECL float BBCALL xEntityCompoundChildGetRoll (Entity *entity, int index)
 Returns a roll angle of the compound's subshape.
BBDECL float BBCALL xEntityCompoundChildGetX (Entity *entity, int index)
 Returns X coordinate of the local position of the compound's subshape.
BBDECL float BBCALL xEntityCompoundChildGetY (Entity *entity, int index)
 Returns Y coordinate of the local position of the compound's subshape.
BBDECL float BBCALL xEntityCompoundChildGetYaw (Entity *entity, int index)
 Returns a yaw angle of the compound's subshape.
BBDECL float BBCALL xEntityCompoundChildGetZ (Entity *entity, int index)
 Returns Z coordinate of the local position of the compound's subshape.
BBDECL void BBCALL xEntityCompoundChildSetPosition (Entity *entity, int index, float x, float y, float z)
 Sets a new position of the compound's subshape.
BBDECL void BBCALL xEntityCompoundChildSetRotation (Entity *entity, int index, float pitch, float yaw, float roll)
 Sets a new rotation of the compound's subshape.
BBDECL int BBCALL xEntityCompoundCountChildren (Entity *entity)
 Returns the number of compound's subshapes.
BBDECL void BBCALL xEntityCompoundRemoveChild (Entity *entity, int index)
 Removes a compound's subshape.

Function Documentation

BBDECL void BBCALL xEntityAddCompoundShape ( Entity *  entity,
float  mass 
)

Creates a compound shape and attaches it to an entity.

The compound acts as a container for several shapes belonging to one rigid body. A compound shape is conceptually similar to bodies held together by fixed joints; however, unlike fixed joints compound shapes are always kept perfectly rigid and incur no performance cost when simulating.
Compound shape can held box, sphere, capsule, cone and cylinder subshapes.

Note:
Setting mass to zero creates a static (non-dynamic) rigid body.
Warning:
There is no way to change the size of the subshape after adding it to the compound shape.
Parameters:
entityEntity handle
massMass of the body
BBDECL int BBCALL xEntityCompoundAddBox ( Entity *  entity,
float  width,
float  height,
float  depth 
)

Adds a box subshape to an entity's compound shape.

Parameters:
entityEntity handle
widthWidth of the box subshape
heightHeight of the box subshape
depthDepth of the box subshape
BBDECL int BBCALL xEntityCompoundAddSphere ( Entity *  entity,
float  radius 
)

Adds a sphere subshape to an entity's compound shape.

Parameters:
entityEntity handle
radiusRadius of the sphere subshape
BBDECL int BBCALL xEntityCompoundAddCapsule ( Entity *  entity,
float  radius,
float  height 
)

Adds a capsule subshape to an entity's compound shape.

Parameters:
entityEntity handle
radiusRadius of the capsule subshape
heightHeight of the capsule subshape
BBDECL int BBCALL xEntityCompoundAddCone ( Entity *  entity,
float  radius,
float  height 
)

Adds a cone subshape to an entity's compound shape.

Parameters:
entityEntity handle
radiusRadius of the cone subshape
heightHeight of the cone subshape
BBDECL int BBCALL xEntityCompoundAddCylinder ( Entity *  entity,
float  radius,
float  height 
)

Adds a cylinder subshape to an entity's compound shape.

Parameters:
entityEntity handle
radiusRadius of the cylinder subshape
heightHeight of the cylinder subshape
BBDECL int BBCALL xEntityCompoundCountChildren ( Entity *  entity)

Returns the number of compound's subshapes.

Parameters:
entityEntity handle
BBDECL void BBCALL xEntityCompoundRemoveChild ( Entity *  entity,
int  index 
)

Removes a compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
BBDECL void BBCALL xEntityCompoundChildSetPosition ( Entity *  entity,
int  index,
float  x,
float  y,
float  z 
)

Sets a new position of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
xx coordinate of the new position
yy coordinate of the new position
zz coordinate of the new position
BBDECL float BBCALL xEntityCompoundChildGetX ( Entity *  entity,
int  index 
)

Returns X coordinate of the local position of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
BBDECL float BBCALL xEntityCompoundChildGetY ( Entity *  entity,
int  index 
)

Returns Y coordinate of the local position of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
BBDECL float BBCALL xEntityCompoundChildGetZ ( Entity *  entity,
int  index 
)

Returns Z coordinate of the local position of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
BBDECL void BBCALL xEntityCompoundChildSetRotation ( Entity *  entity,
int  index,
float  pitch,
float  yaw,
float  roll 
)

Sets a new rotation of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
pitchNew pitch angle
yawNew yaw angle
rollNew roll angle
BBDECL float BBCALL xEntityCompoundChildGetPitch ( Entity *  entity,
int  index 
)

Returns a pitch angle of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
BBDECL float BBCALL xEntityCompoundChildGetYaw ( Entity *  entity,
int  index 
)

Returns a yaw angle of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
BBDECL float BBCALL xEntityCompoundChildGetRoll ( Entity *  entity,
int  index 
)

Returns a roll angle of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape