RaptorSuitePicking
Surface picks in the RAPTOR 3D view for tools in other assemblies.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
Exposes the 3D view's surface picking to tools in other assemblies.
public static class RaptorSuitePickingMethods
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.
| Parameter | Type | Description |
|---|---|---|
ray | Ray | The world ray. |
| t | float | The 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.
| Parameter | Type | Description |
|---|---|---|
ray | Ray | The 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.
| Parameter | Type | Description |
|---|---|---|
view | SceneView | The 3D view. |
ray | Ray | The world ray. |
mouse | Vector2 | The pointer in GUI coordinates. |
reject | Func<GameObject, bool> | True for an object to look through. |
point | out Vector3 | The surface point. |
normal | out Vector3 | The surface normal. |
model | out RaptorModel | The model. |
picked | out GameObject | The 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.
| Parameter | Type | Description |
|---|---|---|
view | SceneView | The 3D view. |
ray | Ray | The world ray. |
mouse | Vector2 | The pointer in GUI coordinates. |
point | out Vector3 | The surface point. |
normal | out Vector3 | The surface normal. |
model | out RaptorModel | The model. |
picked | out GameObject | The object hit. |
Returns: False when nothing is under the pointer.
Related types
- RaptorModel: The root of a RAPTOR model and its output container.