Xors3d Engine
Compound

Functions

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

Function Documentation

void 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
int 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
int xEntityCompoundAddSphere ( Entity *  entity,
float  radius 
)

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

Parameters:
entityEntity handle
radiusRadius of the sphere subshape
int 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
int 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
int 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
int xEntityCompoundCountChildren ( Entity *  entity)

Returns the number of compound's subshapes.

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

Removes a compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape
void 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
float xEntityCompoundChildGetX ( Entity *  entity,
int  index 
)

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

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

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

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

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

Parameters:
entityEntity handle
indexIndex of the subshape
void 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
float xEntityCompoundChildGetPitch ( Entity *  entity,
int  index 
)

Returns a pitch angle of the compound's subshape.

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

Returns a yaw angle of the compound's subshape.

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

Returns a roll angle of the compound's subshape.

Parameters:
entityEntity handle
indexIndex of the subshape