Kemena3D
Loading...
Searching...
No Matches
kemena::kMesh Class Reference

Scene-graph node that holds renderable geometry. More...

#include <kmesh.h>

Inheritance diagram for kemena::kMesh:
Collaboration diagram for kemena::kMesh:

Public Member Functions

 kMesh (kObject *parentNode=nullptr)
 Constructs a mesh node and optionally attaches it to a parent.
 ~kMesh ()
 Destroys the mesh and releases its GPU buffers.
void setLoaded (bool newLoaded)
 Marks whether the mesh geometry has been fully loaded.
bool getLoaded ()
 Returns whether the mesh geometry is fully loaded.
void setFileName (kString newFileName)
 Sets the source asset file path.
kString getFileName ()
 Returns the source asset file path.
void setRefName (kString newRefName)
 Sets the reference name used to identify shared mesh data.
kString getRefName ()
 Returns the reference name.
void setPrimitiveType (kString type)
 Marks this mesh as one of the built-in procedural primitives ("cube", "sphere", "cylinder", "capsule", "plane"). Set by kMeshGenerator so save/load and duplicate can rebuild the geometry from the marker instead of needing a file on disk.
kString getPrimitiveType () const
 Returns the procedural-primitive marker, if any.
void setPosition (kVec3 newPosition)
 Propagates a local position change to this mesh and its children.
void setRotation (kQuat newRotation)
 Propagates a local rotation change to this mesh and its children.
void setScale (kVec3 newScale)
 Propagates a local scale change to this mesh and its children.
void reserveBoneData (size_t vertexCount)
 Pre-allocates bone ID and weight arrays for a given vertex count.
void reserveSpace (size_t vertexCount)
 Pre-allocates all per-vertex attribute vectors.
void setBoneInfoMap (std::map< kString, kBoneInfo > newBoneInfoMap)
 Replaces the bone-name-to-info map.
std::map< kString, kBoneInfo > & getBoneInfoMap ()
 Returns a reference to the bone-name-to-info map.
int & getBoneCount ()
 Returns a reference to the bone counter used during loading.
void setBoneCount (int newBoneCount)
 Sets the total number of bones.
void addIndex (uint32_t index)
 Appends an index to the index buffer.
std::vector< uint32_t > getIndices ()
 Returns a copy of the index buffer.
void addVertex (kVec3 vertex)
 Appends a vertex position.
std::vector< kVec3getVertices ()
 Returns a copy of the vertex position buffer.
void addUV (kVec2 uv)
 Appends a UV coordinate.
std::vector< kVec2getUVs ()
 Returns a copy of the UV coordinate buffer.
void addVertexColor (kVec3 color)
 Appends a per-vertex colour.
std::vector< kVec3getVertexColors ()
 Returns a copy of the per-vertex colour buffer.
void addNormal (kVec3 normal)
 Appends a vertex normal.
std::vector< kVec3getNormals ()
 Returns a copy of the normal buffer.
void addTangent (kVec3 tangent)
 Appends a vertex tangent.
std::vector< kVec3getTangents ()
 Returns a copy of the tangent buffer.
void addBitangent (kVec3 bitangent)
 Appends a vertex bitangent.
std::vector< kVec3getBitangents ()
 Returns a copy of the bitangent buffer.
void addBoneID (const kIvec4 &boneID)
 Appends a bone-ID tuple for the next vertex.
void setBoneID (size_t vertexIndex, const kIvec4 &boneID)
 Overwrites the bone-ID tuple for a specific vertex.
kIvec4 getBoneID (size_t vertexIndex)
 Returns the bone-ID tuple for a vertex.
std::vector< kIvec4getBoneIDs ()
 Returns a copy of the bone-ID buffer.
void setBoneIDs (std::vector< kIvec4 > newBoneIDs)
 Replaces the entire bone-ID buffer.
void addWeight (const kVec4 &weight)
 Appends a bone-weight tuple for the next vertex.
void setWeight (size_t vertexIndex, const kVec4 &weight)
 Overwrites the bone-weight tuple for a specific vertex.
kVec4 getWeight (size_t vertexIndex)
 Returns the bone-weight tuple for a vertex.
std::vector< kVec4getWeights ()
 Returns a copy of the bone-weight buffer.
void setWeights (std::vector< kVec4 > newWeights)
 Replaces the entire bone-weight buffer.
int getVertexCount ()
 Returns the number of vertices in this mesh.
uint32_t getVertexArrayObject ()
 Returns the GPU handle for the Vertex Array Object.
