Struct MixedContact
- Namespace
- Gravitas.CollisionHandling
- Assembly
- Gravitas.dll
Contact generated between one 3D collider and one embedded 2D collider.
public readonly struct MixedContact
- Inherited Members
Constructors
MixedContact(Vector3d, Vector3d, Vector3d, Fixed64, bool)
Creates a mixed contact from world-space witness points.
public MixedContact(Vector3d point3D, Vector3d point2D, Vector3d normal3DTo2D, Fixed64 depth, bool depthIsClamped = false)
Parameters
point3DVector3dpoint2DVector3dnormal3DTo2DVector3ddepthFixed64depthIsClampedbool
MixedContact(ContactAnchor, ContactAnchor, Vector3d, Fixed64, bool)
Creates a mixed contact with authoritative rigid-frame witnesses.
public MixedContact(ContactAnchor anchor3D, ContactAnchor anchor2D, Vector3d normal3DTo2D, Fixed64 depth, bool depthIsClamped = false)
Parameters
anchor3DContactAnchoranchor2DContactAnchornormal3DTo2DVector3ddepthFixed64depthIsClampedbool
Exceptions
- ArgumentException
Either rigid-frame anchor is invalid.
Properties
Anchor2D
Gets the authoritative contact anchor on the embedded 2D collider.
public ContactAnchor Anchor2D { get; }
Property Value
Anchor3D
Gets the authoritative contact anchor on the 3D collider.
public ContactAnchor Anchor3D { get; }
Property Value
Depth
Gets the penetration depth along Normal3DTo2D.
public Fixed64 Depth { get; }
Property Value
- Fixed64
DepthIsClamped
Gets whether the exact penetration depth exceeded the scalar domain and Depth therefore contains FixedMathSharp.Fixed64.MaxValue.
public bool DepthIsClamped { get; }
Property Value
HasContact
Gets whether this value contains a valid mixed contact.
public bool HasContact { get; }
Property Value
HasMaterialOverride
Gets whether the contact carries per-feature material values.
public bool HasMaterialOverride { get; }
Property Value
Material2D
Gets the material sampled from the embedded 2D contact feature.
public PhysicsMaterial Material2D { get; }
Property Value
Material3D
Gets the material sampled from the 3D contact feature.
public PhysicsMaterial Material3D { get; }
Property Value
Normal3DTo2D
Contact normal pointing from the 3D collider toward the embedded 2D collider volume.
public Vector3d Normal3DTo2D { get; }
Property Value
- Vector3d
Point2D
Gets the world-space witness point on the embedded 2D collider.
public Vector3d Point2D { get; }
Property Value
- Vector3d
Point3D
Gets the world-space witness point on the 3D collider.
public Vector3d Point3D { get; }
Property Value
- Vector3d
Methods
TryGetPoint2D(out Vector3d)
Attempts to resolve the embedded 2D anchor to a world-space point.
public bool TryGetPoint2D(out Vector3d point)
Parameters
pointVector3d
Returns
TryGetPoint3D(out Vector3d)
Attempts to resolve the 3D anchor to a world-space point.
public bool TryGetPoint3D(out Vector3d point)
Parameters
pointVector3d