Class SkeletonViewer
Constructors
constructor
-
new SkeletonViewer(
skeleton: Skeleton,
mesh: Nullable<AbstractMesh>,
scene: Scene,
autoUpdateBonesMatrices?: boolean,
renderingGroupId?: number,
options?: Partial<ISkeletonViewerOptions>,
): SkeletonViewerCreates a new SkeletonViewer
Parameters
- skeleton: Skeleton
defines the skeleton to render
- mesh: Nullable<AbstractMesh>
defines the mesh attached to the skeleton
- scene: Scene
defines the hosting scene
- autoUpdateBonesMatrices: boolean = true
defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)
- renderingGroupId: number = 2
defines the rendering group id to use with the viewer
- options: Partial<ISkeletonViewerOptions> = {}
All of the extra constructor options for the SkeletonViewer
Returns SkeletonViewer
- skeleton: Skeleton
Properties
auto Update Bones Matrices
[true] defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)
color
Gets or sets the color used to render the skeleton
mesh
defines the mesh attached to the skeleton
options
[Object] is the options for the viewer
rendering Group Id
[2] defines the rendering group id to use with the viewer
skeleton
defines the skeleton to render
Static ReadonlyDISPLAY_ LINES
public Display constants BABYLON.SkeletonViewer.DISPLAY_LINES
Static ReadonlyDISPLAY_ SPHERE_ AND_ SPURS
public Display constants BABYLON.SkeletonViewer.DISPLAY_SPHERE_AND_SPURS
Static ReadonlyDISPLAY_ SPHERES
public Display constants BABYLON.SkeletonViewer.DISPLAY_SPHERES
Accessors
debug Local Axes Mesh
debug Mesh
-
Gets the debugMesh
Returns AbstractMesh | LinesMesh | null
display Mode
-
get displayMode(): number
Gets the displayMode
Returns number
-
set displayMode(value: number): void
Sets the displayMode
Parameters
- value: number
Returns void
is Enabled
-
get isEnabled(): boolean
Returns boolean
-
set isEnabled(value: boolean): void
Gets or sets a boolean indicating if the viewer is enabled
Parameters
- value: boolean
Returns void
is Ready
-
get isReady(): boolean
Checks Ready Status.
Returns boolean
ready
-
set ready(value: boolean): void
Sets Ready Status.
Parameters
- value: boolean
Returns void
scene
-
Gets the Scene.
Returns Scene
utility Layer
-
Gets the utilityLayer.
Returns Nullable<UtilityLayerRenderer>
Methods
change Display Mode
-
Changes the displayMode of the skeleton viewer
Parameters
- mode: number
The displayMode numerical value
Returns void
- mode: number
change Display Options
-
Sets a display option of the skeleton viewer
Option Type Default Description midStep float 0.235 A percentage between a bone and its child that determines the widest part of a spur. Only used when displayModeis set toDISPLAY_SPHERE_AND_SPURS.midStepFactor float 0.15 Mid step width expressed as a factor of the length. A value of 0.5 makes the spur width half of the spur length. Only used when displayModeis set toDISPLAY_SPHERE_AND_SPURS.sphereBaseSize float 2 Sphere base size. Only used when displayModeis set toDISPLAY_SPHERE_AND_SPURS.sphereScaleUnit float 0.865 Sphere scale factor used to scale spheres in relation to the longest bone. Only used when displayModeis set toDISPLAY_SPHERE_AND_SPURS.spurFollowsChild boolean false Whether a spur should attach its far end to the child bone. showLocalAxes boolean false Displays local axes on all bones. localAxesSize float 0.075 Determines the length of each local axis. Parameters
- option: string
String of the option name
- value: number | boolean
The numerical option value
Returns void
- option: string
dispose
-
Release associated resources
Returns void
update
-
Update the viewer to sync with current skeleton state, only used to manually update.
Returns void
StaticCreate Bone Weight Shader
-
public static method to create a BoneWeight Shader
Parameters
- options: IBoneWeightShaderOptions
The constructor options
- scene: Scene
The scene that the shader is scoped to
Returns ShaderMaterial
The created ShaderMaterial
- options: IBoneWeightShaderOptions
StaticCreate Skeleton Map Shader
-
public static method to create a BoneWeight Shader
Parameters
- options: ISkeletonMapShaderOptions
The constructor options
- scene: Scene
The scene that the shader is scoped to
Returns ShaderMaterial
The created ShaderMaterial
- options: ISkeletonMapShaderOptions
Class used to render a debug view of a given skeleton
See
http://www.babylonjs-playground.com/#1BZJVJ#8