Interface TransformSensor

All Superinterfaces:
X3DChildNode, X3DEnvironmentalSensorNode, X3DNode, X3DSensorNode
All Known Implementing Classes:
TransformSensorObject

public interface TransformSensor
extends X3DEnvironmentalSensorNode
TransformSensor generates output events when its targetObject enters, exits, and moves within a region in space (defined by a box).

X3D node tooltip: (X3D version 3.2 or later) [X3DEnvironmentalSensorNode] TransformSensor generates output events when its targetObject enters, exits, and moves within a region in space (defined by a box).
  • Hint: Each TransformSensor node behaves independently of all other TransformSensor nodes, so that every enabled TransformSensor node affected by targetObject motion sends output events.
  • Hint: multiply instanced (DEF/USE) TransformSensor nodes in different locations use the union of all boxes to check for enter and exit, detecting enter and exit for all instances of the box, and sending enter/exit events appropriately. For non-overlapping bounding boxes, position_changed and orientation_changed events are calculated relative to the coordinate system associated with the bounding box in which the proximity was detected.
  • Warning: results are undefined if boxes overlap for multiply instanced TransformSensor nodes.
  • Warning: a TransformSensor node with a zero-volume box (i.e. any size dimension equal to 0.0) cannot generate events, equivalent to enabled=false.
  • Warning: unlike TouchSensor nodes, there is no notion of a TransformSensor node lower in the scene graph grabbing events.

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: TransformSensor, X3D Tooltips: TransformSensor, X3D Scene Authoring Hints
  • Method Summary

    Modifier and Type Method Description
    float[] getCenter()
    Provide array of 3-tuple float results from inputOutput SFVec3f field named center.
    boolean getEnabled()
    Provide boolean value from inputOutput SFBool field named enabled.
    double getEnterTime()
    Provide double value in seconds from outputOnly SFTime field named enterTime.
    double getExitTime()
    Provide double value in seconds from outputOnly SFTime field named exitTime.
    boolean getIsActive()
    Provide boolean value from outputOnly SFBool field named isActive.
    X3DMetadataObject getMetadata()
    Provide X3DMetadataObject instance (using a properly typed node) from inputOutput SFNode field metadata.
    float[] getOrientation()
    Provide array of 4-tuple float results unit axis, angle (in radians) from outputOnly SFRotation field named orientation_changed.
    float[] getPosition()
    Provide array of 3-tuple float results from outputOnly SFVec3f field named position_changed.
    float[] getSize()
    Provide array of 3-tuple float results within allowed range of [0,infinity) from initializeOnly SFVec3f field named size.
    X3DNode getTargetObject()
    Provide X3DNode instance (using a properly typed node) with acceptable node types limited to X3DGroupingNode|X3DShapeNode, from inputOutput SFNode field targetObject.
    TransformSensor setCenter​(float[] newValue)
    Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named center.
    TransformSensor setEnabled​(boolean newValue)
    Accessor method to assign boolean value to inputOutput SFBool field named enabled.
    TransformSensor setMetadata​(X3DMetadataObject newValue)
    Accessor method to assign X3DMetadataObject instance (using a properly typed node) to inputOutput SFNode field metadata.
    TransformSensor setSize​(float[] newValue)
    Accessor method to assign 3-tuple float array to initializeOnly SFVec3f field named size.
    TransformSensor setTargetObject​(X3DNode newValue)
    Accessor method to assign X3DNode instance (using a properly typed node) to inputOutput SFNode field targetObject. // newValueInstanceAcceptableNodeTypesTest checks are needed for methods that override/subset X3DNode interfaces #1 boolean isNodeTypeAllowed = (((X3DConcreteNode)newValue) instanceof org.web3d.x3d.sai.Grouping.X3DGroupingNode) || (((X3DConcreteNode)newValue) instanceof org.web3d.x3d.sai.Shape.X3DShapeNode); if (!
  • Method Details

    • getCenter

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

      Tooltip: Translation offset from origin of local coordinate system. *
      Returns:
      value of center field
    • setCenter

      TransformSensor setCenter​(float[] newValue)
      Accessor method to assign 3-tuple float array to inputOutput SFVec3f field named center.

      Tooltip: Translation offset from origin of local coordinate system. *
      Parameters:
      newValue - is new value for the center field.
      Returns:
      TransformSensor - 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 X3DEnvironmentalSensorNode
      Specified by:
      getEnabled in interface X3DSensorNode
      Returns:
      value of enabled field
    • setEnabled

      TransformSensor 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 X3DEnvironmentalSensorNode
      Specified by:
      setEnabled in interface X3DSensorNode
      Parameters:
      newValue - is new value for the enabled field.
      Returns:
      TransformSensor - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getEnterTime

      double getEnterTime()
      Provide double value in seconds from outputOnly SFTime field named enterTime.

      Tooltip: Time event generated when targetObject enters the box region for sensor.
      • 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 enterTime field
    • getExitTime

      double getExitTime()
      Provide double value in seconds from outputOnly SFTime field named exitTime.

      Tooltip: Time event generated when targetObject exits the box region for sensor.
      • 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 exitTime field
    • getIsActive

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

      Tooltip: isActive true/false events are sent when triggering the sensor. isActive=true when targetObject enters the box region, isActive=false when targetObject exits the box region.
      • 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 X3DEnvironmentalSensorNode
      Specified by:
      getIsActive in interface X3DSensorNode
      Returns:
      value of isActive 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 X3DEnvironmentalSensorNode
      Specified by:
      getMetadata in interface X3DNode
      Specified by:
      getMetadata in interface X3DSensorNode
      Returns:
      value of metadata field
      See Also:
      X3D Scene Authoring Hints: Metadata Nodes
    • setMetadata

      TransformSensor 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 X3DEnvironmentalSensorNode
      Specified by:
      setMetadata in interface X3DNode
      Specified by:
      setMetadata in interface X3DSensorNode
      Parameters:
      newValue - is new value for the metadata field.
      Returns:
      TransformSensor - 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
    • getOrientation

      float[] getOrientation()
      Provide array of 4-tuple float results unit axis, angle (in radians) from outputOnly SFRotation field named orientation_changed.

      Tooltip: Sends rotation event relative to center whenever the target object is contained within the box region and results change.
      • 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 orientation_changed field
    • getPosition

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

      Tooltip: Sends translation event relative to center whenever the target object is contained within the box region and results change.
      • 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 position_changed field
    • getSize

      float[] getSize()
      Provide array of 3-tuple float results within allowed range of [0,infinity) from initializeOnly SFVec3f field named size.

      Tooltip: [0,+infinity) size of intersection box, measured from center in meters. *
      Specified by:
      getSize in interface X3DEnvironmentalSensorNode
      Returns:
      value of size field
    • setSize

      TransformSensor setSize​(float[] newValue)
      Accessor method to assign 3-tuple float array to initializeOnly SFVec3f field named size.

      Tooltip: [0,+infinity) size of intersection box, measured from center in meters. *
      Specified by:
      setSize in interface X3DEnvironmentalSensorNode
      Parameters:
      newValue - is new value for the size field.
      Returns:
      TransformSensor - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • getTargetObject

      X3DNode getTargetObject()
      Provide X3DNode instance (using a properly typed node) with acceptable node types limited to X3DGroupingNode|X3DShapeNode, from inputOutput SFNode field targetObject.

      Tooltip: [X3DGroupingNode|X3DShapeNode] targetObject is the movable geometry represented by any valid X3DGroupingNode or X3DShapeNode which may enter or exit the box. *
      Returns:
      value of targetObject field
    • setTargetObject

      TransformSensor setTargetObject​(X3DNode newValue)
      Accessor method to assign X3DNode instance (using a properly typed node) to inputOutput SFNode field targetObject. // newValueInstanceAcceptableNodeTypesTest checks are needed for methods that override/subset X3DNode interfaces #1 boolean isNodeTypeAllowed = (((X3DConcreteNode)newValue) instanceof org.web3d.x3d.sai.Grouping.X3DGroupingNode) || (((X3DConcreteNode)newValue) instanceof org.web3d.x3d.sai.Shape.X3DShapeNode); if (!isNodeTypeAllowed) { throw new org.web3d.x3d.sai.InvalidFieldValueException("X3DNode newValue is not instanceof " + "acceptableNodeTypes X3DGroupingNode|X3DShapeNode; newValue=" + newValue); }

      Tooltip: [X3DGroupingNode|X3DShapeNode] targetObject is the movable geometry represented by any valid X3DGroupingNode or X3DShapeNode which may enter or exit the box. *
      Parameters:
      newValue - is new value for the targetObject field.
      Returns:
      TransformSensor - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).