Get RAPTOR

RaptorSuitePicking

Surface picks in the RAPTOR 3D view for tools in other assemblies.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

Exposes the 3D view's surface picking to tools in other assemblies.

public static class RaptorSuitePicking

Methods

MeshHitWins

public static bool MeshHitWins(Ray ray, float t)

Whether a Block face hit at ray distance t beats the older pick stack, by the Mesh tool's rule.

ParameterTypeDescription
rayRayThe world ray.
tfloatThe hit's ray distance.

Returns: True when the Block face wins.

OccluderDistance

public static float OccluderDistance(Ray ray)

Gets the distance along ray to the first occluding surface: a shown Block's front face or a shown model's built surface. Every shown Block of the stage's Mesh models counts, including locked ones.

ParameterTypeDescription
rayRayThe world ray.

Returns: The distance, or infinity when nothing is hit.

PlacePick

public static bool PlacePick(SceneView view, Ray ray, Vector2 mouse, Func<GameObject, bool> reject, out Vector3 point, out Vector3 normal, out RaptorModel model, out GameObject picked)

Same as the other PlacePick overload, but looks through objects that reject returns true for, such as the object being dragged.

ParameterTypeDescription
viewSceneViewThe 3D view.
rayRayThe world ray.
mouseVector2The pointer in GUI coordinates.
rejectFunc<GameObject, bool>True for an object to look through.
pointout Vector3The surface point.
normalout Vector3The surface normal.
modelout RaptorModelThe model.
pickedout GameObjectThe object hit.

Returns: False when nothing is under the pointer.

PlacePick

public static bool PlacePick(SceneView view, Ray ray, Vector2 mouse, out Vector3 point, out Vector3 normal, out RaptorModel model, out GameObject picked)

Picks the visible surface under the pointer the way the Place tool does: a GPU pick and a CPU mesh raycast, falling back to the work plane. It renders, so call it only from pointer events, not Layout or Repaint.

ParameterTypeDescription
viewSceneViewThe 3D view.
rayRayThe world ray.
mouseVector2The pointer in GUI coordinates.
pointout Vector3The surface point.
normalout Vector3The surface normal.
modelout RaptorModelThe model.
pickedout GameObjectThe object hit.

Returns: False when nothing is under the pointer.

  • RaptorModel: The root of a RAPTOR model and its output container.