TransformSensor generates output events when its targetObject enters, exits, and moves within a region in space (defined by a box).
The TransformSensor node belongs to the EnvironmentalSensor component and its container field is children. It is available since X3D version 3.2 or later.
SFNode [in, out] metadata NULL [X3DMetadataObject]
Metadata are not part of the X3D world and not interpreted by the X3D browser, but they can be accessed via the ECMAScript interface.
SFBool [in, out] enabled TRUE
Enables/disables node operation.
SFVec3f [in, out] size 0 0 0 [0,∞)
Size of intersection box, measured from center in meters.
SFVec3f [in, out] center 0 0 0 (-∞,∞)
Translation offset from origin of local coordinate system.
SFTime [out] enterTime
Time event generated when targetObject enters the box region for sensor.
SFTime [out] exitTime
Time event generated when targetObject exits the box region for sensor.
SFBool [out] isActive
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.
SFVec3f [out] position_changed
Sends translation event relative to center whenever the target object is contained within the box region and results change.
SFRotation [out] orientation_changed
Sends rotation event relative to center whenever the target object is contained within the box region and results change.
SFNode [in, out] targetObject NULL [X3DGroupingNode|X3DShapeNode]
TargetObject is the movable geometry represented by any valid X3DGroupingNode or X3DShapeNode which may enter or exit the box.
- Each TransformSensor node behaves independently of all other TransformSensor nodes, so that every enabled TransformSensor node affected by targetObject motion sends output events.
- 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.
- Results are undefined if boxes overlap for multiply instanced TransformSensor nodes.
- A TransformSensor node with a zero-volume box (i.e. any size dimension equal to 0.0) cannot generate events, equivalent to enabled=false.
- Unlike TouchSensor nodes, there is no notion of a TransformSensor node lower in the scene graph grabbing events.