Nano WebGPU API - v0.11.0
    Preparing search index...

    Class CollisionShape

    CollisionShape represents a bounding volume used for basic collision queries and overlap checks. Centered locally around its parent Node3D's origin, it provides local-space AABB bounds that are transformed into world-space when resolving intersections.

    Index

    Methods

    • Computes the local axis-aligned bounding box (AABB) centered at origin (0, 0, 0) for this shape, before any spatial node transformations are applied.

      Returns AABB

      The calculated local-space AABB.

    • Factory method to instantiate a box-shaped bounding volume.

      Parameters

      • size: number | Vec3 = 1.0

        Full dimension size. Can be a single scalar for cubes or a Vec3 specifying width, height, and depth.

      Returns CollisionShape

      A newly created box CollisionShape.

    • Factory method to instantiate a sphere-shaped bounding volume.

      Parameters

      • radius: number = 0.5

        Radius dimension of the bounding sphere.

      Returns CollisionShape

      A newly created sphere CollisionShape.

    Properties

    halfExtents: Vec3

    Bounding half-extents (dimensions divided by two) along local X, Y, and Z axes. Primarily utilized when shape type is "box".

    radius: number

    Radius of the bounding sphere. Primarily utilized when shape type is "sphere".

    type: ShapeType

    The specific bounding geometry type represented by this shape.