Lens Scripting API
    Preparing search index...

    A collection of utility functions for collider calculations.

    Note: Closest point calculations are local AABB-based approximations, not precise collider geometry.

    Index

    Constructors

    Methods

    • Calculates the closest point on a collider's surface to a given point in world space.

      Parameters

      • collider: ColliderComponent

        The collider component to calculate the closest point on.

      • queryPoint: vec3

        The query point in world space.

      Returns vec3

      The closest point on the collider surface in world space.

    • Calculates an approximate closest point on a collider's surface to a line segment.

      This provides a fast, plausible result but is an approximation. Accuracy decreases for colliders with non-uniform scaling, as the underlying math simplifies the geometry for performance.

      Parameters

      • collider: ColliderComponent

        The collider component to calculate the closest point on.

      • segmentStart: vec3

        The start point of the line segment in world space.

      • segmentEnd: vec3

        The end point of the line segment in world space.

      Returns vec3

      The closest point on the collider's surface. A new vec3 instance.

    • Gets statistics about the vector object pools for debugging and monitoring.

      Returns { vec2Pool: PoolStats; vec3Pool: PoolStats }