Constructors

Methods

  • raycast against rendered three objects. This might be very slow depending on your scene complexity. We recommend setting objects to IgnoreRaycast layer (2) when you don't need them to be raycasted. Raycasting SkinnedMeshes is specially expensive. Use raycastPhysics for raycasting against physic colliders only. Depending on your scenario this might be faster.

    Parameters

    • options: RaycastOptions = null

      raycast options. If null, default options will be used.

    Returns Intersection[]

  • Parameters

    Returns Intersection[]

  • Parameters

    • origin: Vec3 | Vec2
    • direction: Vec3 = undefined
    • maxDistance: number = Infinity
    • solid: boolean = true

    Returns {
        collider: ICollider;
        normal?: Vector3;
        point: Vector3;
    }

    Deprecated

    use this.context.physics.engine.raycast

  • Parameters

    • origin: Vec3 | Vec2
    • direction: Vec3 = undefined
    • maxDistance: number = Infinity
    • solid: boolean = true

    Returns {
        collider: ICollider;
        normal?: Vector3;
        point: Vector3;
    }

    Deprecated

    use this.context.physics.engine.raycastAndGetNormal

  • Test overlapping of a sphere with the threejs geometry. This does not use colliders. This does not return an exact intersection point (intersections returned contain the object and the world position of the object that is being hit) For a more accurate test use the physics engine's collider overlap test (see sphereOverlapPhysics)

    Parameters

    • spherePos: Vector3

      the center of the sphere in world space

    • radius: number

      the radius of the sphere

    • traverseChildsAfterHit: boolean = true

      if false it will stop after the first hit. If true it will continue to traverse and add all hits to the result array

    Returns Intersection[]

Generated using TypeDoc