Post

CylinderSensor

Overview

CylinderSensor converts pointer motion (for example, a mouse or wand) into rotation values using an invisible cylinder aligned with local Y-axis.

The CylinderSensor node belongs to the PointingDeviceSensor component and requires at least level 1, its default container field is children. It is available since VRML 2.0 and from X3D version 3.0 or higher.

Hierarchy

1
2
3
4
5
6
+ X3DNode
  + X3DChildNode
    + X3DSensorNode
      + X3DPointingDeviceSensorNode
        + X3DDragSensorNode
          + CylinderSensor

Fields

SFNode [in, out] metadata NULL [X3DMetadataObject]

Information about this node can be contained in a MetadataBoolean, MetadataDouble, MetadataFloat, MetadataInteger, MetadataString or MetadataSet node.

Hint

SFString [in, out] description “”

Author-provided prose that describes intended purpose of this node.

Hints

  • Include space characters since a description is not a DEF identifier. Write short phrases that make descriptions clear and readable.
  • 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).

SFBool [in, out] enabled TRUE

Enables/disables node operation.

SFRotation [in, out] axisRotation 0 0 1 0 [-1,1] or (-∞,∞)

axisRotation determines local sensor coordinate system by rotating the local coordinate system.

SFFloat [in, out] diskAngle 0.26179167 [0,π/2]

Help decide rotation behavior from initial relative bearing of pointer drag: acute angle whether cylinder sides or end-cap disks of virtual-geometry sensor are used for manipulation.

Hint

  • diskAngle 0 forces disk-like behavior, diskAngle 1.570796 (90 degrees) forces cylinder-like behavior.

SFFloat [in, out] minAngle 0 [-2π,2π]

Clamps rotation_changed events within range of min/max values

Hints

SFFloat [in, out] maxAngle -1 [-2π,2π]

Clamps rotation_changed events within range of min/max values

Hints

SFFloat [in, out] offset 0 (-∞,∞)

Sends event and remembers last value sensed.

Warning

  • ROUTE connecting rotation_changed to set_offset creates a self-reinforcing positive feedback loop and results in unmanageable response.

SFBool [in, out] autoOffset TRUE

Determines whether previous offset values are remembered/accumulated.

SFVec3f [out] trackPoint_changed

trackPoint_changed events give intersection point of bearing with sensor’s virtual geometry.

Warnings

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.
  • trackPoint_changed events represent unclamped intersection points on plane surface. Browsers can interpret drags off of the surface in various ways. Note that translation_changed events are clamped by minPosition/maxPosition and thus may be preferable.

SFRotation [out] rotation_changed

rotation_changed events equal sum of relative bearing changes plus offset value about Y-axis in 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.

SFBool [out] isOver

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.

SFBool [out] isActive

Select geometry by activating the pointing device (for example, clicking the mouse) to generate isActive events. Output event isActive=true is sent when geometry is selected (for example, when primary mouse button is pressed), output event isActive=false is sent when geometry is deselected (for example, when primary mouse button is released).

Warning

  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

Advice

Hints

Example

View Source in Playground

See Also

This post is licensed under CC BY 4.0 by the author.