Xors3d Engine
Filtering

Functions

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

Function Documentation

BBDECL void BBCALL 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]
BBDECL int BBCALL xEntityGetCollisionGroup ( Entity *  entity)

Returns a collision filtering group of an entity.

Parameters:
entityEntity handle
BBDECL void BBCALL 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]
BBDECL int BBCALL xEntityGetContactGroup ( Entity *  entity)

Returns a contact filtering group of an entity.

Parameters:
entityEntity handle
BBDECL void BBCALL 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]
BBDECL int BBCALL xEntityGetRaycastGroup ( Entity *  entity)

Returns a raycast filtering group of an entity.

Parameters:
entityEntity handle
BBDECL void BBCALL 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.
BBDECL int BBCALL 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
BBDECL void BBCALL 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.
BBDECL int BBCALL 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
BBDECL void BBCALL 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.
BBDECL int BBCALL 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