|
| | kCamera (kObject *parentNode=nullptr, kCameraType type=kCameraType::CAMERA_TYPE_FREE) |
| | Constructs a camera and optionally attaches it to a parent.
|
| void | setCameraType (kCameraType newType) |
| | Sets the camera mode.
|
| kCameraType | getCameraType () |
| | Returns the current camera mode.
|
| void | setLookAt (kVec3 newLookAt) |
| | Sets the look-at target used when the camera is locked.
|
| kVec3 | getLookAt () |
| | Returns the look-at target.
|
| void | setFOV (float newFOV) |
| | Sets the vertical field of view.
|
| float | getFOV () |
| | Returns the vertical field of view.
|
| void | setNearClip (float newNearClip) |
| | Sets the near clipping plane distance.
|
| float | getNearClip () |
| | Returns the near clipping plane distance.
|
| void | setFarClip (float newFarClip) |
| | Sets the far clipping plane distance.
|
| float | getFarClip () |
| | Returns the far clipping plane distance.
|
| void | setAspectRatio (float newAspectRatio) |
| | Sets the viewport aspect ratio (width / height).
|
| float | getAspectRatio () |
| | Returns the viewport aspect ratio.
|
| kMat4 | calculateMVP (kMesh *mesh) |
| | Computes the combined Model-View-Projection matrix for a mesh.
|
| kMat4 | getViewMatrix () |
| | Returns the view matrix for this camera.
|
| kMat4 | getProjectionMatrix () |
| | Returns the projection matrix for this camera.
|
| void | rotateByMouse (kQuat rotation, float deltaX, float deltaY, float sensitivity=0.005f, float pitchLimit=89.0f) |
| | Applies mouse-delta rotation to a free-look camera.
|
| void | screenToRay (float mouseX, float mouseY, float viewWidth, float viewHeight, kVec3 &outOrigin, kVec3 &outDirection) |
| | Converts a viewport-relative pixel coordinate into a world-space ray.
|
| void | setPosition (kVec3 newPosition) |
| | Sets the local position and updates all dependent matrices.
|
| void | setRotation (kQuat newRotation) |
| | Sets the local rotation and updates all dependent matrices.
|
| json | serialize () |
| | Serialises the camera to JSON.
|
| void | deserialize (json data) |
| | Restores the camera state from a JSON object.
|
| kString | getSceneUuid () const |
| | UUID of the scene this camera renders (empty = auto/default).
|
| void | setSceneUuid (const kString &uuid) |
| | Sets the UUID of the scene this camera renders (empty = auto/default).
|
| | 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.
|
| virtual void | setScale (kVec3 newScale) |
| | Sets 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).
|
| virtual void | draw () |
| | Draws the object.
|
| 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.
|
Scene-graph camera node.
Supports two modes selected at construction:
CAMERA_TYPE_FREE — orientation is controlled by position + rotation.
CAMERA_TYPE_LOCKED — orientation always faces the look-at target.
View and projection matrices are computed on demand via getViewMatrix() and getProjectionMatrix().