Hide menu
Loading...
Searching...
No Matches
MeshBody

Defines a body that represents a polygonal mesh.

See also MeshShape.

Extends

Constructors

Constructor

new MeshBody(shape?): MeshBody

Creates a mesh body with an optional initial mesh shape.

Parameters

shape?

MeshShape

Initial mesh shape to add.

Returns

MeshBody

Overrides

Body.constructor

Properties

material

material: VisualMaterial | null = null

Visual material of the body.

The default value is null.

Inherited from

Body.material

Accessors

id

Get Signature

get id(): bigint

Returns the unique identifier of the object.

Returns

bigint

Inherited from

Body.id


name

Get Signature

get name(): string | null

Name of the body.

The default value is null.

Returns

string | null

Set Signature

set name(name): void

Sets the name of the body.

Parameters

name

string | null

Body name.

Returns

void

Inherited from

Body.name


shapes

Get Signature

get shapes(): ReadonlySet<MeshShape>

Mesh shapes composing the body.

Returns

ReadonlySet<MeshShape>

Methods

append()

append(shape): void

Appends a mesh shape to the body.

If shape is already present, it is not added again.

Parameters

shape

MeshShape

Mesh shape to append.

Returns

void