Interface Contact

All Superinterfaces:
X3DNode
All Known Implementing Classes:
ContactObject

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

X3D node tooltip: (X3D version 3.2 or later) [X3DNode] Contact nodes are produced as output events when two collidable objects or spaces make contact.
  • 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.

Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
See Also:
SAI Java Specification: TODO, X3D Abstract Specification: Contact, X3D Tooltips: Contact, X3D Scene Authoring Hints
  • Method Summary

    Modifier and Type Method Description
    java.lang.String[] getAppliedParameters()
    Provide array of String enumeration results ( baseType appliedParametersChoices) [""BOUNCE"" | ""USER_FRICTION"" | ""FRICTION_COEFFICIENT-2"" | ""ERROR_REDUCTION"" | ""CONSTANT_FORCE"" | ""SPEED-1"" | ""SPEED-2"" | ""SLIP-1"" | ""SLIP-2""] from inputOutput MFString field named appliedParameters.
    RigidBody getBody1()
    Provide RigidBody instance (using a properly typed node) from inputOutput SFNode field body1.
    RigidBody getBody2()
    Provide RigidBody instance (using a properly typed node) from inputOutput SFNode field body2.
    float getBounce()
    Provide float value within allowed range of [0,1] from inputOutput SFFloat field named bounce.
    float[] getContactNormal()
    Provide array of 3-tuple float results from inputOutput SFVec3f field named contactNormal.
    float getDepth()
    Provide float value from inputOutput SFFloat field named depth.
    float[] getFrictionCoefficients()
    Provide array of 2-tuple float results within allowed range of [0,infinity) from inputOutput SFVec2f field named frictionCoefficients.
    float[] getFrictionDirection()
    Provide array of 3-tuple float results from inputOutput SFVec3f field named frictionDirection.
    X3DNBodyCollidableNode getGeometry1()
    Provide X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry1.
    X3DNBodyCollidableNode getGeometry2()
    Provide X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry2.
    X3DMetadataObject getMetadata()
    Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
    float getMinBounceSpeed()
    Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named minBounceSpeed.
    float[] getPosition()
    Provide array of 3-tuple float results from inputOutput SFVec3f field named position.
    float[] getSlipCoefficients()
    Provide array of 2-tuple float results from inputOutput SFVec2f field named slipCoefficients.
    float getSoftnessConstantForceMix()
    Provide float value within allowed range of [0,1] from inputOutput SFFloat field named softnessConstantForceMix.
    float getSoftnessErrorCorrection()
    Provide float value within allowed range of [0,1] from inputOutput SFFloat field named softnessErrorCorrection.
    float[] getSurfaceSpeed()
    Provide array of 2-tuple float results from inputOutput SFVec2f field named surfaceSpeed.
    Contact setAppliedParameters​(java.lang.String[] newValue)
    Accessor method to assign String enumeration array (""BOUNCE"" | ""USER_FRICTION"" | ""FRICTION_COEFFICIENT-2"" | ""ERROR_REDUCTION"" | ""CONSTANT_FORCE"" | ""SPEED-1"" | ""SPEED-2"" | ""SLIP-1"" | ""SLIP-2"") to inputOutput MFString field named appliedParameters.
    Contact setBody1​(RigidBody newValue)
    Accessor method to assign RigidBody instance (using a properly typed node) to inputOutput SFNode field body1.
    Contact setBody2​(RigidBody newValue)
    Accessor method to assign RigidBody instance (using a properly typed node) to inputOutput SFNode field body2.
    Contact setBounce​(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named bounce.
    Contact setContactNormal​(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named contactNormal.
    Contact setDepth​(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named depth.
    Contact setFrictionCoefficients​(float[] newValue)
    Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named frictionCoefficients.
    Contact setFrictionDirection​(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named frictionDirection.
    Contact setGeometry1​(X3DNBodyCollidableNode newValue)
    Accessor method to assign X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry1.
    Contact setGeometry2​(X3DNBodyCollidableNode newValue)
    Accessor method to assign X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry2.
    Contact setMetadata​(X3DMetadataObject newValue)
    Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
    Contact setMinBounceSpeed​(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named minBounceSpeed.
    Contact setPosition​(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named position.
    Contact setSlipCoefficients​(float[] newValue)
    Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named slipCoefficients.
    Contact setSoftnessConstantForceMix​(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named softnessConstantForceMix.
    Contact setSoftnessErrorCorrection​(float newValue)
    Accessor method to assign float value to inputOutput SFFloat field named softnessErrorCorrection.
    Contact setSurfaceSpeed​(float[] newValue)
    Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named surfaceSpeed.
  • Method Details

    • getAppliedParameters

      java.lang.String[] getAppliedParameters()
      Provide array of String enumeration results ( baseType appliedParametersChoices) [""BOUNCE"" | ""USER_FRICTION"" | ""FRICTION_COEFFICIENT-2"" | ""ERROR_REDUCTION"" | ""CONSTANT_FORCE"" | ""SPEED-1"" | ""SPEED-2"" | ""SLIP-1"" | ""SLIP-2""] from inputOutput MFString field named appliedParameters.

      Tooltip: 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.
      Returns:
      value of appliedParameters field
    • setAppliedParameters

      Contact setAppliedParameters​(java.lang.String[] newValue)
      Accessor method to assign String enumeration array (""BOUNCE"" | ""USER_FRICTION"" | ""FRICTION_COEFFICIENT-2"" | ""ERROR_REDUCTION"" | ""CONSTANT_FORCE"" | ""SPEED-1"" | ""SPEED-2"" | ""SLIP-1"" | ""SLIP-2"") to inputOutput MFString field named appliedParameters.

      Tooltip: 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.
      Parameters:
      newValue - is new value for the appliedParameters field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getBody1

      RigidBody getBody1()
      Provide RigidBody instance (using a properly typed node) from inputOutput SFNode field body1.
      Returns:
      value of body1 field
    • setBody1

      Contact setBody1​(RigidBody newValue)
      Accessor method to assign RigidBody instance (using a properly typed node) to inputOutput SFNode field body1.
      Parameters:
      newValue - is new value for the body1 field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getBody2

      RigidBody getBody2()
      Provide RigidBody instance (using a properly typed node) from inputOutput SFNode field body2.
      Returns:
      value of body2 field
    • setBody2

      Contact setBody2​(RigidBody newValue)
      Accessor method to assign RigidBody instance (using a properly typed node) to inputOutput SFNode field body2.
      Parameters:
      newValue - is new value for the body2 field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getBounce

      float getBounce()
      Provide float value within allowed range of [0,1] from inputOutput SFFloat field named bounce.

      Tooltip: [0,1] bounce indicates bounciness (0 = no bounce at all, 1 = maximum bounce). *
      Returns:
      value of bounce field
    • setBounce

      Contact setBounce​(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named bounce.

      Tooltip: [0,1] bounce indicates bounciness (0 = no bounce at all, 1 = maximum bounce). *
      Parameters:
      newValue - is new value for the bounce field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getContactNormal

      float[] getContactNormal()
      Provide array of 3-tuple float results from inputOutput SFVec3f field named contactNormal.

      Tooltip: contactNormal is unit vector describing normal between two colliding bodies. *
      Returns:
      value of contactNormal field
    • setContactNormal

      Contact setContactNormal​(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named contactNormal.

      Tooltip: contactNormal is unit vector describing normal between two colliding bodies. *
      Parameters:
      newValue - is new value for the contactNormal field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getDepth

      float getDepth()
      Provide float value from inputOutput SFFloat field named depth.

      Tooltip: [0,1] depth indicates how deep the current intersection is along normal vector. *
      Returns:
      value of depth field
    • setDepth

      Contact setDepth​(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named depth.

      Tooltip: [0,1] depth indicates how deep the current intersection is along normal vector. *
      Parameters:
      newValue - is new value for the depth field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getFrictionCoefficients

      float[] getFrictionCoefficients()
      Provide array of 2-tuple float results within allowed range of [0,infinity) from inputOutput SFVec2f field named frictionCoefficients.

      Tooltip: frictionCoefficients used for computing surface drag. *
      Returns:
      value of frictionCoefficients field
    • setFrictionCoefficients

      Contact setFrictionCoefficients​(float[] newValue)
      Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named frictionCoefficients.

      Tooltip: frictionCoefficients used for computing surface drag. *
      Parameters:
      newValue - is new value for the frictionCoefficients field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getFrictionDirection

      float[] getFrictionDirection()
      Provide array of 3-tuple float results from inputOutput SFVec3f field named frictionDirection.

      Tooltip: frictionDirection controls friction vector.
      • Hint: value of (0 0 0) indicates no friction.
      Returns:
      value of frictionDirection field
    • setFrictionDirection

      Contact setFrictionDirection​(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named frictionDirection.

      Tooltip: frictionDirection controls friction vector.
      • Hint: value of (0 0 0) indicates no friction.
      Parameters:
      newValue - is new value for the frictionDirection field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getGeometry1

      X3DNBodyCollidableNode getGeometry1()
      Provide X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry1.
      Returns:
      value of geometry1 field
    • setGeometry1

      Contact setGeometry1​(X3DNBodyCollidableNode newValue)
      Accessor method to assign X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry1.
      Parameters:
      newValue - is new value for the geometry1 field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getGeometry2

      X3DNBodyCollidableNode getGeometry2()
      Provide X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry2.
      Returns:
      value of geometry2 field
    • setGeometry2

      Contact setGeometry2​(X3DNBodyCollidableNode newValue)
      Accessor method to assign X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry2.
      Parameters:
      newValue - is new value for the geometry2 field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getMetadata

      X3DMetadataObject getMetadata()
      Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
      Specified by:
      getMetadata in interface X3DNode
      Returns:
      value of metadata field
      See Also:
      X3D Scene Authoring Hints: Metadata Nodes
    • setMetadata

      Contact setMetadata​(X3DMetadataObject newValue)
      Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
      Specified by:
      setMetadata in interface X3DNode
      Parameters:
      newValue - is new value for the metadata field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      See Also:
      X3D Scene Authoring Hints: Metadata Nodes
    • getMinBounceSpeed

      float getMinBounceSpeed()
      Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named minBounceSpeed.

      Tooltip: [0,+infinity) minBounceSpeed m/s needed to bounce. *
      Returns:
      value of minBounceSpeed field
    • setMinBounceSpeed

      Contact setMinBounceSpeed​(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named minBounceSpeed.

      Tooltip: [0,+infinity) minBounceSpeed m/s needed to bounce. *
      Parameters:
      newValue - is new value for the minBounceSpeed field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getPosition

      float[] getPosition()
      Provide array of 3-tuple float results from inputOutput SFVec3f field named position.

      Tooltip: position (x, y, z in meters) of exact location of collision. *
      Returns:
      value of position field
    • setPosition

      Contact setPosition​(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named position.

      Tooltip: position (x, y, z in meters) of exact location of collision. *
      Parameters:
      newValue - is new value for the position field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getSlipCoefficients

      float[] getSlipCoefficients()
      Provide array of 2-tuple float results from inputOutput SFVec2f field named slipCoefficients.

      Tooltip: slipCoefficients used for computing surface drag. *
      Returns:
      value of slipCoefficients field
    • setSlipCoefficients

      Contact setSlipCoefficients​(float[] newValue)
      Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named slipCoefficients.

      Tooltip: slipCoefficients used for computing surface drag. *
      Parameters:
      newValue - is new value for the slipCoefficients field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getSoftnessConstantForceMix

      float getSoftnessConstantForceMix()
      Provide float value within allowed range of [0,1] from inputOutput SFFloat field named softnessConstantForceMix.

      Tooltip: [0,1] softnessConstantForceMix value applies a constant force value to make colliding surfaces appear to be somewhat soft. *
      Returns:
      value of softnessConstantForceMix field
    • setSoftnessConstantForceMix

      Contact setSoftnessConstantForceMix​(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named softnessConstantForceMix.

      Tooltip: [0,1] softnessConstantForceMix value applies a constant force value to make colliding surfaces appear to be somewhat soft. *
      Parameters:
      newValue - is new value for the softnessConstantForceMix field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getSoftnessErrorCorrection

      float getSoftnessErrorCorrection()
      Provide float value within allowed range of [0,1] from inputOutput SFFloat field named softnessErrorCorrection.

      Tooltip: [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). *
      Returns:
      value of softnessErrorCorrection field
    • setSoftnessErrorCorrection

      Contact setSoftnessErrorCorrection​(float newValue)
      Accessor method to assign float value to inputOutput SFFloat field named softnessErrorCorrection.

      Tooltip: [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). *
      Parameters:
      newValue - is new value for the softnessErrorCorrection field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getSurfaceSpeed

      float[] getSurfaceSpeed()
      Provide array of 2-tuple float results from inputOutput SFVec2f field named surfaceSpeed.

      Tooltip: surfaceSpeed defines speed vectors for computing surface drag, if contact surfaces move independently of bodies. *
      Returns:
      value of surfaceSpeed field
    • setSurfaceSpeed

      Contact setSurfaceSpeed​(float[] newValue)
      Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named surfaceSpeed.

      Tooltip: surfaceSpeed defines speed vectors for computing surface drag, if contact surfaces move independently of bodies. *
      Parameters:
      newValue - is new value for the surfaceSpeed field.
      Returns:
      Contact - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).