Table of Contents

Struct StaticReference

Namespace
BepuPhysics
Assembly
BepuPhysics.dll

Convenience structure for directly referring to a static's properties.

public struct StaticReference
Inherited Members

Remarks

Note that this type makes no attempt to protect against unsafe modification of static properties.

Constructors

StaticReference(StaticHandle, Statics)

Constructs a new static reference.

public StaticReference(StaticHandle handle, Statics statics)

Parameters

handle StaticHandle

Handle of the static to refer to.

statics Statics

Collection containing the static.

Fields

Handle

Handle of the static that this reference refers to.

public StaticHandle Handle

Field Value

StaticHandle

Statics

The collection containing the static.

public Statics Statics

Field Value

Statics

Properties

BoundingBox

Gets a copy of the static's bounding box.

public BoundingBox BoundingBox { get; }

Property Value

BoundingBox

CollidableReference

Gets a CollidableReference for this static. CollidableReferences uniquely identify a collidable object in a simulation by including both the dynamic/kinematic/static state of the object and its handle.

Despite an unfortunate naming collision, CollidableReferences are distinct from a direct reference to a static's collidable data, which you can get from the Collidable property.

public CollidableReference CollidableReference { get; }

Property Value

CollidableReference

Continuity

Gets a reference to the static's collision continuity settings.

public ref ContinuousDetection Continuity { get; }

Property Value

ContinuousDetection

Exists

Gets whether the static reference exists within the static set. True if the handle maps to a valid memory location that agrees that the handle points to it, false otherwise.

public bool Exists { get; }

Property Value

bool

Index

Gets a the static's index in the statics collection.

public int Index { get; }

Property Value

int

Pose

Gets a reference to the static's pose.

public ref RigidPose Pose { get; }

Property Value

RigidPose

Shape

Gets the shape used by the static. To set the shape, use SetShape(TypedIndex) or ApplyDescription(in StaticDescription).

public TypedIndex Shape { get; }

Property Value

TypedIndex

Static

Gets a reference to the entirety of the static's memory.

public ref Static Static { get; }

Property Value

Static

Methods

ApplyDescription(in StaticDescription)

Sets a static's properties according to a description.

public void ApplyDescription(in StaticDescription description)

Parameters

description StaticDescription

Description of the static.

GetBoundsReferencesFromBroadPhase(out Vector3*, out Vector3*)

Gets direct pointers to the static's bounding box minimum and maximum in the broad phase. Outputs null if the static has no shape.

public void GetBoundsReferencesFromBroadPhase(out Vector3* min, out Vector3* max)

Parameters

min Vector3*

Pointer to the bounding box minimum in the broad phase.

max Vector3*

Pointer to the bounding box maximum in the broad phase.

GetDescription()

Gets a description of the static.

public StaticDescription GetDescription()

Returns

StaticDescription

Description of the static.

GetDescription(out StaticDescription)

Gets a description of the static.

public void GetDescription(out StaticDescription description)

Parameters

description StaticDescription

Description of the static.

SetShape(TypedIndex)

Changes the shape of a static.

public void SetShape(TypedIndex newShape)

Parameters

newShape TypedIndex

Index of the new shape to use for the static.

UpdateBounds()

Updates the static's bounds in the broad phase for its current state. Does not include velocity expansion. Does nothing if the static has no shape.

public void UpdateBounds()

Remarks

Can be useful if you made modifications to the static's state that you want reflected in the broad phase before the next timestep. For example, if you want to perform ray casts against the broad phase after moving objects around directly, their bounds must be updated or else the broad phase bounds will be out of date and the ray will likely miss.