Table of Contents

Class PhysicsPartition

Namespace
Gravitas
Assembly
Gravitas.dll

Stores the 3D collider IDs assigned to one GridForge voxel.

public class PhysicsPartition : IVoxelPartition
Inheritance
PhysicsPartition
Implements
IVoxelPartition
Inherited Members

Constructors

PhysicsPartition()

Creates an inactive 3D physics partition.

public PhysicsPartition()

Fields

ContainedAwakeDynamicObjects

Stores the subset of dynamic collider IDs whose bodies can currently drive collision work.

public SwiftSparseSet? ContainedAwakeDynamicObjects

Field Value

SwiftSparseSet

ContainedDynamicObjects

Stores context-local dynamic body IDs.

public SwiftSparseSet? ContainedDynamicObjects

Field Value

SwiftSparseSet

ContainedKinematicObjects

Stores context-local kinematic collider IDs.

public SwiftSparseSet? ContainedKinematicObjects

Field Value

SwiftSparseSet

ContainedStaticObjects

Stores context-local static collider IDs.

public SwiftSparseSet? ContainedStaticObjects

Field Value

SwiftSparseSet

Properties

ActivationId

Gets the active-partition slot, or -1 when inactive.

public int ActivationId { get; }

Property Value

int

AwakeDynamicObjectCount

Gets the number of awake dynamic IDs currently in this partition.

public int AwakeDynamicObjectCount { get; }

Property Value

int

IsAllocated

Gets whether this partition has an active-partition slot.

public bool IsAllocated { get; }

Property Value

bool

IsPartitioned

Gets or sets whether this partition is attached to a voxel.

public bool IsPartitioned { get; set; }

Property Value

bool

Owner

Gets the collision service that owns this partition.

public GravitasCollisionService Owner { get; }

Property Value

GravitasCollisionService

WorldIndex

Gets or sets the world voxel occupied by this partition.

public WorldVoxelIndex WorldIndex { get; set; }

Property Value

WorldVoxelIndex

Methods

AddDynamicObject(int)

Adds a dynamic collider ID to this partition.

public void AddDynamicObject(int item)

Parameters

item int

AddKinematicObject(int)

Adds a kinematic collider ID to this partition.

public void AddKinematicObject(int item)

Parameters

item int

AddStaticObject(int)

Adds a static collider ID to this partition.

public void AddStaticObject(int item)

Parameters

item int

ContainsAwakeDynamicObject(int)

Returns true when the supplied dynamic collider ID is marked awake in this partition.

public bool ContainsAwakeDynamicObject(int item)

Parameters

item int

Returns

bool

OnAddToVoxel(Voxel)

Attaches this partition to a voxel.

public void OnAddToVoxel(Voxel voxel)

Parameters

voxel Voxel

OnRemoveFromVoxel(Voxel)

Releases this partition when it is removed from a voxel.

public void OnRemoveFromVoxel(Voxel voxel)

Parameters

voxel Voxel

RemoveDynamicObject(int)

Removes a dynamic collider ID from this partition.

public void RemoveDynamicObject(int item)

Parameters

item int

RemoveKinematicObject(int)

Removes a kinematic collider ID from this partition.

public void RemoveKinematicObject(int item)

Parameters

item int

RemoveStaticObject(int)

Removes a static collider ID from this partition.

public void RemoveStaticObject(int item)

Parameters

item int

SetDynamicObjectAwake(int, bool)

Updates the awake dynamic subset for a collider already present in dynamic membership.

public void SetDynamicObjectAwake(int item, bool awake)

Parameters

item int
awake bool

SetParentIndex(WorldVoxelIndex)

Sets the parent index for the current voxel in the world.

public void SetParentIndex(WorldVoxelIndex parentIndex)

Parameters

parentIndex WorldVoxelIndex

The index to assign as the parent of the current voxel.