Preparing search index...

    Hit result returned by SpecsInteractionModule's cast queries. See SpecsInteractionModule#rayCast, SpecsInteractionModule#rayCastAll, SpecsInteractionModule#sphereCast, and SpecsInteractionModule#sphereCastAll. For overlap detection, see OverlapProbe.

    Lens Scripting Version 375

    const ray = interactor.getTargetingRay();
    if (ray) {
    const queryMask = LayerSet.all();
    const rayEnd = ray.origin.add(ray.direction.uniformScale(500));
    interaction.rayCast(ray.origin, rayEnd, queryMask, function (hit) {
    if (hit && hit.collider) {
    print("hit " + hit.collider.getSceneObject().name + " at " + hit.distance + "cm");
    }
    });
    }

    Hierarchy (View Summary)

    Index

    Properties

    The collider that was hit. Null if the collider has been destroyed.

    Lens Scripting Version 375

    distance: number

    How far the cast travelled from its start before contact. For a sphere cast this is how far the sphere's center moved, so it can be up to one radius less than the distance to position.

    Lens Scripting Version 375

    normal: vec3

    Surface normal on the collider at the point of intersection.

    Lens Scripting Version 375

    position: vec3

    World-space position at the point of intersection.

    Lens Scripting Version 375

    t: number

    Interpolant along the cast from start to end, in the range [0, 1].

    Lens Scripting Version 375

    The hit triangle, if it exists. This is set on intersection with mesh-based colliders, and null otherwise.

    Lens Scripting Version 375

    Methods

    • Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string

      Lens Scripting Version 375

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean