Post

LinePickSensor

LinePickSensor

Overview

LinePickSensor uses one or more pickingGeometry line segments to compute intersections with pickTarget shapes. As each line intersection generates a known point in space, useful event information is returned including normal, geometry and texCoord values.

The LinePickSensor node belongs to the Picking component and requires at least level 1, its default container field is children. It is available from X3D version 3.2 or higher.

Hierarchy

1
2
3
4
5
+ X3DNode
  + X3DChildNode
    + X3DSensorNode
      + X3DPickSensorNode
        + LinePickSensor

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 the node.

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).

SFBool [in, out] enabled TRUE

Enables/disables node operation.

MFString [in, out] objectType “ALL” [“ALL”, “NONE”, “TERRAIN”, …]

The objectType field specifies a set of labels used in the picking process. Each string specified is treated as an independent label that needs to be matched against the same type in one of the pick sensor instances. Example: labeling a PickableGroup with the objectType value “WATER” and then attempting to intersect a pick sensor with objectType value “GROUND” fails since the objectType values do not match. Example: the special value “ALL” means that each node is available for picking regardless of the type specified by the pick sensor. Example: the special value “NONE” effectively disables all picking for this node and is the equivalent of setting the pickable field of the corresponding PickableGroup to false.

Hints

  • Authors may define any value for objectType.
  • MFString arrays can have multiple values, so “separate each individual string” “by using quote marks”.

SFString [in, out] matchCriterion “MATCH_ANY” [“MATCH_ANY”|”MATCH_EVERY”|”MATCH_ONLY_ONE”]

Defines whether the intersection test (i.e. pick) by this X3DPickSensorNode must match one or more objectType. Specifically MATCH_ANY means any match of objectType values is acceptable, MATCH_EVERY means that every objectType value in this node shall match an objectType value in the X3DPickableObject, and MATCH_ONLY_ONE means that one and only one objectType value can match.

SFString [ ] intersectionType “BOUNDS” [“GEOMETRY”|”BOUNDS”|…]

intersectionType specifies precision of the collision computation.

Hint

  • intersectionType constants may be extended by the browser to provide additional options.

Warning

  • Do not wrap extra quotation marks around these SFString enumeration values, since “quotation” “marks” are only used for MFString values.

SFString [ ] sortOrder “CLOSEST” [“ANY”|”CLOSEST”|”ALL”|”ALL_SORTED”]

The sortOrder field determines the order provided for picked output events. Example: ANY means any single object that can satisfy picking conditions for this pick sensor. Consistency of results is not guaranteed. Example: ALL means that every object that satisfies the picking conditions for this pick sensor shall be returned. Example: ALL_SORTED means that every object that satisfies the picking conditions for this pick sensor shall be returned with the order of the output fields provided in a distance-sorted order from closest to farthest away. The exact algorithm for sorting is defined by the individual node definitions. Example: CLOSEST means that the closest object by distance that satisfies the conditions of this pick sensor. The exact algorithm for distance determination shall be defined by individual node definitions.

Hint

  • Browser implementations may define additional values and algorithms beyond these four required values.

Warning

  • Do not wrap extra quotation marks around these SFString enumeration values, since “quotation” “marks” are only used for MFString values.

SFBool [out] isActive

isActive indicates when the intersecting object is picked by the picking geometry. Output event isActive=true gets sent once a picked item is found. Output event isActive=false gets sent once no picked item is found.

Warning

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

MFVec3f [out] pickedTextureCoordinate

Output event containing 3D texture coordinates of surfaces computed by the picking intersection computations. Picked texture coordinates are in three dimensions. If the target texture coordinate has two dimensions, the third coordinate (z component of an SFVec3f) shall be zero.

Warnings

  • If the target object has multiple textures defined, only texture coordinates for the first texture are returned and all other textures are ignored.
  • It is an error to define this transient outputOnly field in an X3D file, instead only use it a source for ROUTE events.

MFVec3f [out] pickedNormal

Output event containing surface normal vectors computed by the picking intersection computations.

Warning

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

MFVec3f [out] pickedPoint

Output event containing 3D points on surface of underlying pickingGeometry computed by the picking intersection computations, given in the 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.

SFNode [in, out] pickingGeometry NULL [IndexedLineSet|LineSet]

pickingGeometry specifies the exact geometry coordinates that are used to perform the intersection testing of the picking operation.

MFNode [in, out] pickTarget [ ] [X3DGroupingNode|X3DShapeNode|Inline]

pickTarget specifies the list of nodes against which picking operations are performed. All nodes declared in this field and their descendents are evaluated for intersections.

MFNode [out] pickedGeometry

Output event containing the node or nodes that have been found to intersect with the picking geometry from the last time this node performed a picking operation, given in the 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.

Advice

Hints

Warning

  • Order of contained nodes is significant, single pickingGeometry node must precede pickTarget node array.

Example

See Also

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