Skip to content

API Type ShapeDesc3D

github-actions[bot] edited this page Nov 30, 2026 · 3 revisions

Type Alias: ShapeDesc3D

type ShapeDesc3D = 
  | {
  halfExtents: PhysicsVec3;
  kind: "box";
}
  | {
  kind: "sphere";
  radius: number;
}
  | {
  halfHeight: number;
  kind: "capsule";
  radius: number;
}
  | {
  convex: boolean;
  indices: Uint32Array;
  kind: "mesh";
  label?: string;
  vertices: Float32Array;
};

Defined in: src/plugins/physics/runtime/backend.ts:63

3D shapes, in the collider's frame.

Union Members

Type Literal

{
  halfExtents: PhysicsVec3;
  kind: "box";
}

Type Literal

{
  kind: "sphere";
  radius: number;
}

Type Literal

{
  halfHeight: number;
  kind: "capsule";
  radius: number;
}

Along y; halfHeight is the straight part's.


Type Literal

{
  convex: boolean;
  indices: Uint32Array;
  kind: "mesh";
  label?: string;
  vertices: Float32Array;
}

Triangles (indices into vertices, xyz triples). convex wraps them in their hull, falling back to the triangles (with a warning) when flat.

Clone this wiki locally