Struct CollisionMatrix
- Namespace
- Stride.BepuPhysics.Definitions
- Assembly
- Stride.BepuPhysics.dll
Defines how layers collide between each other.
public struct CollisionMatrix : IEquatable<CollisionMatrix>
- Implements
- Inherited Members
Remarks
This structure is VERY large, prefer referencing it directly instead of passing it around.
Fields
All
public static CollisionMatrix All
Field Value
DataBits
public const int DataBits = 528
Field Value
DataLength
public const int DataLength = 17
Field Value
Methods
Equals(CollisionMatrix)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(CollisionMatrix other)
Parameters
other
CollisionMatrixAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
Get(CollisionLayer)
Return all layers colliding with a given layer
public readonly CollisionMask Get(CollisionLayer layer)
Parameters
layer
CollisionLayer
Returns
Remarks
Prefer Get(CollisionLayer, CollisionLayer) over this one when checking a single layer
Get(CollisionLayer, CollisionLayer)
Returns whether two layers would collide with each other
public readonly bool Get(CollisionLayer layer1, CollisionLayer layer2)
Parameters
layer1
CollisionLayerlayer2
CollisionLayer
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
LayersToIndex(CollisionLayer, CollisionLayer)
public static int LayersToIndex(CollisionLayer layer1, CollisionLayer layer2)
Parameters
layer1
CollisionLayerlayer2
CollisionLayer
Returns
Set(CollisionLayer, CollisionLayer, bool)
Set whether two layers should collide with each other
public void Set(CollisionLayer layer1, CollisionLayer layer2, bool shouldCollide)
Parameters
layer1
CollisionLayerlayer2
CollisionLayershouldCollide
bool
Set(CollisionLayer, CollisionMask)
Set all layers that should collide with a given layer
public void Set(CollisionLayer layer, CollisionMask mask)
Parameters
layer
CollisionLayermask
CollisionMask
Remarks
Prefer Set(CollisionLayer, CollisionLayer, bool) over this one when setting one or two layers
Operators
operator ==(CollisionMatrix, CollisionMatrix)
public static bool operator ==(CollisionMatrix left, CollisionMatrix right)
Parameters
left
CollisionMatrixright
CollisionMatrix
Returns
operator !=(CollisionMatrix, CollisionMatrix)
public static bool operator !=(CollisionMatrix left, CollisionMatrix right)
Parameters
left
CollisionMatrixright
CollisionMatrix