Xors3d Engine
Filtering

Functions

int xEntityGetCollisionGroup (Entity *entity)
 Returns a collision filtering group of an entity.
int xEntityGetContactGroup (Entity *entity)
 Returns a contact filtering group of an entity.
int xEntityGetRaycastGroup (Entity *entity)
 Returns a raycast filtering group of an entity.
void xEntitySetCollisionGroup (Entity *entity, int group)
 Sets a collision filtering group of an entity.
void xEntitySetContactGroup (Entity *entity, int group)
 Sets a contact filtering group of an entity.
void xEntitySetRaycastGroup (Entity *entity, int group)
 Sets a raycast filtering group of an entity.
int xPhysicsGetCollisionFilter (int group0, int group1)
 Determines if collision detection is performed between a pair of groups.
int xPhysicsGetContactFilter (int group0, int group1)
 Determines if the first group reports contacts with the second group.
int xPhysicsGetRaycastFilter (int rayGroup, int bodyGroup)
 Determines if the ray group reports hits with the body group.
void xPhysicsSetCollisionFilter (int group0, int group1, int state)
 Specifies if collision should be performed by a pair of body groups.
void xPhysicsSetContactFilter (int group0, int group1, int state)
 Specifies if the first group reports contacts with the second group.
void xPhysicsSetRaycastFilter (int rayGroup, int bodyGroup, int state)
 Specifies if the ray group reports hits with the body group.

Function Documentation

void xEntitySetCollisionGroup ( Entity *  entity,
int  group 
)

Sets a collision filtering group of an entity.

Default group is 0.

Parameters:
entityEntity handle
groupCollision group in the range [0; 31]
int xEntityGetCollisionGroup ( Entity *  entity)

Returns a collision filtering group of an entity.

Parameters:
entityEntity handle
void xEntitySetContactGroup ( Entity *  entity,
int  group 
)

Sets a contact filtering group of an entity.

Default group is 0.

Parameters:
entityEntity handle
groupContact group in the range [0; 31]
int xEntityGetContactGroup ( Entity *  entity)

Returns a contact filtering group of an entity.

Parameters:
entityEntity handle
void xEntitySetRaycastGroup ( Entity *  entity,
int  group 
)

Sets a raycast filtering group of an entity.

Default group is 0.

Parameters:
entityEntity handle
groupRaycast group in the range [0; 31]
int xEntityGetRaycastGroup ( Entity *  entity)

Returns a raycast filtering group of an entity.

Parameters:
entityEntity handle
void xPhysicsSetCollisionFilter ( int  group0,
int  group1,
int  state 
)

Specifies if collision should be performed by a pair of body groups.

Initially all pairs of groups enabled (all the groups collide with each other).
There are 32 collision groups (from 0 to 31).
There is no difference which group is set the first and which one is the second. I.e. xPhysicsSetCollisionFilter(boxes, balls, 0) has the same effect as xPhysicsSetCollisionFilter(balls, boxes, 0).

Parameters:
group0First group in the range [0; 31].
group1Second group in the range [0; 31].
state1 (true) to enable collision between two groups. 0 (false) to disable.
int xPhysicsGetCollisionFilter ( int  group0,
int  group1 
)

Determines if collision detection is performed between a pair of groups.

Parameters:
group0First group in the range [0; 31].
group1Second group in the range [0; 31].
See also:
xPhysicsSetCollisionFilter
xEntitySetCollisionGroup
xEntityGetCollisionGroup
void xPhysicsSetContactFilter ( int  group0,
int  group1,
int  state 
)

Specifies if the first group reports contacts with the second group.

Initially all pairs of groups enabled (all the groups report contacts with each other).
There are 32 contact groups (from 0 to 31).
There is a difference which group is set the first and which one is the second. I.e. xPhysicsSetContactFilter(boxes, balls, 0) has the same effect as xPhysicsSetContactFilter(balls, boxes, 0).
This allows the first group to report contacts with the second group, while the second group doesn't report contacts with the first group. This functionality is useful for making triggers / sensors.

Parameters:
group0First group in the range [0; 31].
group1Second group in the range [0; 31].
state1 (true) to enable contact report. 0 (false) to disable.
int xPhysicsGetContactFilter ( int  group0,
int  group1 
)

Determines if the first group reports contacts with the second group.

Parameters:
group0First group in the range [0; 31].
group1Second group in the range [0; 31].
See also:
xPhysicsSetContactFilter
xEntitySetContactGroup
xEntityGetContactGroup
void xPhysicsSetRaycastFilter ( int  rayGroup,
int  bodyGroup,
int  state 
)

Specifies if the ray group reports hits with the body group.

Initially all hits are reported.
There are 32 ray groups and 32 body groups (from 0 to 31).

Parameters:
rayGroupRay group in the range [0; 31].
bodyGroupBody group in the range [0; 31].
state1 (true) to enable hit report. 0 (false) to disable.
int xPhysicsGetRaycastFilter ( int  rayGroup,
int  bodyGroup 
)

Determines if the ray group reports hits with the body group.

Parameters:
rayGroupRay group in the range [0; 31].
bodyGroupBody group in the range [0; 31].
See also:
xPhysicsSetRaycastFilter
xEntitySetRaycastGroup
xEntityGetRaycastGroup