|
| | 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< kVec3 > | getVertices () |
| | Returns a copy of the vertex position buffer.
|
| void | addUV (kVec2 uv) |
| | Appends a UV coordinate.
|
| std::vector< kVec2 > | getUVs () |
| | Returns a copy of the UV coordinate buffer.
|
| void | addVertexColor (kVec3 color) |
| | Appends a per-vertex colour.
|
| std::vector< kVec3 > | getVertexColors () |
| | Returns a copy of the per-vertex colour buffer.
|
| void | addNormal (kVec3 normal) |
| | Appends a vertex normal.
|
| std::vector< kVec3 > | getNormals () |
| | Returns a copy of the normal buffer.
|
| void | addTangent (kVec3 tangent) |
| | Appends a vertex tangent.
|
| std::vector< kVec3 > | getTangents () |
| | Returns a copy of the tangent buffer.
|
| void | addBitangent (kVec3 bitangent) |
| | Appends a vertex bitangent.
|
| std::vector< kVec3 > | getBitangents () |
| | 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< kIvec4 > | getBoneIDs () |
| | 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< kVec4 > | getWeights () |
| | 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.
|
| kAnimator * | getAnimator () |
| | 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.
|
| | kObject (kObject *parentNode=nullptr) |
| | Constructs a kObject and optionally attaches it to a parent.
|
| virtual | ~kObject () |
| | Destroys the object.
|
| kObject * | getParent () |
| | 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.
|
| kPhysicsObjectDesc & | getPhysicsDesc () |
| | 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.
|
| kCharacterControllerDesc & | getCharacterDesc () |
| | 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.
|
| kNavMeshDesc & | getNavMeshDesc () |
| | 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.
|
| kMaterial * | getMaterial () |
| | 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.
|
| kPhysicsObject * | getPhysicsObject () |
| | 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.
|
| kCharacterController * | getCharacterController () |
| | 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.
|