Interface TouchSensor

All Superinterfaces:
X3DChildNode, X3DNode, X3DPointingDeviceSensorNode, X3DSensorNode, X3DTouchSensorNode
All Known Implementing Classes:
TouchSensorObject

public interface TouchSensor
extends X3DTouchSensorNode
TouchSensor tracks location and state of the pointing device, detecting when a user points at or selects (activates) geometry.

X3D node tooltip: [X3DTouchSensorNode] TouchSensor tracks location and state of the pointing device, detecting when a user points at or selects (activates) geometry.
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: TouchSensor, X3D Tooltips: TouchSensor, X3D Scene Authoring Hints
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getDescription()
    Provide String value from inputOutput SFString field named description.
    boolean getEnabled()
    Provide boolean value from inputOutput SFBool field named enabled.
    float[] getHitNormal()
    Provide array of 3-tuple float results from outputOnly SFVec3f field named hitNormal_changed.
    float[] getHitPoint()
    Provide array of 3-tuple float results from outputOnly SFVec3f field named hitPoint_changed.
    float[] getHitTexCoord()
    Provide array of 2-tuple float results from outputOnly SFVec2f field named hitTexCoord_changed.
    boolean getIsActive()
    Provide boolean value from outputOnly SFBool field named isActive.
    boolean getIsOver()
    Provide boolean value from outputOnly SFBool field named isOver.
    X3DMetadataObject getMetadata()
    Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
    double getTouchTime()
    Provide double value in seconds from outputOnly SFTime field named touchTime.
    TouchSensor setDescription​(java.lang.String newValue)
    Accessor method to assign String value to inputOutput SFString field named description.
    TouchSensor setEnabled​(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named enabled.
    TouchSensor setMetadata​(X3DMetadataObject newValue)
    Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
  • Method Details

    • getDescription

      java.lang.String getDescription()
      Provide String value from inputOutput SFString field named description.

      Tooltip: Author-provided text tooltip that tells users the expected action of this node.
      • Hint: include space characters since a description is not a DEF identifier. Write short phrases that make descriptions clear and readable.
      • Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
      Specified by:
      getDescription in interface X3DPointingDeviceSensorNode
      Specified by:
      getDescription in interface X3DTouchSensorNode
      Returns:
      value of description field
    • setDescription

      TouchSensor setDescription​(java.lang.String newValue)
      Accessor method to assign String value to inputOutput SFString field named description.

      Tooltip: Author-provided text tooltip that tells users the expected action of this node.
      • Hint: include space characters since a description is not a DEF identifier. Write short phrases that make descriptions clear and readable.
      • Hint: many XML tools substitute XML character references for special characters automatically if needed within an attribute value (such as & for & ampersand character, or " for " quotation-mark character).
      Specified by:
      setDescription in interface X3DPointingDeviceSensorNode
      Specified by:
      setDescription in interface X3DTouchSensorNode
      Parameters:
      newValue - is new value for the description field.
      Returns:
      TouchSensor - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getEnabled

      boolean getEnabled()
      Provide boolean value from inputOutput SFBool field named enabled.

      Tooltip: Enables/disables node operation. *
      Specified by:
      getEnabled in interface X3DPointingDeviceSensorNode
      Specified by:
      getEnabled in interface X3DSensorNode
      Specified by:
      getEnabled in interface X3DTouchSensorNode
      Returns:
      value of enabled field
    • setEnabled

      TouchSensor setEnabled​(boolean newValue)
      Accessor method to assign boolean value to inputOutput SFBool field named enabled.

      Tooltip: Enables/disables node operation. *
      Specified by:
      setEnabled in interface X3DPointingDeviceSensorNode
      Specified by:
      setEnabled in interface X3DSensorNode
      Specified by:
      setEnabled in interface X3DTouchSensorNode
      Parameters:
      newValue - is new value for the enabled field.
      Returns:
      TouchSensor - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getHitNormal

      float[] getHitNormal()
      Provide array of 3-tuple float results from outputOnly SFVec3f field named hitNormal_changed.

      Tooltip: When pointing device selects geometry, send event containing surface normal vector at the hitPoint.
      • Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
      Returns:
      value of hitNormal_changed field
    • getHitPoint

      float[] getHitPoint()
      Provide array of 3-tuple float results from outputOnly SFVec3f field named hitPoint_changed.

      Tooltip: When pointing device selects geometry, send event containing 3D point on surface of underlying geometry, as measured in reference frame for TouchSensor's local coordinate system.
      • Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
      Returns:
      value of hitPoint_changed field
    • getHitTexCoord

      float[] getHitTexCoord()
      Provide array of 2-tuple float results from outputOnly SFVec2f field named hitTexCoord_changed.

      Tooltip: When pointing device selects geometry, send event containing texture coordinates of surface at the hitPoint.
      • Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
      Returns:
      value of hitTexCoord_changed field
    • getIsActive

      boolean getIsActive()
      Provide boolean value from outputOnly SFBool field named isActive.

      Tooltip: Select geometry by activating the pointing device (e.g. clicking the mouse) to generate isActive events. Output event isActive=true is sent when pointing device selection is activated, output event isActive=false is sent when pointing device is deselected.
      • Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
      Specified by:
      getIsActive in interface X3DPointingDeviceSensorNode
      Specified by:
      getIsActive in interface X3DSensorNode
      Specified by:
      getIsActive in interface X3DTouchSensorNode
      Returns:
      value of isActive field
    • getIsOver

      boolean getIsOver()
      Provide boolean value from outputOnly SFBool field named isOver.

      Tooltip: Hover over geometry by aiming the mouse (or pointing device) to generate isOver events. Sensor sends output event isOver=true event when pointing device moves over sensor's geometry, and later sends output event isOver=false event when pointing device moves off.
      • Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
      Specified by:
      getIsOver in interface X3DPointingDeviceSensorNode
      Specified by:
      getIsOver in interface X3DTouchSensorNode
      Returns:
      value of isOver field
    • getMetadata

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

      TouchSensor setMetadata​(X3DMetadataObject newValue)
      Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
      Specified by:
      setMetadata in interface X3DChildNode
      Specified by:
      setMetadata in interface X3DNode
      Specified by:
      setMetadata in interface X3DPointingDeviceSensorNode
      Specified by:
      setMetadata in interface X3DSensorNode
      Specified by:
      setMetadata in interface X3DTouchSensorNode
      Parameters:
      newValue - is new value for the metadata field.
      Returns:
      TouchSensor - 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
    • getTouchTime

      double getTouchTime()
      Provide double value in seconds from outputOnly SFTime field named touchTime.

      Tooltip: Time event generated when sensor is touched by pointing device, and then deselected by the user.
      • Hint: touchTime event is generated when following three conditions are all met: (a) pointing device was pointing towards geometry when initially activated (isActive=true), (b) pointing device is currently pointing towards the geometry (isOver=true), and (c) pointing device selection is deactivated/deselected by user (isActive=false event is also generated).
      • Warning: it is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
      Specified by:
      getTouchTime in interface X3DTouchSensorNode
      Returns:
      value of touchTime field