uint32_t getVertexBuffer ()
 Returns the GPU handle for the position VBO.
uint32_t getVertexColorBuffer ()
 Returns the GPU handle for the vertex-colour VBO.
void setNormalMatrix (kMat4 newNormalMatrix)
 Stores a precomputed normal matrix.
kMat4 getNormalMatrix ()
 Returns the stored normal matrix.
void computeLocalAABB ()
 Computes the local-space AABB from the vertex position buffer.
kAABB getLocalAABB () const
 Returns the axis-aligned bounding box in local (object) space.
kAABB getWorldAABB ()
 Returns the AABB transformed into world space.
void generateVbo ()
 Uploads all vertex attribute data to the GPU.
void generateTangents ()
 Computes per-vertex tangents and bitangents from positions, UVs, and indices. Must be called after all vertices, UVs, normals, and indices have been added and before generateVbo().
void calculateNormalMatrix ()
 Recomputes the normal matrix from the current world transform.
void draw ()
 Issues a draw call for this mesh via the current kDriver.
json serialize ()
 Serialises the mesh to JSON.
void deserialize (json data)
 Restores the mesh from a JSON object.
void setVisible (bool newVisible)
 Controls the mesh's render visibility.
bool getVisible ()
 Returns whether the mesh is visible.
void setCastShadow (bool newCastShadow)
 Controls whether the mesh casts shadows.
bool getCastShadow ()
 Returns whether the mesh casts shadows.
void setReceiveShadow (bool newReceiveShadow)
 Controls whether the mesh receives shadows.
bool getReceiveShadow ()
 Returns whether the mesh receives shadows.
void setVertexBoneData (size_t vertexID, int boneID, float weight)
 Assigns a single bone influence to a vertex (used during loading).
void setAnimator (kAnimator *newAnimator)
 Attaches a skeletal animator to this mesh.
kAnimatorgetAnimator ()
 Returns the attached animator.
void setSkinned (bool newSkinned)
 Sets whether this mesh is driven by skeletal animation.
bool getSkinned ()
 Returns whether skeletal skinning is enabled.
Public Member Functions inherited from kemena::kObject
 kObject (kObject *parentNode=nullptr)
 Constructs a kObject and optionally attaches it to a parent.
virtual ~kObject ()
 Destroys the object.
kObjectgetParent ()
 Returns the parent node.
void setParent (kObject *newParent)
 Reparents this object under newParent.
void detachFromParent ()
 Removes this object from its parent's children list.
void setParentKeepTransform (kObject *newParent)
 Reparents this object while keeping its world transform.
std::vector< kObject * > getChildren ()
 Returns the list of direct children.
std::vector< kScript > & getScripts ()
 Returns a mutable reference to the list of attached scripts.
void addScript (const kScript &script)
 Appends a script descriptor to this object.
void removeScript (const kString &uuid)
 Removes the script with the given UUID from this object.
std::vector< kParticle > & getParticles ()
 Returns a mutable reference to the list of attached particle systems.
void addParticle (const kParticle &particle)
 Appends a particle system descriptor to this object.
void removeParticle (const kString &uuid)
 Removes the particle system with the given UUID from this object.
std::vector< kAudioSource > & getAudioSources ()
 Returns a mutable reference to the list of attached audio sources.
void addAudioSource (const kAudioSource &source)
 Appends an audio source descriptor to this object.
void removeAudioSource (const kString &uuid)
 Removes the audio source with the given UUID from this object.
std::vector< kAudioListener > & getAudioListeners ()
 Returns a mutable reference to the list of audio listener components (0 or 1).
void addAudioListener (const kAudioListener &listener)
 Attaches an audio listener descriptor to this object.
void removeAudioListener (const kString &uuid)
 Removes the audio listener with the given UUID from this object.
bool getHasPhysicsDesc () const
 Returns true if this object has a physics body descriptor configured.
void setHasPhysicsDesc (bool val)
 Sets whether this object has a physics body descriptor.
kPhysicsObjectDescgetPhysicsDesc ()
 Returns a mutable reference to the physics body descriptor.
bool getHasCharacterDesc () const
 Returns true if this object has a character controller configured.
void setHasCharacterDesc (bool val)
 Sets whether this object has a character controller descriptor.
kCharacterControllerDescgetCharacterDesc ()
 Returns a mutable reference to the character controller descriptor.
bool getHasNavMeshDesc () const
 Returns true if this object carries a navigation surface.
void setHasNavMeshDesc (bool val)
 Sets whether this object carries a navigation surface.
kNavMeshDescgetNavMeshDesc ()
 Returns a mutable reference to the navigation surface descriptor.
kNodeType getType ()
 Returns the scene-graph node type tag.
void setType (kNodeType newType)
 Sets the node type tag.
bool getActive ()
 Returns whether this object is active (visible/processed).
void setActive (bool newActive)
 Activates or deactivates the object.
bool getStatic ()
 Returns whether this object is marked as static (immobile geometry).
void setStatic (bool newStatic)
 Marks the object as static or dynamic.
bool getDebugMode ()
 Returns whether editor debug visualization is enabled.
void setDebugMode (bool newMode)
 Enables or disables editor debug visualization for this object.
unsigned int getId ()
 Returns the numeric identifier of this object.
void setId (unsigned int newId)
 Sets the numeric identifier.
kString getUuid ()
 Returns the UUID kString of this object.
void setUuid (kString newUuid)
 Sets the UUID kString.
kString getName ()
 Returns the display name of this object.
void setName (kString newName)
 Sets the display name.
kString getPrefabRef () const
 Returns the prefab asset UUID this object is an instance of, or empty.
void setPrefabRef (const kString &ref)
 Sets the prefab asset UUID this object is an instance of.
kString getTemplateUuid () const
 Returns the UUID of the corresponding node in the prefab template.
void setTemplateUuid (const kString &uuid)
 Sets the corresponding template UUID for this prefab instance node.
kVec3 getPosition ()
 Returns the local position.
kQuat getRotation ()
 Returns the local rotation as a quaternion.
kVec3 getRotationEuler ()
 Returns the local rotation as Euler angles in degrees.
kVec3 getScale ()
 Returns the local scale.
kVec3 calculateRight ()
 Computes the local right (+X) direction in world space.
kVec3 calculateForward ()
 Computes the local forward (-Z) direction in world space.
kVec3 calculateUp ()
 Computes the local up (+Y) direction in world space.
void rotate (kVec3 rotationAxis, float angularSpeed)
 Rotates the object around an axis by a given angular speed.
kVec3 getGlobalPosition ()
 Returns the world-space position derived from the world transform.
kQuat getGlobalRotation ()
 Returns the world-space rotation derived from the world transform.
kVec3 getGlobalScale ()
 Returns the world-space scale derived from the world transform.
void setMaterial (kMaterial *newMaterial, bool setChildren=true)
 Assigns a material to this object and optionally its children.
kMaterialgetMaterial ()
 Returns the assigned material.
void setMaterialUuid (const kString &uuid)
 Sets the source asset UUID of the assigned material.
kString getMaterialUuid () const
 Returns the source asset UUID of the assigned material.
void setImportChild (bool v)
 Marks this node as an import-derived sub-mesh.
bool getImportChild () const
 Whether this node is an import-derived sub-mesh (see setImportChild).
void calculateModelMatrix ()
 Recomputes the local and world-space model matrices.
kMat4 getModelMatrixWorld ()
 Returns the world-space model matrix.
kMat4 getModelMatrixLocal ()
 Returns the local model matrix (relative to the parent).
void attachPhysics (kPhysicsObject *physicsObj)
 Attaches a physics body to this object.
void detachPhysics ()
 Detaches the physics body without destroying it.
kPhysicsObjectgetPhysicsObject ()
 Returns the attached physics body, or nullptr if none is attached.
void syncFromPhysics ()
 Copies the physics body's current position and rotation into this object's local transform.
void attachCharacter (kCharacterController *character)
 Attaches a runtime character controller to this object.
void detachCharacter ()
 Detaches the character controller without destroying it.
kCharacterControllergetCharacterController ()
 Returns the attached character controller, or nullptr.
void syncFromCharacter ()
 Copies the character controller's position into this object's local transform. Call once per frame after the physics update.

Detailed Description

Scene-graph node that holds renderable geometry.

Stores per-vertex attributes (position, UV, normal, tangent, bitangent, colour, bone IDs, bone weights) together with an index buffer. GPU buffers are allocated lazily via generateVbo(). Supports both static and skeletal-animated meshes through an optional kAnimator attachment.

Constructor & Destructor Documentation

◆ kMesh()

kemena::kMesh::kMesh ( kObject * parentNode = nullptr)

Constructs a mesh node and optionally attaches it to a parent.

Parameters
parentNodeParent scene-graph node, or nullptr for a root node.
Here is the call graph for this function:

◆ ~kMesh()

kemena::kMesh::~kMesh ( )

