Post

Contact

Contact

Overview

Contact nodes are produced as output events when two collidable objects or spaces make contact.

The Contact node belongs to the RigidBodyPhysics component and requires at least level 2, its default container field is contacts. It is available from X3D version 3.2 or higher.

Hierarchy

1
2
+ X3DNode
  + Contact

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

SFVec3f [in, out] position 0 0 0 (-∞,∞)

position (x, y, z in meters) of exact location of collision.

SFVec3f [in, out] contactNormal 0 1 0 (-∞,∞)

contactNormal is unit vector describing normal between two colliding bodies.

SFFloat [in, out] depth 0 (-∞,∞)

depth indicates how deep the current intersection is along normal vector.

MFString [in, out] appliedParameters “BOUNCE”

Default global parameters for collision outputs of rigid body physics system. Contact node can override parent CollisionCollection node. Selectable values for array: “BOUNCE” “USER_FRICTION” “FRICTION_COEFFICIENT_2” “ERROR_REDUCTION” “CONSTANT_FORCE” “SPEED_1” “SPEED_2” “SLIP_1” “SLIP_2”.

Hint

  • BOUNCE: bounce value is used; USER_FRICTION: apply user-supplied value; FRICTION_COEFFICIENT_2: apply frictionCoefficients values; ERROR_REDUCTION: apply softnessErrorCorrection value; CONSTANT_FORCE: apply softnessConstantForceMix value; SPEED_1: apply first component of surfaceSpeed array; SPEED_2: apply second component of surfaceSpeed array; SLIP_1: apply first component of slipFactors array; SLIP_2: apply second component of slipFactors array.

SFFloat [in, out] bounce 0 [0,1]

bounce indicates bounciness (0 = no bounce at all, 1 = maximum bounce).

SFFloat [in, out] minBounceSpeed [0,∞)

minBounceSpeed m/s needed to bounce.

SFVec3f [in, out] frictionDirection 0 1 0 (-∞,∞)

frictionDirection controls friction vector.

Hint

  • Value of (0 0 0) indicates no friction.

SFVec2f [in, out] frictionCoefficients 0 0 [0,∞)

frictionCoefficients used for computing surface drag.

SFVec2f [in, out] surfaceSpeed 0 0 (-∞,∞)

surfaceSpeed defines speed vectors for computing surface drag, if contact surfaces move independently of bodies.

SFVec2f [in, out] slipCoefficients 0 0 (-∞,∞)

slipCoefficients used for computing surface drag.

SFFloat [in, out] softnessConstantForceMix 0.0001 [0,1]

softnessConstantForceMix value applies a constant force value to make colliding surfaces appear to be somewhat soft.

SFFloat [in, out] softnessErrorCorrection 0.8 [0,1]

softnessErrorCorrection indicates fraction of collision error fixed in a set of evaluations (0 = no error correction, 1 = all errors corrected in single step).

SFNode [in, out] geometry1 NULL [X3DNBodyCollidableNode]

The geometry1 and geometry2 fields specify collision-related information about body1 and body2.

SFNode [in, out] geometry2 NULL [X3DNBodyCollidableNode]

The geometry1 and geometry2 fields specify collision-related information about body1 and body2.

SFNode [in, out] body1 NULL [RigidBody]

The body1 and body2 fields specify two top-level nodes that should be evaluated in the physics model as a single set of interactions with respect to each other.

SFNode [in, out] body2 NULL [RigidBody]

The body1 and body2 fields specify two top-level nodes that should be evaluated in the physics model as a single set of interactions with respect to each other.

Advice

Hint

  • Each Contact node contains two RigidBody nodes (containerField='body1' and containerField='body2') as well as two CollidableShape or CollidableOffset nodes (containerField='geometry1' and containerField='geometry2').

Warning

  • Contact nodes are transient and can only occur at run time. It is an error to define this transient node in an X3D file.

See Also

This post is licensed under CC BY 4.0 by the author.