Class GravitasPhysicsService
- Namespace
- Gravitas
- Assembly
- Gravitas.dll
Owns physics registration and collision-pair state for one GravitasWorldContext.
public sealed class GravitasPhysicsService
- Inheritance
-
GravitasPhysicsService
- Inherited Members
Constructors
GravitasPhysicsService(GravitasWorldContext)
Initializes a new physics service for the supplied context.
public GravitasPhysicsService(GravitasWorldContext context)
Parameters
contextGravitasWorldContextThe owning world context.
Properties
BodyCount
Gets the number of dynamic bodies currently registered in this context.
public int BodyCount { get; }
Property Value
ColliderCount
Gets the number of colliders currently registered in this context.
public int ColliderCount { get; }
Property Value
LastContinuousCollisionIslandCount
Gets how many service-owned continuous-collision handoff batches were consumed during the last late step.
public int LastContinuousCollisionIslandCount { get; }
Property Value
LastContinuousCollisionIslandIterationCount
Gets how many service-owned continuous-collision handoff iterations were consumed during the last late step.
public int LastContinuousCollisionIslandIterationCount { get; }
Property Value
LastContinuousCollisionIslandLimitReached
Gets whether the service-owned continuous-collision handoff queue hit its deterministic iteration cap.
public bool LastContinuousCollisionIslandLimitReached { get; }
Property Value
PeakColliderCount
Gets the highest collider ID allocated in this context.
public int PeakColliderCount { get; }
Property Value
SimulatePhysics
Gets or sets whether this context should simulate physics.
public bool SimulatePhysics { get; set; }
Property Value
Methods
CreateStaticSurface(ReadOnlySpan<LSMeshCollider>)
Creates a context-owned continuity declaration for static meshes using triangle-surface collision.
public StaticSurface CreateStaticSurface(ReadOnlySpan<LSMeshCollider> members)
Parameters
membersReadOnlySpan<LSMeshCollider>Distinct active bodyless or explicit-static meshes in Concave registered in this context. May be empty.
Returns
- StaticSurface
A declaration that retains each member's collider identity and joins only exact shared boundary spans.
Remarks
Call between complete fixed steps. 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()
Runs this context's late physics step.
public void LateSimulate()
Reset()
Clears all context-local physics registration state.
public void Reset()
Simulate()
Runs this context's physics simulation step.
public void Simulate()
TryGetColliderById(int, out LSCollider?)
Resolves a context-local collider ID.
public bool TryGetColliderById(int id, out LSCollider? collider)
Parameters
idintThe context-local collider ID.
colliderLSColliderThe resolved collider, if present.
Returns
- bool
True when the ID resolves in this context.
Visualize()
Publishes interpolated presentation state for registered 3D bodies.
public void Visualize()