Destroys the mesh and releases its GPU buffers.

Member Function Documentation

◆ addBitangent()

void kemena::kMesh::addBitangent ( kVec3 bitangent)

Appends a vertex bitangent.

Parameters
bitangentNormalised bitangent vector in object space.

◆ addBoneID()

void kemena::kMesh::addBoneID ( const kIvec4 & boneID)

Appends a bone-ID tuple for the next vertex.

Parameters
boneIDUp to four bone indices influencing the vertex.

◆ addIndex()

void kemena::kMesh::addIndex ( uint32_t index)

Appends an index to the index buffer.

Parameters
indexTriangle vertex index.

◆ addNormal()

void kemena::kMesh::addNormal ( kVec3 normal)

Appends a vertex normal.

Parameters
normalNormalised surface normal in object space.

◆ addTangent()

void kemena::kMesh::addTangent ( kVec3 tangent)

Appends a vertex tangent.

Parameters
tangentNormalised tangent vector in object space.

◆ addUV()

void kemena::kMesh::addUV ( kVec2 uv)

Appends a UV coordinate.

Parameters
uvTexture coordinate (U, V).

◆ addVertex()

void kemena::kMesh::addVertex ( kVec3 vertex)

Appends a vertex position.

Parameters
vertexXYZ position in object space.

◆ addVertexColor()

void kemena::kMesh::addVertexColor ( kVec3 color)

Appends a per-vertex colour.

Parameters
colorRGB colour value (0..1 per channel).

◆ addWeight()

void kemena::kMesh::addWeight ( const kVec4 & weight)

Appends a bone-weight tuple for the next vertex.

Parameters
weightFour blend weights (must sum to 1.0).

◆ calculateNormalMatrix()

void kemena::kMesh::calculateNormalMatrix ( )

Recomputes the normal matrix from the current world transform.

◆ computeLocalAABB()

void kemena::kMesh::computeLocalAABB ( )

Computes the local-space AABB from the vertex position buffer.

Called automatically by generateVbo(); safe to call manually if vertices are modified after VBO generation.

◆ deserialize()

void kemena::kMesh::deserialize ( json data)
virtual

Restores the mesh from a JSON object.

Parameters
dataJSON produced by serialize().

Reimplemented from kemena::kObject.

◆ draw()

void kemena::kMesh::draw ( )
virtual

Issues a draw call for this mesh via the current kDriver.

Reimplemented from kemena::kObject.

◆ generateTangents()

void kemena::kMesh::generateTangents ( )

Computes per-vertex tangents and bitangents from positions, UVs, and indices. Must be called after all vertices, UVs, normals, and indices have been added and before generateVbo().

◆ generateVbo()

void kemena::kMesh::generateVbo ( )

Uploads all vertex attribute data to the GPU.

Creates a VAO, one VBO per attribute, and an EBO, then describes the attribute layout to the driver. Safe to call multiple times; subsequent calls re-upload the data.

◆ getAnimator()

kAnimator * kemena::kMesh::getAnimator ( )

Returns the attached animator.

Returns
Pointer to the animator, or nullptr if none.

◆ getBitangents()

std::vector< kVec3 > kemena::kMesh::getBitangents ( )

Returns a copy of the bitangent buffer.

Returns
Vector of bitangents.

◆ getBoneCount()

int & kemena::kMesh::getBoneCount ( )

Returns a reference to the bone counter used during loading.

Returns
Mutable reference to the bone count integer.

◆ getBoneID()

kIvec4 kemena::kMesh::getBoneID ( size_t vertexIndex)

Returns the bone-ID tuple for a vertex.

Parameters
vertexIndexZero-based vertex index.
Returns
Four bone indices.

◆ getBoneIDs()

std::vector< kIvec4 > kemena::kMesh::getBoneIDs ( )

Returns a copy of the bone-ID buffer.

Returns
Vector of kIvec4 bone indices, one per vertex.

◆ getBoneInfoMap()

std::map< kString, kBoneInfo > & kemena::kMesh::getBoneInfoMap ( )

Returns a reference to the bone-name-to-info map.

Returns
Mutable reference to the internal map.

◆ getCastShadow()

bool kemena::kMesh::getCastShadow ( )

Returns whether the mesh casts shadows.

Returns
true if included in the shadow pass.

◆ getFileName()

kString kemena::kMesh::getFileName ( )

Returns the source asset file path.

Returns
File path kString.

◆ getIndices()

std::vector< uint32_t > kemena::kMesh::getIndices ( )

Returns a copy of the index buffer.

Returns
Vector of triangle indices.

◆ getLoaded()

bool kemena::kMesh::getLoaded ( )

Returns whether the mesh geometry is fully loaded.

Returns
true after all vertex data has been populated.

◆ getLocalAABB()

kAABB kemena::kMesh::getLocalAABB ( ) const

Returns the axis-aligned bounding box in local (object) space.

◆ getNormalMatrix()

kMat4 kemena::kMesh::getNormalMatrix ( )

Returns the stored normal matrix.

Returns
4x4 matrix whose upper-left 3x3 is the normal matrix.

◆ getNormals()

std::vector< kVec3 > kemena::kMesh::getNormals ( )

Returns a copy of the normal buffer.

Returns
Vector of normals.

◆ getPrimitiveType()

kString kemena::kMesh::getPrimitiveType ( ) const

Returns the procedural-primitive marker, if any.

Returns
Primitive type name, or an empty kString for file-loaded meshes.

◆ getReceiveShadow()

bool kemena::kMesh::getReceiveShadow ( )

Returns whether the mesh receives shadows.

Returns
true if shadow is applied on this mesh.

◆ getRefName()

kString kemena::kMesh::getRefName ( )

Returns the reference name.

Returns
Reference identifier kString.

◆ getSkinned()

bool kemena::kMesh::getSkinned ( )

Returns whether skeletal skinning is enabled.

Returns
true if the mesh is skinned.

◆ getTangents()

std::vector< kVec3 > kemena::kMesh::getTangents ( )

Returns a copy of the tangent buffer.

Returns
Vector of tangents.

◆ getUVs()

std::vector< kVec2 > kemena::kMesh::getUVs ( )

Returns a copy of the UV coordinate buffer.

Returns
Vector of UV coordinates.

◆ getVertexArrayObject()

uint32_t kemena::kMesh::getVertexArrayObject ( )

Returns the GPU handle for the Vertex Array Object.

Returns
VAO handle (0 if not yet uploaded).

◆ getVertexBuffer()

uint32_t kemena::kMesh::getVertexBuffer ( )

Returns the GPU handle for the position VBO.

Returns
VBO handle (0 if not yet uploaded).

◆ getVertexColorBuffer()

uint32_t kemena::kMesh::getVertexColorBuffer ( )

Returns the GPU handle for the vertex-colour VBO.

Returns
VBO handle (0 if not yet uploaded).

◆ getVertexColors()

std::vector< kVec3 > kemena::kMesh::getVertexColors ( )

Returns a copy of the per-vertex colour buffer.

Returns
Vector of RGB colours.

◆ getVertexCount()

int kemena::kMesh::getVertexCount ( )

Returns the number of vertices in this mesh.

Returns
Vertex count.

◆ getVertices()

std::vector< kVec3 > kemena::kMesh::getVertices ( )

Returns a copy of the vertex position buffer.

Returns
Vector of positions.

◆ getVisible()

bool kemena::kMesh::getVisible ( )

Returns whether the mesh is visible.

Returns
true if the mesh will be rendered.

◆ getWeight()

kVec4 kemena::kMesh::getWeight ( size_t vertexIndex)

Returns the bone-weight tuple for a vertex.

Parameters
vertexIndexZero-based vertex index.
Returns
Four blend weights.

◆ getWeights()

std::vector< kVec4 > kemena::kMesh::getWeights ( )

Returns a copy of the bone-weight buffer.

Returns
Vector of kVec4 weights, one per vertex.

◆ getWorldAABB()

kAABB kemena::kMesh::getWorldAABB ( )

Returns the AABB transformed into world space.

Transforms all 8 corners of the local AABB by the current world matrix and returns the enclosing axis-aligned box. Call calculateModelMatrix() first to ensure the world transform is up to date.

◆ reserveBoneData()

void kemena::kMesh::reserveBoneData ( size_t vertexCount)

Pre-allocates bone ID and weight arrays for a given vertex count.

Parameters
vertexCountNumber of vertices to reserve space for.

◆ reserveSpace()

void kemena::kMesh::reserveSpace ( size_t vertexCount)

Pre-allocates all per-vertex attribute vectors.

Parameters
vertexCountNumber of vertices to reserve space for.

◆ serialize()

json kemena::kMesh::serialize ( )
virtual

Serialises the mesh to JSON.

Returns
JSON object with geometry, transform, and material references.

Reimplemented from kemena::kObject.

◆ setAnimator()

