207 void recalc_angular_vel();
209 enum class UniCamState {
211 PAN_DOLLY_ROT_DECISION,
213 ROT_WAIT_FOR_SECOND_CLICK,
228 bool rotInitialized_;
230 float boundingSphereRad_;
231 Point3 boundingSphereCtr_;
233 std::vector<std::pair<double, double>> rotAngularVelBuffer_;
234 double rotAngularVel_;
237 bool dollyInitialized_;
A 4x4 transformation matrix stored internally as an array of floats in column-major order so as to be...
A 2D Point with floating point coordinates, used for storing 2D texture coordinates,...
A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graph...
This class provides a quick way to draw shapes for use in debugging or simple scenes.
This implements a user interface for controlling the camera with the mouse.
void OnButtonUp(const Point2 &normalizedMousePos)
Attach this to the corresponding button up event, for example, call this from within GraphicsApp::OnR...
void OnDrag(const Point2 &normalizedMousePos)
Attach this to the corresponding mouse move event, for example, call this from within GraphicsApp::On...
Point3 eye()
Returns the "eye" point (i.e., focal point) of the camera in world space coordinates.
void set_view_matrix(Matrix4 viewMatrix)
This is not required, but you may use this if you wish to set an initial view matrix or reset the vie...
UniCam()
Creates a UniCam object with an initial view matrix = identity.
void set_default_depth(float d)
This sets the depth of the center of rotation for the case when the user's click does not intersect a...
Vector3 look()
Returns the look direction (i.e., -Z axis of the camera matrix) in world space coordinates.
void OnButtonDown(const Point2 &normalizedMousePos, float mouseZ)
Attach this to whatever mouse button you wish, for example, call this from within GraphicsApp::OnRigh...
void AdvanceAnimation(double dt)
Attach this to a callback that can be used to control animation. Within GraphicsApp::UpdateSimulation...
void Draw(const Matrix4 &projectionMatrix)
Finally, attach this to your draw callback routine. Within GraphicsApp::DrawUsingOpenGL(),...
UniCam(const Matrix4 &initialViewMatrix)
Creates a UniCam object with the supplied initial view matrix.
Matrix4 view_matrix()
Access the camera view matrix created by the UniCam interactions via this method and use it to draw t...
A 3D Vector with floating point coordinates, used for storing normals and all sorts of other 3D graph...
Namespace for the MinGfx Toolkit.