Table of Contents

Class GravitasPhysics2DService

Namespace
Gravitas
Assembly
Gravitas.dll

Context-owned pure 2D body, broad-phase, narrow-phase, response, and query service.

public sealed class GravitasPhysics2DService
Inheritance
GravitasPhysics2DService
Inherited Members

Constructors

GravitasPhysics2DService(GravitasWorldContext)

Creates the pure 2D physics service for a world context.

public GravitasPhysics2DService(GravitasWorldContext context)

Parameters

context GravitasWorldContext

Properties

BodyCount

Gets the number of registered dynamic bodies.

public int BodyCount { get; }

Property Value

int

ColliderCount

Gets the number of registered 2D colliders.

public int ColliderCount { get; }

Property Value

int

LastContinuousCollisionIslandCount

Gets how many service-owned continuous-collision handoff batches were consumed during the last late step.

public int LastContinuousCollisionIslandCount { get; }

Property Value

int

LastContinuousCollisionIslandIterationCount

Gets how many service-owned continuous-collision handoff iterations were consumed during the last late step.

public int LastContinuousCollisionIslandIterationCount { get; }

Property Value

int

LastContinuousCollisionIslandLimitReached

Gets whether the service-owned continuous-collision handoff queue hit its deterministic iteration cap.

public bool LastContinuousCollisionIslandLimitReached { get; }

Property Value

bool

SimulatePhysics

Gets or sets whether this service advances pure 2D physics.

public bool SimulatePhysics { get; set; }

Property Value

bool

Methods

CreateStaticSurface(ReadOnlySpan<LSCollider2D>)

Creates a context-owned continuity declaration for static filled planar pieces.

public StaticSurface2D CreateStaticSurface(ReadOnlySpan<LSCollider2D> members)

Parameters

members ReadOnlySpan<LSCollider2D>

Distinct active bodyless or explicit-static AABB or convex polygon colliders registered in this context. May be empty.

Returns

StaticSurface2D

A declaration that retains each member's collider identity and joins only exact shared boundary spans.

Remarks

Call between complete fixed steps. Compound roots/leaves are ineligible. Context reset or disposal expires the returned handle.

Exceptions

ArgumentException

A member is ineligible or already belongs to a declaration.

ObjectDisposedException

The context has ended.

InvalidOperationException

A fixed step is in progress.

LateSimulate()

Completes deferred pure 2D collision, response, and bookkeeping work.

public void LateSimulate()

Reset()

Clears all context-local pure 2D registration and solver state.

public void Reset()

Simulate()

Runs the authoritative pure 2D simulation phase.

public void Simulate()

Visualize()

Publishes interpolated presentation state for registered 2D bodies.

public void Visualize()