void kemena::kMesh::setAnimator ( kAnimator * newAnimator)

Attaches a skeletal animator to this mesh.

Parameters
newAnimatorAnimator driving the bone transforms.

◆ setBoneCount()

void kemena::kMesh::setBoneCount ( int newBoneCount)

Sets the total number of bones.

Parameters
newBoneCountBone count.

◆ setBoneID()

void kemena::kMesh::setBoneID ( size_t vertexIndex,
const kIvec4 & boneID )

Overwrites the bone-ID tuple for a specific vertex.

Parameters
vertexIndexZero-based vertex index.
boneIDNew bone-ID tuple.

◆ setBoneIDs()

void kemena::kMesh::setBoneIDs ( std::vector< kIvec4 > newBoneIDs)

Replaces the entire bone-ID buffer.

Parameters
newBoneIDsNew buffer.

◆ setBoneInfoMap()

void kemena::kMesh::setBoneInfoMap ( std::map< kString, kBoneInfo > newBoneInfoMap)

Replaces the bone-name-to-info map.

Parameters
newBoneInfoMapMap from bone name to kBoneInfo.

◆ setCastShadow()

void kemena::kMesh::setCastShadow ( bool newCastShadow)

Controls whether the mesh casts shadows.

Parameters
newCastShadowtrue to include in the shadow depth pass.

◆ setFileName()

void kemena::kMesh::setFileName ( kString newFileName)

Sets the source asset file path.

Parameters
newFileNamePath to the mesh asset on disk.

◆ setLoaded()

void kemena::kMesh::setLoaded ( bool newLoaded)

Marks whether the mesh geometry has been fully loaded.

Parameters
newLoadedtrue once all vertex data has been populated.

◆ setNormalMatrix()

void kemena::kMesh::setNormalMatrix ( kMat4 newNormalMatrix)

Stores a precomputed normal matrix.

Parameters
newNormalMatrixInverse-transpose of the model matrix (upper 3x3).

◆ setPosition()

void kemena::kMesh::setPosition ( kVec3 newPosition)
virtual

Propagates a local position change to this mesh and its children.

Reimplemented from kemena::kObject.

◆ setPrimitiveType()

void kemena::kMesh::setPrimitiveType ( kString type)

Marks this mesh as one of the built-in procedural primitives ("cube", "sphere", "cylinder", "capsule", "plane"). Set by kMeshGenerator so save/load and duplicate can rebuild the geometry from the marker instead of needing a file on disk.

Parameters
typePrimitive marker name (e.g. "cube", "sphere"), or empty for non-primitive meshes.

◆ setReceiveShadow()

void kemena::kMesh::setReceiveShadow ( bool newReceiveShadow)

Controls whether the mesh receives shadows.

Parameters
newReceiveShadowtrue to apply shadow on this mesh.

◆ setRefName()

void kemena::kMesh::setRefName ( kString newRefName)

Sets the reference name used to identify shared mesh data.

Parameters
newRefNameReference identifier kString.

◆ setRotation()

void kemena::kMesh::setRotation ( kQuat newRotation)
virtual

Propagates a local rotation change to this mesh and its children.

Reimplemented from kemena::kObject.

◆ setScale()

void kemena::kMesh::setScale ( kVec3 newScale)
virtual

Propagates a local scale change to this mesh and its children.

Reimplemented from kemena::kObject.

◆ setSkinned()

void kemena::kMesh::setSkinned ( bool newSkinned)

Sets whether this mesh is driven by skeletal animation.

Parameters
newSkinnedtrue to enable skinning.

◆ setVertexBoneData()

void kemena::kMesh::setVertexBoneData ( size_t vertexID,
int boneID,
float weight )

Assigns a single bone influence to a vertex (used during loading).

Parameters
vertexIDZero-based vertex index.
boneIDIndex into the bone palette.
weightBlend weight for this bone.

◆ setVisible()

void kemena::kMesh::setVisible ( bool newVisible)

Controls the mesh's render visibility.

Parameters
newVisiblefalse to skip this mesh during rendering.

◆ setWeight()

void kemena::kMesh::setWeight ( size_t vertexIndex,
const kVec4 & weight )

Overwrites the bone-weight tuple for a specific vertex.

Parameters
vertexIndexZero-based vertex index.
weightNew blend-weight tuple.

◆ setWeights()

void kemena::kMesh::setWeights ( std::vector< kVec4 > newWeights)

Replaces the entire bone-weight buffer.

Parameters
newWeightsNew buffer.

The documentation for this class was generated from the following file: