GCubeSDK
©2026 FenixFox®Studios

SkinnedMesh

SkinnedMesh ⟵ MeshObject3D

A mesh that has a Skeleton with bones that can then be used to animate the vertices of the geometry..
This class extends Mesh to support skeletal animation using a skeleton composed of bones. It allows for realistic deformation of meshes based on bone movements.

  • Skeletal animation support with bone hierarchies
  • Bind matrix management for bone transformations
  • Bounding volume computation for animated meshes
  • Skin weight normalization for smooth deformations
  • 4 Bones per Vertex

Methods

SkinnedMesh()

Default constructor - creates an empty skinned mesh

SkinnedMesh(BufferGeometry* geometry, Material* material = nullptr)

Constructor with geometry and optional material

geometry Pointer to geometry with skin data nullptr
material Pointer to material to use nullptr

void bind(Skeleton* skeleton, Mtx* bindMatrix = nullptr)

Binds a skeleton to this skinned mesh

skeleton The skeleton to bind nullptr
bindMatrix The bind matrix nullptr

void pose()

Sets the skinned mesh to rest pose (resets the pose)

void normalizeSkinWeights()

Normalizes the skin weights to ensure they sum to 1.0

void computeBoundingBox()

Computes the bounding box of the skinned mesh and updates the boundingBox property

void computeBoundingSphere()

Computes the bounding sphere of the skinned mesh and updates the boundingSphere property

void getVertexPosition(u32 index, Vector3& target)

Gets the transformed vertex position for the given index

index Vertex index to get position for 0
target Vector to store the position Vector3()

void applyBoneTransform(u32 index, Vector3& target)

Applies the bone transform associated with the given index to the provided position vector

index Vertex index to transform 0
target Vector to store transformed position Vector3()

virtual void render()

Renders this skinned mesh with bone transformations applied

virtual SkinnedMesh* clone(bool recursive = true) const

Creates a copy of this skinned mesh

recursive Whether to clone children true

virtual void copy(const Object3D& object, bool recursive = true) override

Copies properties from another object

object Source object to copy from Object3D()
recursive Whether to copy children true

Properties

bindMatrix Mtx The base matrix that is used for the bound bone transforms
bindMatrixInverse Mtx The base matrix that is used for resetting the bound bone transforms
bindMode BindMode Either AttachedBindMode or DetachedBindMode - how skeleton is bound to mesh
boundingBox Box3* The bounding box of the SkinnedMesh - can be calculated with computeBoundingBox()
boundingSphere void* The bounding sphere of the SkinnedMesh - can be calculated with computeBoundingSphere()
isSkinnedMesh bool Read-only flag to check if a given object is of type SkinnedMesh
skeleton Skeleton* Skeleton representing the bone hierarchy of the skinned mesh