Version: 2021.2
LanguageEnglish
  • C#

ModifiableContactPair

struct in UnityEngine

/

Implemented in:UnityEngine.PhysicsModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

A light-weight proxy that allows to access the contact buffers directly.

Properties

bodyInstanceIDInstance ID of the first body in this contact pair.
colliderInstanceIDInstance ID of the first Collider in this contact pair.
contactCountThe amount of the contact points generated for this contact pair.
massPropertiesMass-related properties of this contact pair, such as the mass ratio.
otherBodyInstanceIDInstance ID of the second body in this contact pair.
otherColliderInstanceIDInstance ID of the second collider in this contact pair.
otherPositionWorld-space position of the second collider in this contact pair as seen by the solver.
otherRotationWorld-space rotation of the second collider in this contact pair as seen by the solver.
positionWorld-space position of the first collider in this contact pair as seen by the solver.
rotationWorld-space rotation of the first collider in this contact pair as seen by the solver.

Public Methods

GetBouncinessGet the restitution value for the specified contact point in this contact pair.
GetDynamicFrictionGet the value of the dynamic friction for a specified contact point in this contact pair.
GetFaceIndexGet the index of a face a particular contact point belongs to in this contact pair. Use this with Mesh.triangles.
GetMaxImpulseGet the maximum impulse that the solver can apply at a particular contact point in this contact pair.
GetNormalGet the normal at a particular contact point in this contact pair.
GetPointGet the location of a particular contact point in this contact pair.
GetSeparationGet the separation value at a particular contact point in this contact pair.
GetStaticFrictionGet the static friction coefficient at a particular point of the contact pair.
GetTargetVelocityGet the target velocity the solver should aim reaching at a particular contact point in this contact pair.
IgnoreContactIgnore the specified contact point in this contact pair.
SetBouncinessSet the restitution value for the specified contact point in this contact pair.
SetDynamicFrictionSet the value of the dynamic friction for a specified contact point in this contact pair.
SetMaxImpulseSet the maximum impulse that the solver can apply at a particular contact point in this contact pair.
SetNormalSet the normal at a particular contact point in this contact pair.
SetPointSet the location of a particular contact point in this contact pair.
SetSeparationSet the separation value at a particular contact point in this contact pair.
SetStaticFrictionSet the static friction coefficient at a particular point of the contact pair.
SetTargetVelocitySet the target velocity the solver should aim reaching at a particular contact point in this contact pair.