Class PhysicsSettings
- Namespace
- Gravitas
- Assembly
- Gravitas.dll
Stores context-local configuration for deterministic physics simulation.
public sealed class PhysicsSettings
- Inheritance
-
PhysicsSettings
- Inherited Members
Constructors
PhysicsSettings(int?, bool[,]?, PhysicsLayerMask?)
Creates physics settings, using registered-layer defaults for omitted values.
public PhysicsSettings(int? frameRate, bool[,]? collisionMatrix, PhysicsLayerMask? groundCheckLayerMask = null)
Parameters
frameRateint?collisionMatrixbool[,]groundCheckLayerMaskPhysicsLayerMask?
Fields
DefaultContinuousCollisionMaxToiIterations
Default maximum same-frame time-of-impact iterations for continuous collision.
public const int DefaultContinuousCollisionMaxToiIterations = 4
Field Value
DefaultDiscreteSolverIterations
Default projected-impulse iteration count for discrete 3D constraint islands.
public const int DefaultDiscreteSolverIterations = 6
Field Value
DefaultFrameRate
Default fixed-step frame rate in simulation frames per second.
public const int DefaultFrameRate = 32
Field Value
DefaultGroundCheckLayerMask
Default include mask used for ground and support checks.
public static readonly PhysicsLayerMask DefaultGroundCheckLayerMask
Field Value
DefaultMixed2DHalfThickness
Default Y-axis half-thickness for 2D colliders embedded in mixed queries and contacts.
public static readonly Fixed64 DefaultMixed2DHalfThickness
Field Value
- Fixed64
DefaultRestitutionVelocityThreshold
Default closing-speed threshold below which restitution is disabled.
public static readonly Fixed64 DefaultRestitutionVelocityThreshold
Field Value
- Fixed64
DefaultRetainedPartitionRetirementSweepBudget
Default maximum number of retained partitions checked per retirement sweep.
public const int DefaultRetainedPartitionRetirementSweepBudget = 64
Field Value
DefaultRetainedPartitionTimeToKillFrames
Default number of frames an empty partition remains retained for reuse.
public const int DefaultRetainedPartitionTimeToKillFrames = 320
Field Value
MaxLayers
Maximum number of physics layers represented by a layer mask.
public const int MaxLayers = 32
Field Value
MaxResolvableFrameRate
Maximum supported fixed-step frame rate.
public const int MaxResolvableFrameRate = 16711935
Field Value
Remarks
Higher values quantize DeltaTime at or below FixedMathSharp.Fixed64.Epsilon, which would make integration and CCD degeneracy checks disagree about whether a step has meaningful duration.
Properties
CollisionMatrix
Gets the layer-to-layer physical collision enablement matrix.
public bool[,] CollisionMatrix { get; }
Property Value
- bool[,]
ContinuousCollisionMaxToiIterations
Gets or sets the maximum same-frame continuous-collision TOI iterations one body or handoff queue may consume.
public int ContinuousCollisionMaxToiIterations { get; set; }
Property Value
DefaultContinuousCollisionMode
Gets or sets the default tunneling policy used by bodies configured to inherit from the context. A context default of Inherit resolves to Discrete.
public ContinuousCollisionMode DefaultContinuousCollisionMode { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
The value is not a declared continuous-collision mode.
DiscreteSolverIterations
Gets or sets the bounded projected-impulse iteration count used for 3D discrete contact and joint constraint islands. Contact-only single-pair scenes stay on the direct one-pass response path.
public int DiscreteSolverIterations { get; set; }
Property Value
FrameRate
Gets the fixed-step frame rate in simulation frames per second.
public int FrameRate { get; }
Property Value
GroundCheckLayerMask
Gets or sets the include mask used for ground and support checks.
public PhysicsLayerMask GroundCheckLayerMask { get; set; }
Property Value
Mixed2DHalfThickness
Gets or sets the default half-thickness used when pure 2D colliders are embedded into mixed 2D/3D contacts.
public Fixed64 Mixed2DHalfThickness { get; set; }
Property Value
- Fixed64
PoolingEnabled
Gets or sets whether reusable runtime collision objects are pooled.
public bool PoolingEnabled { get; set; }
Property Value
RestitutionVelocityThreshold
Gets or sets the closing speed at or below which contact response uses zero restitution.
public Fixed64 RestitutionVelocityThreshold { get; set; }
Property Value
- Fixed64
RetainedPartitionRetirementSweepBudget
Gets or sets the maximum retained partitions checked for retirement during one collision distribution step. A value of zero disables retirement sweeps.
public int RetainedPartitionRetirementSweepBudget { get; set; }
Property Value
RetainedPartitionTimeToKillFrames
Gets or sets how many simulation frames an empty voxel partition should stay attached for fast reuse. A value of zero retires eligible partitions on the next retirement sweep.
public int RetainedPartitionTimeToKillFrames { get; set; }
Property Value
RuntimeMode
Gets or sets which dimensional physics service this context should advance.
public PhysicsRuntimeMode RuntimeMode { get; set; }
Property Value
Methods
DefaultSettings()
Creates settings with default values and the currently registered layer matrix.
public static PhysicsSettings DefaultSettings()
Returns
GetRegisteredCollisionMatrix()
Creates a fully enabled square collision matrix sized to the registered layer names.
public static bool[,] GetRegisteredCollisionMatrix()
Returns
- bool[,]
SetFrameRate(int)
Sets the fixed-step frame rate after validating its representable range.
public void SetFrameRate(int frameRate)
Parameters
frameRateint