Nudge Physics
A single file, header-only 3D physics library
Loading...
Searching...
No Matches
Filter-Bodies Functions

Set of functions regarding body filtering (i.e. body collision group and mask and body flags) More...

Functions

void nudge::body_set_collision_group_and_mask (context_t *c, uint32_t body, CollisionMask single_collision_group_body_belongs_to, CollisionMask collision_group_mask_body_can_collide_with=COLLISION_GROUP_ALL)
 Sets the body collision group (a single value of COLLISION_GROUP_) and mask (a combination of COLLISION_GROUP_ values)
 
CollisionMasknudge::body_get_collision_group (context_t *c, uint32_t body)
 Gets the body collision group (a single value of COLLISION_GROUP_)
 
CollisionMasknudge::body_get_collision_mask (context_t *c, uint32_t body)
 Gets the body collision mask (a combination of COLLISION_GROUP_ values)
 
FlagMasknudge::body_get_flags (context_t *c, uint32_t body)
 Shortcut that returns a pointer to the body flags (a combination of BF_ enums)
 

Detailed Description

Set of functions regarding body filtering (i.e. body collision group and mask and body flags)

Function Documentation

◆ body_set_collision_group_and_mask()

void nudge::body_set_collision_group_and_mask ( context_t c,
uint32_t  body,
CollisionMask  single_collision_group_body_belongs_to,
CollisionMask  collision_group_mask_body_can_collide_with = COLLISION_GROUP_ALL 
)
inline

Sets the body collision group (a single value of COLLISION_GROUP_) and mask (a combination of COLLISION_GROUP_ values)

Note
Please use a single group per body

◆ body_get_collision_group()

CollisionMask * nudge::body_get_collision_group ( context_t c,
uint32_t  body 
)
inline

Gets the body collision group (a single value of COLLISION_GROUP_)

Returns
a pointer to the body collision group
Note
This mask indicates the group this body belongs. Please use a single group per body

◆ body_get_collision_mask()

CollisionMask * nudge::body_get_collision_mask ( context_t c,
uint32_t  body 
)
inline

Gets the body collision mask (a combination of COLLISION_GROUP_ values)

Returns
a pointer to the body collision mask
Note
This mask indicates the groups this body wants to collide with.

◆ body_get_flags()

FlagMask * nudge::body_get_flags ( context_t c,
uint32_t  body 
)
inline

Shortcut that returns a pointer to the body flags (a combination of BF_ enums)

Returns
a pointer to the body flags