SpiecsEngine
Loading...
Searching...
No Matches
◆
MouseRotate()
void Spices::CameraController::MouseRotate
(
const glm::vec2 &
delta
)
const
private
Calculate
Camera
Rotate.
Parameters
[in]
delta
Mouse
position delta on viewport during frames.
Definition at line
135
of file
CameraController.cpp
.
136
{
137
SPICES_PROFILE_ZONE
;
138
139
glm::vec3 rot =
m_CameraTranComp
->
GetRotation
();
140
const
float
yawSign =
GetUpDirection
().y < 0 ? -1.0f : 1.0f;
141
142
rot.y -= glm::degrees(yawSign * delta.x *
RotationSpeed
());
143
rot.x += glm::degrees(delta.y *
RotationSpeed
());
144
145
m_CameraTranComp
->
SetRotation
(rot);
146
}
SPICES_PROFILE_ZONE
#define SPICES_PROFILE_ZONE
Definition
TracyProfilerWrapper.h:100
Spices::CameraController::GetUpDirection
glm::vec3 GetUpDirection() const
Get Camera Up(y) Direction.
Definition
CameraController.cpp:207
Spices::CameraController::m_CameraTranComp
TransformComponent * m_CameraTranComp
The camera transform component pointer get from owner's transform component.
Definition
CameraController.h:175
Spices::CameraController::RotationSpeed
float RotationSpeed() const
Calculate Camera Rotate speed.
Definition
CameraController.cpp:173
Spices::TransformComponent::GetRotation
const glm::vec3 & GetRotation() const
Get the rotation variable.
Definition
TransformComponent.h:134
Spices::TransformComponent::SetRotation
void SetRotation(const glm::vec3 &rotation)
Set the rotation this component handled. Call CalMatrix() during this API.
Definition
TransformComponent.h:82
Spices
CameraController
Generated on Sun Mar 8 2026 10:24:48 for SpiecsEngine by
1.10.0