Bitbybit Docs
    Preparing search index...

    Class BabylonRay

    Rays: a start point and a direction, optionally with a length, used to pick what lies along a line of sight or to test intersections. createPickingRay builds the ray from the camera through the pointer, the others build one from points.

    Index

    Constructors

    create

    • Builds a ray from the active camera through the pointer's current position on the canvas, the ray a click would pick with.

      Returns Ray

      The ray

      const ray = bitbybit.babylon.ray.createPickingRay();
      const pick = bitbybit.babylon.pick.pickWithRay({ ray });
    • Builds a ray starting at origin and pointing along direction; length limits how far it reaches, and 0 or nothing leaves it unlimited.

      Parameters

      • inputs: BaseRayDto

        The origin, the direction and the optional length

      Returns Ray

      The ray

      const ray = bitbybit.babylon.ray.createRay({ origin: [0, 10, 0], direction: [0, -1, 0], length: 100 });
      
    • Builds a ray that starts at from, points toward to and is exactly as long as the distance between them.

      Parameters

      • inputs: FromToDto

        The start point and the end point

      Returns Ray

      The ray

      const ray = bitbybit.babylon.ray.createRayFromTo({ from: [0, 10, 0], to: [0, 0, 0] });
      

    get