14#include <glm/gtc/matrix_transform.hpp>
15#include <glm/gtc/type_ptr.hpp>
141 void rotateByMouse(
kQuat rotation,
float deltaX,
float deltaY,
float sensitivity = 0.005f,
float pitchLimit = 89.0f);
163 float viewWidth,
float viewHeight,
193 float nearClip = 0.1f;
194 float farClip = 100.0f;
195 float aspectRatio = 1.0f;
kVec3 getLookAt()
Returns the look-at target.
kString getSceneUuid() const
UUID of the scene this camera renders (empty = auto/default).
Definition kcamera.h:184
float getNearClip()
Returns the near clipping plane distance.
kMat4 calculateMVP(kMesh *mesh)
Computes the combined Model-View-Projection matrix for a mesh.
void setRotation(kQuat newRotation)
Sets the local rotation and updates all dependent matrices.
float getAspectRatio()
Returns the viewport aspect ratio.
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 setPosition(kVec3 newPosition)
Sets the local position and updates all dependent matrices.
void setSceneUuid(const kString &uuid)
Sets the UUID of the scene this camera renders (empty = auto/default).
Definition kcamera.h:186
void setNearClip(float newNearClip)
Sets the near clipping plane distance.
float getFarClip()
Returns the far clipping plane distance.
kMat4 getViewMatrix()
Returns the view matrix for this camera.
void setAspectRatio(float newAspectRatio)
Sets the viewport aspect ratio (width / height).
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.
kCamera(kObject *parentNode=nullptr, kCameraType type=kCameraType::CAMERA_TYPE_FREE)
Constructs a camera and optionally attaches it to a parent.
kMat4 getProjectionMatrix()
Returns the projection matrix for this camera.
float getFOV()
Returns the vertical field of view.
void setFOV(float newFOV)
Sets the vertical field of view.
void setLookAt(kVec3 newLookAt)
Sets the look-at target used when the camera is locked.
json serialize()
Serialises the camera to JSON.
void deserialize(json data)
Restores the camera state from a JSON object.
kCameraType getCameraType()
Returns the current camera mode.
void setCameraType(kCameraType newType)
Sets the camera mode.
void setFarClip(float newFarClip)
Sets the far clipping plane distance.
Scene-graph node that holds renderable geometry.
Definition kmesh.h:35
kObject(kObject *parentNode=nullptr)
Constructs a kObject and optionally attaches it to a parent.
Core type aliases, enumerations, structs, and utility functions used throughout the engine.
Polygonal mesh node with skeletal animation support.
nlohmann::json json
Definition kobject.h:30
Top-level Kemena3D engine namespace.
Definition kanimation.h:23
kCameraType
Camera behaviour mode.
Definition kdatatype.h:97
@ CAMERA_TYPE_FREE
Free-fly; position and orientation are set independently.
Definition kdatatype.h:98
std::string kString
Standard string alias.
Definition kdatatype.h:42
glm::quat kQuat
Unit quaternion.
Definition kdatatype.h:40
glm::vec3 kVec3
3-component float vector.
Definition kdatatype.h:33
glm::mat4 kMat4
4x4 float matrix.
Definition kdatatype.h:39