3#include "Components/Core/DynamicComponent.h"
6#include <glm/ext/scalar_constants.hpp>
7#include <glm/ext/vector_int2.hpp>
26 static void registerType();
28 void initialize(
Context* context);
87 float horizontalAngleStart = 0.f;
88 float verticalAngleStart = 0.f;
89 float distanceStart = 0.f;
91 glm::dvec3 cameraTargetStart;
93 bool prevDragWithShift =
false;
94 int32_t dragStartCoordY = 0;
97 void handleSeek(int32_t x, int32_t y);
98 void handleRotate(int32_t x0, int32_t y0, int32_t x1, int32_t y1,
bool first);
99 void handleTranslate(int32_t x0, int32_t y0, int32_t x1, int32_t y1,
bool first);
100 void handleDolly(
float delta,
bool first);
101 void handleZoom(
float delta,
bool first);
105template<>
inline Cogs::StringView getName<Cogs::Core::OrbitingCameraController>() {
return "OrbitingCameraController"; }
void setChanged()
Sets the component to the ComponentFlags::Changed state with carry.
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Base class for components implementing dynamic behavior.
Component that calculates position and orientation of the entity TransformComponent.
float horizontalAngle
Current camera angle in horizontal direction [-TwoPI,+TwoPI] (glm::roll(transformComponent->rotation)...
float minDistance
Minimal distance from camera position to camera target (zoom).
float defaultPickingRadius
Default distance an object can be from a ray to be considered hit.
float maxFOV
Maximal field of view.
float maxDistance
Maximal distance from camera position to camera target (zoom).
bool enabled
Navigation is only active when this flag is set.
float maxVerticalAngle
Maximum camera angle in vertical direction [-PI,+PI].
float minFOV
Minimal field of view.
float distance
Distance from camera target to camera.
glm::vec3 cameraLook
camera looking direction. Updated when navigating the camers.
bool seek
Deprecated Seeking flag - not used.
void attachToView(ViewContext *viewContext)
Attach to view - required for ray-picking.
glm::dvec3 cameraTarget
Camera target. Define centre of camera rotation.
bool moveCamera
Set to false to disable controller moving the camera and only apply rotate and zoom....
float minVerticalAngle
Minimum camera angle in vertical direction [-PI,+PI].
float verticalAngle
Current camera angle in vertical direction [-PI,+PI] (glm::pitch(transformComponent->rotation))
void setTarget(const glm::vec3 &target)
Set target position - deprecated. Update "cameraTarget" field instead.
Provides a weakly referenced view over the contents of a string.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....