Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

PickManager module

  • Last UpdatedOct 02, 2025
  • 4 minute read

The PickManager module serves as the central logic unit for identifying interactable objects at a specific mouse position or along a raycast. Its primary function is to provide precise picking information, enabling intuitive user interaction with 3D scenes. A key feature of the Pickmanager is its ability to automatically generate invisible Cmeshes (representations of loaded models) to facilitate accurate picking.

The module also supports picking for complex operations, as the calculation of the thickness or diameter of elements in the scene.

Fields

Picking for thickness and diameter calculation

calculateThickness

When the calculateThickness input value is set to true, the module waits for a picking to be performed. Upon selection, it automatically constructs a ray based on the pick location, surface normal, and the configured maxThickness value. This ray is then utilized to find a second collision point on the element surface and compute the thickness. When an appropriate pick is performed, the thicknessIsValid, thicknessNormal, and thicknessPoints output values are populated.

calculateDiameter

When calculateDiameter input value is set to true the module requires two distinct picking operations. As in the previous case, the initial pick is used to determine the thickness of the cylindrical object. The module then awaits a second pick, which must occur on a different plane belonging to the same object. If the user selects the same plane or a different object, informative messages are logged to guide the user toward a valid selection. Upon a successful second pick, diameterIsValid, diameterPickNormal, thicknessNormal, and thicknessPoint output parameters are populated.

These thickness and diameter related outputs can be utilized for subsequent computations, such as serving as input to the Measure module to generate the corresponding thickness or diameter line, along with the circle that delineates the cylindrical geometry.

Cmeshes: Invisible picking proxies

When the useModelsBounds Boolean flag is set to true, the Pickmanager intelligently creates a set of invisible collision mesh nodes, referred to as "cmeshes," for each loaded model. These cmeshes act as picking proxies, simplifying the hit detection process. Two distinct types of cmeshes are generated:

  • Bounding Box Cmesh (cMeshBox). This cmesh is an axis-aligned bounding box that tightly encloses the entire geometric extents of the associated model. It provides a rough but efficient volume for initial hit testing. Because it encapsulates the whole model, any successful pick against this cmesh guarantees the interaction is within the model's overall spatial boundaries.

  • Bounding Plane Cmesh (cMeshPlane). This cmesh is a virtually infinite planar surface positioned at the center of the model's front-facing bounds. Its orientation is always aligned with the camera’s local forward vector. The bounding plane offers a convenient way to interact with models from a head-on perspective, ensuring a pick within the model's visual silhouette as seen from the front.

This dual cmesh system ensures that the PickManager consistently returns a valid pick position within the spatial confines of the model when useModelsBounds is active.

Processing pick results

The Pickmanager processes picking requests initiated through fields like mousePick, rayPick, or screenPick to identify intersected meshes. The behavior of result processing is determined by the useModelsBounds flag:

  • useModelsBounds = false. In this default mode, the Pickmanager directly returns the information of the first intersected visible mesh encountered during the picking operation. The latestPickResult filed is updated with this result. This mode offers raw picking data without any specific prioritization based on model bounds.

  • useModelsBounds = true. When this flag is enabled, the Pickmanager employs a sophisticated processing pipeline to return a single, prioritized pick result. If any intersections occur, the results are evaluated based on the following priority order:

    • Original Mesh (mesh). If the pick directly hits the visible geometry of the model, this result takes the highest priority.

    • Bounding Box Cmesh (cMeshBox). If the original mesh is not hit, the intersection with the bounding box cmesh is considered next. This provides a fallback for interacting with the model's overall volume.

    • Bounding Plane Cmesh (cMeshPlane). If neither the original mesh nor the bounding box is hit, the intersection with the bounding plane cmesh is considered last. This provides a fallback for interacting with the model's front-facing area.

This prioritization mechanism guarantees that when useModelsBounds is active, the Pickmanager returns a single, meaningful pick result that is reliably located within the defined bounds of the model. This simplifies interaction logic for users, as they can consistently expect a pick within the intended object.

Asynchronous logic

As all pick requests are asynchronous, the module provides an easy way to handle concurrencies and develop asynchronous logic that relies on their results. Using the isBusyPicking output field, users can easily understand if a requested pick is still undergoing or it finished. Making concurrent picking requests would end up in using multiple PickSensors, up to the number available, granting that the result output by the module when isBusyPicking goes to false is always the latest request.

TitleResults for “How to create a CRG?”Also Available in