Skip to content

Documentation / @imvu/cal3d / Skeleton

Class: Skeleton ​

Defined in: packages/cal3d/src/Skeleton.ts:94

A Cal3D skeleton (.csf binary / .xsf XML): a flat list of bones linked by parent index.

Constructors ​

Constructor ​

ts
new Skeleton(init?): Skeleton;

Defined in: packages/cal3d/src/Skeleton.ts:101

Parameters ​

ParameterType
init?SkeletonInit

Returns ​

Skeleton

Properties ​

bones ​

ts
readonly bones: Bone[] = [];

Defined in: packages/cal3d/src/Skeleton.ts:95


sceneAmbientColor ​

ts
sceneAmbientColor: Color;

Defined in: packages/cal3d/src/Skeleton.ts:97

Scene ambient light as RGB floats (a is unused). IMVU rooms set it; avatars leave it black.


version ​

ts
version: number | undefined;

Defined in: packages/cal3d/src/Skeleton.ts:99

The version of the file this was parsed from (undefined for skeletons built in code).

Accessors ​

lights ​

Get Signature ​

ts
get lights(): Bone[];

Defined in: packages/cal3d/src/Skeleton.ts:133

Bones that act as scene lights.

Returns ​

Bone[]


roots ​

Get Signature ​

ts
get roots(): Bone[];

Defined in: packages/cal3d/src/Skeleton.ts:128

Bones without a parent.

Returns ​

Bone[]

Methods ​

addBone() ​

ts
addBone(bone): Bone;

Defined in: packages/cal3d/src/Skeleton.ts:115

Append a bone (its id becomes the next index) and return it.

Parameters ​

ParameterType
boneBone

Returns ​

Bone


getBone() ​

ts
getBone(idOrName): Bone | undefined;

Defined in: packages/cal3d/src/Skeleton.ts:123

Parameters ​

ParameterType
idOrNamestring | number

Returns ​

Bone | undefined


toBinary() ​

ts
toBinary(): Uint8Array;

Defined in: packages/cal3d/src/Skeleton.ts:146

Returns ​

Uint8Array


toXml() ​

ts
toXml(): string;

Defined in: packages/cal3d/src/Skeleton.ts:165

Returns ​

string


walk() ​

ts
walk(): Generator<{
  bone: Bone;
  depth: number;
}>;

Defined in: packages/cal3d/src/Skeleton.ts:138

Depth-first walk from the roots, parents before children.

Returns ​

Generator<{ bone: Bone; depth: number; }>


parse() ​

ts
static parse(input, options?): Skeleton;

Defined in: packages/cal3d/src/Skeleton.ts:107

Parse a binary or XML skeleton file.

Parameters ​

ParameterType
inputCal3DInput
options?ParseOptions

Returns ​

Skeleton

Released under the MIT License.