Interface Contact
- All Superinterfaces:
X3DNode
- All Known Implementing Classes:
Contact
Contact nodes are produced as output events when two collidable objects or spaces make contact.
Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the
Package hint: This interface is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI).
Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the
org.web3d.x3d.jsail
classes.
Contact 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:
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Provide array of String enumeration results (baseType MFString) ['"BOUNCE"' | '"USER_FRICTION"' | '"FRICTION_COEFFICIENT-2"' | '"ERROR_REDUCTION"' | '"CONSTANT_FORCE"' | '"SPEED-1"' | '"SPEED-2"' | '"SLIP-1"' | '"SLIP-2"'] from inputOutput MFString field named appliedParameters.getBody1()
Provide org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) from inputOutput SFNode field body1.getBody2()
Provide org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) from inputOutput SFNode field body2.float
Provide float value within allowed range of [0,1] from inputOutput SFFloat field named bounce.float[]
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[]
Provide array of 2-tuple float results within allowed range of [0,infinity) from inputOutput SFVec2f field named frictionCoefficients.float[]
Provide array of 3-tuple float results from inputOutput SFVec3f field named frictionDirection.Provide org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry1.Provide org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry2.Provide org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.float
Provide float value within allowed range of [0,infinity) from inputOutput SFFloat field named minBounceSpeed.float[]
Provide array of 3-tuple float results from inputOutput SFVec3f field named position.float[]
Provide array of 2-tuple float results from inputOutput SFVec2f field named slipCoefficients.float
Provide float value within allowed range of [0,1] from inputOutput SFFloat field named softnessConstantForceMix.float
Provide float value within allowed range of [0,1] from inputOutput SFFloat field named softnessErrorCorrection.float[]
Provide array of 2-tuple float results from inputOutput SFVec2f field named surfaceSpeed.setAppliedParameters
(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.Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) to inputOutput SFNode field body1.Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) to inputOutput SFNode field body2.setBounce
(float newValue) Accessor method to assign float value to inputOutput SFFloat field named bounce.setContactNormal
(float[] newValue) Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named contactNormal.setDepth
(float newValue) Accessor method to assign float value to inputOutput SFFloat field named depth.setFrictionCoefficients
(float[] newValue) Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named frictionCoefficients.setFrictionDirection
(float[] newValue) Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named frictionDirection.setGeometry1
(X3DNBodyCollidableNode newValue) Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry1.setGeometry2
(X3DNBodyCollidableNode newValue) Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry2.setMetadata
(X3DMetadataObject newValue) Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.setMinBounceSpeed
(float newValue) Accessor method to assign float value to inputOutput SFFloat field named minBounceSpeed.setPosition
(float[] newValue) Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named position.setSlipCoefficients
(float[] newValue) Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named slipCoefficients.setSoftnessConstantForceMix
(float newValue) Accessor method to assign float value to inputOutput SFFloat field named softnessConstantForceMix.setSoftnessErrorCorrection
(float newValue) Accessor method to assign float value to inputOutput SFFloat field named softnessErrorCorrection.setSurfaceSpeed
(float[] newValue) Accessor method to assign 2-tuple float array to inputOutput SFVec2f field named surfaceSpeed.
-
Method Details
-
getAppliedParameters
String[] getAppliedParameters()Provide array of String enumeration results (baseType MFString) ['"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
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 org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) from inputOutput SFNode field body1.
Tooltip: [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. *- Returns:
- value of body1 field
-
setBody1
Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) to inputOutput SFNode field body1.
Tooltip: [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. *- 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 org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) from inputOutput SFNode field body2.
Tooltip: [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. *- Returns:
- value of body2 field
-
setBody2
Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.RigidBody instance (using a properly typed node) to inputOutput SFNode field body2.
Tooltip: [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. *- 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
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
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
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
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
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 org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry1.
Tooltip: [X3DNBodyCollidableNode] The geometry1 and geometry2 fields specify collision-related information about body1 and body2. *- Returns:
- value of geometry1 field
-
setGeometry1
Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry1.
Tooltip: [X3DNBodyCollidableNode] The geometry1 and geometry2 fields specify collision-related information about body1 and body2. *- 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 org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) from inputOutput SFNode field geometry2.
Tooltip: [X3DNBodyCollidableNode] The geometry1 and geometry2 fields specify collision-related information about body1 and body2. *- Returns:
- value of geometry2 field
-
setGeometry2
Accessor method to assign org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollidableNode instance (using a properly typed node) to inputOutput SFNode field geometry2.
Tooltip: [X3DNBodyCollidableNode] The geometry1 and geometry2 fields specify collision-related information about body1 and body2. *- 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 org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS /Part01/components/core.html#Metadata
- Specified by:
getMetadata
in interfaceX3DNode
- Returns:
- value of metadata field
- See Also:
-
setMetadata
Accessor method to assign org.web3d.x3d.sai.Core.X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
Tooltip: [X3DMetadataObject] Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.- Hint: X3D Architecture 7.2.4 Metadata https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS /Part01/components/core.html#Metadata
- Specified by:
setMetadata
in interfaceX3DNode
- 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:
-
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
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
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
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
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
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
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).
-