• Studio

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • API

    Datatypes

    Edit

    Plane

    Represents a plane in 3D space defined by a normal vector and a distance from the origin. Used for geometric calculations like intersection points, containment tests, and distance measurements.

    Properties

    The normal vector of the plane, perpendicular to its surface.

    distance

    number

    The shortest distance between the plane and the origin along its normal.

    Returns a new plane with the normal vector flipped.

    Methods

    Determines if a ray intersects the plane and returns the intersection point distance.

    Parameters

    ray
    Ray

    The ray to test for intersection.

    Returns

    (boolean, number)

    A tuple containing intersection status and distance.

    Sets the normal vector and a point on the plane to redefine its position.

    Parameters

    inNormal
    Vector3

    The new normal vector of the plane.

    inPoint
    Vector3

    A new point on the plane.

    Returns

    void

    Recalculates the plane to contain three specified points.

    Parameters

    The first point.

    The second point.

    The third point.

    Returns

    void

    Flips the plane's normal vector.

    Returns

    void

    Moves the plane by a specified offset in 3D space.

    Parameters

    plane
    Plane

    The plane to translate.

    translation
    Vector3

    The translation offset.

    Returns

    Plane

    Returns the translated plane.

    Finds the point on the plane closest to a given point.

    Parameters

    point
    Vector3

    The point in 3D space.

    Returns

    Vector3

    Returns the closest point on the plane.

    Calculates the shortest distance from a point to the plane.

    Parameters

    point
    Vector3

    The point to calculate the distance from.

    Returns

    number

    Determines which side of the plane a point lies on.

    Parameters

    point
    Vector3

    The point to test.

    Returns

    boolean

    Returns true if the point is on the same side as the plane's normal.

    Checks if two points are on the same side of the plane.

    Parameters

    inPt0
    Vector3

    The first point.

    inPt1
    Vector3

    The second point.

    Returns

    boolean

    Returns true if the points are on the same side of the plane.

    Moves the plane in 3D space by a specified offset without changing its normal direction.

    Parameters

    plane
    Plane

    The plane to translate.

    translation
    Vector3

    The translation offset.

    Returns

    Plane

    Returns a new Plane instance that has been translated.

    Updated 5 months ago

    PocketWorlds Icon

    © 2024 Pocket Worlds. All rights reserved.