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.ColliderRegistry Class Referencesealed

Manages registration and querying of colliders, separating them into static and dynamic collections for efficient collision detection. More...

Public Member Functions

void QueryInstances (in Aabb area, int layerMask, int collidesWithMask, List< ColliderInstance > results, ICollider? ignore=null)
 Queries canonical colliders with translated bounds for every overlapping wrapped instance. Collision masks and the ignored collider apply to canonical identities.
void Register (ICollider collider)
 Registers a collider with the registry. The collider is added to either the static or dynamic collection based on its ICollider.IsStatic property.
void Unregister (ICollider collider)
 Unregisters a collider from the registry, removing it from either the static or dynamic collection based on its ICollider.IsStatic property.
void QueryAabb (in Aabb area, int layerMask, int collidesWithMask, List< ICollider > results, ICollider? ignore=null)
 Broad-phase query: returns colliders overlapping the given AABB that also match the provided layer mask (bitwise AND with their LayerMask / CollidesWithMask). On periodic layers, returns unique canonical identities for overlapping images. Use QueryInstances when translated bounds are needed.

Properties

IEnumerable< ICollider > StaticColliders [get]
 Gets the collection of static colliders registered in this registry.
IEnumerable< ICollider > DynamicColliders [get]
 Gets the collection of dynamic colliders registered in this registry.

Detailed Description

Manages registration and querying of colliders, separating them into static and dynamic collections for efficient collision detection.

Definition at line 7 of file ColliderRegistry.cs.

Member Function Documentation

◆ QueryAabb()

void Gondwana.Physics.Collisions.ColliderRegistry.QueryAabb ( in Aabb area,
int layerMask,
int collidesWithMask,
List< ICollider > results,
ICollider? ignore = null )

Broad-phase query: returns colliders overlapping the given AABB that also match the provided layer mask (bitwise AND with their LayerMask / CollidesWithMask). On periodic layers, returns unique canonical identities for overlapping images. Use QueryInstances when translated bounds are needed.

Parameters
areaThe axis-aligned bounding box to query within.
layerMaskThe layer mask to test against each collider's ICollider.CollidesWith mask.
collidesWithMaskThe collision mask to test against each collider's ICollider.CollisionGroup.
resultsThe list to populate with matching colliders. This list is cleared before adding results.
ignoreAn optional collider to exclude from the results.

Definition at line 100 of file ColliderRegistry.cs.

◆ QueryInstances()

void Gondwana.Physics.Collisions.ColliderRegistry.QueryInstances ( in Aabb area,
int layerMask,
int collidesWithMask,
List< ColliderInstance > results,
ICollider? ignore = null )

Queries canonical colliders with translated bounds for every overlapping wrapped instance. Collision masks and the ignored collider apply to canonical identities.

Parameters
areaThe area.
layerMaskThe layer mask.
collidesWithMaskThe collides with mask.
resultsThe results.
ignoreThe ignore.

Definition at line 20 of file ColliderRegistry.cs.

◆ Register()

void Gondwana.Physics.Collisions.ColliderRegistry.Register ( ICollider collider)

Registers a collider with the registry. The collider is added to either the static or dynamic collection based on its ICollider.IsStatic property.

Parameters
colliderThe collider to register.
Exceptions
ArgumentNullExceptionThrown when collider is null.

Definition at line 62 of file ColliderRegistry.cs.

◆ Unregister()

void Gondwana.Physics.Collisions.ColliderRegistry.Unregister ( ICollider collider)

Unregisters a collider from the registry, removing it from either the static or dynamic collection based on its ICollider.IsStatic property.

Parameters
colliderThe collider to unregister. If null, no action is taken.

Definition at line 78 of file ColliderRegistry.cs.

Property Documentation

◆ DynamicColliders

IEnumerable<ICollider> Gondwana.Physics.Collisions.ColliderRegistry.DynamicColliders
get

Gets the collection of dynamic colliders registered in this registry.

Definition at line 54 of file ColliderRegistry.cs.

◆ StaticColliders

IEnumerable<ICollider> Gondwana.Physics.Collisions.ColliderRegistry.StaticColliders
get

Gets the collection of static colliders registered in this registry.

Definition at line 49 of file ColliderRegistry.cs.