Class PhysicsPartition2D
- Namespace
- Gravitas
- Assembly
- Gravitas.dll
Stores the pure 2D collider IDs assigned to one GridForge voxel.
public sealed class PhysicsPartition2D : IVoxelPartition
- Inheritance
-
PhysicsPartition2D
- Implements
-
IVoxelPartition
- Inherited Members
Constructors
PhysicsPartition2D()
Creates an inactive 2D physics partition.
public PhysicsPartition2D()
Fields
ContainedAwakeDynamicObjects
Stores the awake subset of the dynamic collider IDs.
public SwiftSparseSet? ContainedAwakeDynamicObjects
Field Value
- SwiftSparseSet
ContainedDynamicObjects
Stores context-local dynamic collider 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
AwakeDynamicObjectCount
Gets the number of awake dynamic IDs in this partition.
public int AwakeDynamicObjectCount { get; }
Property Value
IsAllocated
Gets whether this partition has an active-partition slot.
public bool IsAllocated { get; }
Property Value
IsPartitioned
Gets or sets whether this partition is attached to a voxel.
public bool IsPartitioned { get; set; }
Property Value
Owner
Gets the collision service that owns this partition.
public GravitasCollision2DService Owner { get; }
Property Value
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
itemint
AddKinematicObject(int)
Adds a kinematic collider ID to this partition.
public void AddKinematicObject(int item)
Parameters
itemint
AddStaticObject(int)
Adds a static collider ID to this partition.
public void AddStaticObject(int item)
Parameters
itemint
ContainsAwakeDynamicObject(int)
Returns whether a dynamic collider ID is marked awake.
public bool ContainsAwakeDynamicObject(int item)
Parameters
itemint
Returns
OnAddToVoxel(Voxel)
Attaches this partition to a voxel.
public void OnAddToVoxel(Voxel voxel)
Parameters
voxelVoxel
OnRemoveFromVoxel(Voxel)
Releases this partition when it is removed from a voxel.
public void OnRemoveFromVoxel(Voxel voxel)
Parameters
voxelVoxel
RemoveDynamicObject(int)
Removes a dynamic collider ID from this partition.
public void RemoveDynamicObject(int item)
Parameters
itemint
RemoveKinematicObject(int)
Removes a kinematic collider ID from this partition.
public void RemoveKinematicObject(int item)
Parameters
itemint
RemoveStaticObject(int)
Removes a static collider ID from this partition.
public void RemoveStaticObject(int item)
Parameters
itemint
SetDynamicObjectAwake(int, bool)
Updates the awake state for a dynamic collider in this partition.
public void SetDynamicObjectAwake(int item, bool awake)
Parameters
SetParentIndex(WorldVoxelIndex)
Updates the world voxel index used by this partition.
public void SetParentIndex(WorldVoxelIndex parentIndex)
Parameters
parentIndexWorldVoxelIndex