Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Physics.Collisions.CollisionGroupRegistry Class Referencesealed

Manages collision group definitions and provides bitwise mask values for collision filtering. Groups are represented as bit flags to allow efficient collision detection using bitwise operations. More...

Public Member Functions

 CollisionGroupRegistry ()
 Initializes a new instance of the CollisionGroupRegistry class with predefined collision groups: WorldStatic, Actors, Projectiles, and Triggers.
int Define (string name)
 Defines a new collision group with the specified name, or returns the existing group value if already defined. Each group is assigned a unique bit flag value.
int Get (string name)
 Gets the bit flag value for a previously defined collision group.
int GetMask (IEnumerable< string > names)
 Combines previously defined collision groups into one bit mask. An empty collection resolves to CollisionMasks.None.
IReadOnlyCollection< string > GetGroupNames ()
 Gets a read-only collection of all defined collision group names.

Properties

int WorldStatic [get]
 Gets the bit flag value for the WorldStatic collision group.
int Actors [get]
 Gets the bit flag value for the Actors collision group.
int Projectiles [get]
 Gets the bit flag value for the Projectiles collision group.
int Triggers [get]
 Gets the bit flag value for the Triggers collision group.

Detailed Description

Manages collision group definitions and provides bitwise mask values for collision filtering. Groups are represented as bit flags to allow efficient collision detection using bitwise operations.

Definition at line 9 of file CollisionGroupRegistry.cs.

Constructor & Destructor Documentation

◆ CollisionGroupRegistry()

Gondwana.Physics.Collisions.CollisionGroupRegistry.CollisionGroupRegistry ( )

Initializes a new instance of the CollisionGroupRegistry class with predefined collision groups: WorldStatic, Actors, Projectiles, and Triggers.

Definition at line 21 of file CollisionGroupRegistry.cs.

Member Function Documentation

◆ Define()

int Gondwana.Physics.Collisions.CollisionGroupRegistry.Define ( string name)

Defines a new collision group with the specified name, or returns the existing group value if already defined. Each group is assigned a unique bit flag value.

Parameters
nameThe case-insensitive collision group name.
Returns
The bit flag assigned to the new or existing group.

Definition at line 53 of file CollisionGroupRegistry.cs.

◆ Get()

int Gondwana.Physics.Collisions.CollisionGroupRegistry.Get ( string name)

Gets the bit flag value for a previously defined collision group.

Parameters
nameThe case-insensitive collision group name.
Returns
The bit flag assigned to the named collision group.

Definition at line 74 of file CollisionGroupRegistry.cs.

◆ GetGroupNames()

IReadOnlyCollection< string > Gondwana.Physics.Collisions.CollisionGroupRegistry.GetGroupNames ( )

Gets a read-only collection of all defined collision group names.

Returns
The names of the currently defined collision groups.

◆ GetMask()

int Gondwana.Physics.Collisions.CollisionGroupRegistry.GetMask ( IEnumerable< string > names)

Combines previously defined collision groups into one bit mask. An empty collection resolves to CollisionMasks.None.

Parameters
namesThe registered collision group names to combine.
Returns
The bitwise union of the named groups, or zero for an empty collection.

Definition at line 88 of file CollisionGroupRegistry.cs.

Property Documentation

◆ Actors

int Gondwana.Physics.Collisions.CollisionGroupRegistry.Actors
get

Gets the bit flag value for the Actors collision group.

Definition at line 113 of file CollisionGroupRegistry.cs.

◆ Projectiles

int Gondwana.Physics.Collisions.CollisionGroupRegistry.Projectiles
get

Gets the bit flag value for the Projectiles collision group.

Definition at line 118 of file CollisionGroupRegistry.cs.

◆ Triggers

int Gondwana.Physics.Collisions.CollisionGroupRegistry.Triggers
get

Gets the bit flag value for the Triggers collision group.

Definition at line 123 of file CollisionGroupRegistry.cs.

◆ WorldStatic

int Gondwana.Physics.Collisions.CollisionGroupRegistry.WorldStatic
get

Gets the bit flag value for the WorldStatic collision group.

Definition at line 108 of file CollisionGroupRegistry.cs.