![]() |
Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
|
Class representing the Director. More...
#include <director.h>
Public Member Functions | |
BlamDirector () | |
Initializes the camera. More... | |
~BlamDirector () | |
Destroys the camera. More... | |
void | OnNewFrameEvent (NewFrameEvent *event) |
Called when the listener is subscribed to New Frame events, and a new NewFrameEvent is fired. More... | |
void | OnTickEvent (TickEvent *event) |
Called when the listener is subscribed to Key Press events, and a new TickEvent is fired. More... | |
void | OnMouseMoveEvent (MouseMoveEvent *event) |
Called when the listener is subscribed to Mouse Move events, and a new MouseMoveEvent is fired. More... | |
void | OnMouseClickEvent (MouseClickEvent *event) |
Called when the listener is subscribed to Mouse Click events, and a new MouseClickEvent is fired. More... | |
void | OnKeyPressEvent (KeyPressEvent *event) |
Called when the listener is subscribed to Key Press events, and a new KeyPressEvent is fired. More... | |
void | MoveCamera (BlamDirection direction, float acceleration) |
Moves the camera one "step" in the given direction. More... | |
void | ValidateCameraCoords () |
If auto_verify_coords is set to true , this will verify all camera coordinates. More... | |
void | SetCameraSpeed (float _speed) |
Sets the camera's speed, while also sending a log message indicating that the speed has been changed. More... | |
Public Attributes | |
BlamVector3 | camera_pos = BlamVector3() |
The current position of the camera. More... | |
BlamVector3 | camera_angle = BlamVector3() |
The current looking angle of the camera. X is yaw, Y is pitch, Z is roll (unused atm). More... | |
bool | auto_verify_coords = true |
Whether or not camera_front and camera_right should be automatically calculated. More... | |
BlamVector3 | camera_front = BlamVector3() |
The calculated point representing the front of the camera. More... | |
BlamVector3 | camera_right = BlamVector3() |
The calculated point representing the right of the camera. More... | |
float | fov = 70.0f |
The camera's current field of view. More... | |
float | fov_normal = 70.0f |
The camera's default field of view. More... | |
float | fov_zoomed = 20.0f |
The camera's field of view while zoomed in. More... | |
float | speed = 1.0f |
The camera's current speed. More... | |
float | look_sensetivity = 0.25f |
The camera's look sensetivity. More... | |
float | zoom_increment_count = 30 |
The number of steps/increments to use when zooming in and out. Lower numbers will cause the camera to zoom faster. More... | |
bool | lock_camera = false |
Whether or not the camera is locked. If locked, all keyboard/mouse input is ignored. More... | |
bool | pancam = true |
Whether or not the camera is currently in pan-cam mode. Pan-cam locks Z movement of the camera when not moving up/down. More... | |
bool | pancam_lock_xy = false |
Whether or not the camera should be locked to X/Y axis when in pan-cam mode. More... | |
bool | move_acceleration = true |
Whether or not camera movements should use acceleration. More... | |
bool | look_acceleration = false |
Whether or not camera looking should use acceleration. More... | |
float | accel_increment_count = 30 |
The number of steps/increments to use when accelerating and decelerating. Lower numbers will cause the camera to accelerate faster. More... | |
bool | camera_bouncing = false |
Whether or not the camera should have a bounce/rubber effect when moving and looking around. More... | |
bool | zoomed = false |
Whether or not the camera is currently zoomed in. More... | |
bool | calculate_angle = true |
float | horizontal_angle = 0.0f |
float | vertical_angle = 0.0f |
float | near_clip_plane_distance = 0.1f |
float | far_clip_plane_distance = 100.0f |
Class representing the Director.
The Director is the default flying camera the engine uses. In normal gameplay, the camera would be disabled and instead camera behavior would be defined by a camera_track tag instead.
BlamDirector::BlamDirector | ( | ) |
Initializes the camera.
BlamDirector::~BlamDirector | ( | ) |
Destroys the camera.
void BlamDirector::MoveCamera | ( | BlamDirection | direction, |
float | acceleration | ||
) |
Moves the camera one "step" in the given direction.
The way the camera moves depends on whether pan-cam is enabled, as well as whether X/Y axis locking is enabled. If pan-cam is disabled, all movements are relative to where the camera is looking. If pan-cam is enabled, the Z axis is locked when not explicitly moving Up and Down. If the X/Y axis lock is enabled, then the camera will move along the axis that is being most looked at (while still ignoring Z axis except for up/down movement).
direction | - The direction to move the camera. |
accel_direction | - The direction to pull acceleration values from. This should usually be the same as direction . |
acceleration | - The level of acceleration to use when moving the camera. |
|
virtual |
Called when the listener is subscribed to Key Press events, and a new KeyPressEvent is fired.
event | - The event that was fired. |
Reimplemented from BlamEventListener.
|
virtual |
Called when the listener is subscribed to Mouse Click events, and a new MouseClickEvent is fired.
event | - The event that was fired. |
Reimplemented from BlamEventListener.
|
virtual |
Called when the listener is subscribed to Mouse Move events, and a new MouseMoveEvent is fired.
event | - The event that was fired. |
Reimplemented from BlamEventListener.
|
virtual |
Called when the listener is subscribed to New Frame events, and a new NewFrameEvent is fired.
event | - The event that was fired. |
Reimplemented from BlamEventListener.
|
virtual |
Called when the listener is subscribed to Key Press events, and a new TickEvent is fired.
event | - The event that was fired. |
Reimplemented from BlamEventListener.
void BlamDirector::SetCameraSpeed | ( | float | _speed | ) |
Sets the camera's speed, while also sending a log message indicating that the speed has been changed.
_speed | - The new camera speed. |
void BlamDirector::ValidateCameraCoords | ( | ) |
If auto_verify_coords
is set to true
, this will verify all camera coordinates.
It will ensure that yaw bounds are clamped from 0 to 360, that pitch is clamped from -90 to 90 (full 180 degrees up/down), and will use those values to calculate the appropriate vectors used to change where the camera is actually looking (camera_front
, camera_right
).
float BlamDirector::accel_increment_count = 30 |
The number of steps/increments to use when accelerating and decelerating. Lower numbers will cause the camera to accelerate faster.
bool BlamDirector::auto_verify_coords = true |
Whether or not camera_front
and camera_right
should be automatically calculated.
bool BlamDirector::calculate_angle = true |
BlamVector3 BlamDirector::camera_angle = BlamVector3() |
The current looking angle of the camera. X is yaw, Y is pitch, Z is roll (unused atm).
bool BlamDirector::camera_bouncing = false |
Whether or not the camera should have a bounce/rubber effect when moving and looking around.
BlamVector3 BlamDirector::camera_front = BlamVector3() |
The calculated point representing the front of the camera.
BlamVector3 BlamDirector::camera_pos = BlamVector3() |
The current position of the camera.
BlamVector3 BlamDirector::camera_right = BlamVector3() |
The calculated point representing the right of the camera.
float BlamDirector::far_clip_plane_distance = 100.0f |
float BlamDirector::fov = 70.0f |
The camera's current field of view.
float BlamDirector::fov_normal = 70.0f |
The camera's default field of view.
float BlamDirector::fov_zoomed = 20.0f |
The camera's field of view while zoomed in.
float BlamDirector::horizontal_angle = 0.0f |
bool BlamDirector::lock_camera = false |
Whether or not the camera is locked. If locked, all keyboard/mouse input is ignored.
bool BlamDirector::look_acceleration = false |
Whether or not camera looking should use acceleration.
float BlamDirector::look_sensetivity = 0.25f |
The camera's look sensetivity.
bool BlamDirector::move_acceleration = true |
Whether or not camera movements should use acceleration.
float BlamDirector::near_clip_plane_distance = 0.1f |
bool BlamDirector::pancam = true |
Whether or not the camera is currently in pan-cam mode. Pan-cam locks Z movement of the camera when not moving up/down.
bool BlamDirector::pancam_lock_xy = false |
Whether or not the camera should be locked to X/Y axis when in pan-cam mode.
float BlamDirector::speed = 1.0f |
The camera's current speed.
float BlamDirector::vertical_angle = 0.0f |
float BlamDirector::zoom_increment_count = 30 |
The number of steps/increments to use when zooming in and out. Lower numbers will cause the camera to zoom faster.
bool BlamDirector::zoomed = false |
Whether or not the camera is currently zoomed in.