Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
CollisionGroup Class Reference

#include <CollisionGroup.h>

Public Types

using GroupID = uint32
 
using SubGroupID = uint32
 

Public Member Functions

 CollisionGroup ()=default
 Default constructor. More...
 
 CollisionGroup (const GroupFilter *inFilter, GroupID inGroupID, SubGroupID inSubGroupID)
 Construct with all properties. More...
 
void SetGroupFilter (const GroupFilter *inFilter)
 Set the collision group filter. More...
 
const GroupFilterGetGroupFilter () const
 Get the collision group filter. More...
 
void SetGroupID (GroupID inID)
 Set the main group id for this object. More...
 
GroupID GetGroupID () const
 
void SetSubGroupID (SubGroupID inID)
 Add this object to a sub group. More...
 
SubGroupID GetSubGroupID () const
 
bool CanCollide (const CollisionGroup &inOther) const
 Check if this object collides with another object. More...
 
void SaveBinaryState (StreamOut &inStream) const
 Saves the state of this object in binary form to inStream. Does not save group filter. More...
 
void RestoreBinaryState (StreamIn &inStream)
 Restore the state of this object from inStream. Does not save group filter. More...
 

Static Public Attributes

static const GroupID cInvalidGroup = ~GroupID(0)
 
static const SubGroupID cInvalidSubGroup = ~SubGroupID(0)
 

Detailed Description

Two objects collide with each other if:

  • Both don't have a group filter
  • The first group filter says that the objects can collide
  • Or if there's no filter for the first object, the second group filter says the objects can collide

Member Typedef Documentation

◆ GroupID

◆ SubGroupID

Constructor & Destructor Documentation

◆ CollisionGroup() [1/2]

CollisionGroup::CollisionGroup ( )
default

Default constructor.

◆ CollisionGroup() [2/2]

CollisionGroup::CollisionGroup ( const GroupFilter inFilter,
GroupID  inGroupID,
SubGroupID  inSubGroupID 
)
inline

Construct with all properties.

Member Function Documentation

◆ CanCollide()

bool CollisionGroup::CanCollide ( const CollisionGroup inOther) const
inline

Check if this object collides with another object.

◆ GetGroupFilter()

const GroupFilter * CollisionGroup::GetGroupFilter ( ) const
inline

Get the collision group filter.

◆ GetGroupID()

GroupID CollisionGroup::GetGroupID ( ) const
inline

◆ GetSubGroupID()

SubGroupID CollisionGroup::GetSubGroupID ( ) const
inline

◆ RestoreBinaryState()

void CollisionGroup::RestoreBinaryState ( StreamIn inStream)

Restore the state of this object from inStream. Does not save group filter.

◆ SaveBinaryState()

void CollisionGroup::SaveBinaryState ( StreamOut inStream) const

Saves the state of this object in binary form to inStream. Does not save group filter.

◆ SetGroupFilter()

void CollisionGroup::SetGroupFilter ( const GroupFilter inFilter)
inline

Set the collision group filter.

◆ SetGroupID()

void CollisionGroup::SetGroupID ( GroupID  inID)
inline

Set the main group id for this object.

◆ SetSubGroupID()

void CollisionGroup::SetSubGroupID ( SubGroupID  inID)
inline

Add this object to a sub group.

Member Data Documentation

◆ cInvalidGroup

const GroupID CollisionGroup::cInvalidGroup = ~GroupID(0)
static

◆ cInvalidSubGroup

const SubGroupID CollisionGroup::cInvalidSubGroup = ~SubGroupID(0)
static

The documentation for this class was generated from the following files: