Click or drag to resize

HelperNearestMechanism Method

Attempts to find a mechanism aspect in the vicinity of the visual in the visual hierarchy. This function can visit every visual in the scene. Do NOT use this unless you absolutely need to and certainly do NOT call this during simulation.

Namespace:  Demo3D.Visuals.KJE
Assembly:  Demo3D.Core (in Demo3D.Core.dll) Version: 15.0.2.11458
Syntax
C#
public static MechanismAspect NearestMechanism(
	Visual visual
)

Parameters

visual
Type: Demo3D.VisualsVisual
The visual to start exploring from.

Return Value

Type: MechanismAspect
A mechanism aspect, hopefully somewhere near the visual.
Remarks
This function will return a mechanism aspect if one exists in the scene. If this function returns null then no mechanism aspect exists in the scene. This function will first check the visual provided for a mechanism aspect. If that fails then it will look up the hierarchy. If that fails then it will look down the hierarchy. If that fails then it will check every visual in the scene and return the mechanism aspect on the visual closest to the provided visual.
See Also