API

Interface PhysicsShapeParameters

Parameters used to describe the Shape

interface PhysicsShapeParameters {
    center?: Vector3;
    extents?: Vector3;
    groundMesh?: GroundMesh;
    heightFieldData?: Float32Array<ArrayBufferLike>;
    heightFieldSizeX?: number;
    heightFieldSizeZ?: number;
    includeChildMeshes?: boolean;
    mesh?: Mesh;
    numHeightFieldSamplesX?: number;
    numHeightFieldSamplesZ?: number;
    pointA?: Vector3;
    pointB?: Vector3;
    radius?: number;
    rotation?: Quaternion;
}
Index
center?: Vector3

Shape center position

extents?: Vector3

Dimension extents for the box

groundMesh?: GroundMesh

Ground mesh used for display

heightFieldData?: Float32Array<ArrayBufferLike>

The data for the heightfield

heightFieldSizeX?: number

The size of the heightfield in the X axis

heightFieldSizeZ?: number

The size of the heightfield in the Z axis

includeChildMeshes?: boolean

Use children hierarchy

mesh?: Mesh

Mesh used for Mesh shape or convex hull. It can be different than the mesh the body is attached to.

numHeightFieldSamplesX?: number

The number of samples along the X axis

numHeightFieldSamplesZ?: number

The number of samples along the Z axis

pointA?: Vector3

First point position that defines the cylinder or capsule

pointB?: Vector3

Second point position that defines the cylinder or capsule

radius?: number

Radius for cylinder, shape and capsule

rotation?: Quaternion

Shape orientation