Camera

* Represents the view of the observer. * Everything that is rendered to the screen is processed within the projection matrix and view matrix of a camera. * Inheriths Entity class and encapsulates NodeBody macro. * It has a custom constructor that calls: updateCameraVectors and adds default CameraPreset.

Constructors

this
this(string id)

Default camera constructor.

Members

Functions

processKeyboard
typeof(this) processKeyboard(CameraMovement direction)

* Set keyboard listener using a camera movement direction. * Works only if camera keyboard listener isn't locked. * Returns reference to this so it can be used in a stream.

processMouseMovement
typeof(this) processMouseMovement(float xOffset, float yOffset)

* Set mouse move listener using x and y offsets. * Works only if camera mouse move listener isn't locked. * If it works then it updates camera vectors at the end. * Returns reference to this so it can be used in a stream.

processMouseScroll
typeof(this) processMouseScroll(float yOffset)

* Set mouse scroll listener using y offset. * Works only if camera mouse scroll listener isn't locked. * Returns reference to this so it can be used in a stream.

projectionMatrix
Matrix4F projectionMatrix()

* Returns camera projection matrix.

viewMatrix
Matrix4F viewMatrix()

* Returns camera view matrix.

Mixins

__anonymous
mixin NodeBody
Undocumented in source.

Properties

pitch
float pitch [@property getter]

Get camera pitch.

pitch
float pitch [@property setter]

Set camera pitch.

yaw
float yaw [@property getter]

Get camera yaw.

yaw
float yaw [@property setter]

Set camera yaw.

zFar
float zFar [@property getter]

Get camera zFar.

zFar
float zFar [@property setter]

Set camera zFar.

zNear
float zNear [@property getter]

Get camera zNear.

zNear
float zNear [@property setter]

Set camera zNear.

Variables

constrainPitch
bool constrainPitch;
fieldOfView
float fieldOfView;
frontVector
Vector3F frontVector;
keyboardLocked
bool keyboardLocked;
mouseMoveLocked
bool mouseMoveLocked;
mouseScrollLocked
bool mouseScrollLocked;
mouseSensitivity
float mouseSensitivity;
movementSpeed
float movementSpeed;
preset
CameraPreset preset;
rightVector
Vector3F rightVector;
upVector
Vector3F upVector;
worldUpVector
Vector3F worldUpVector;

Mixed In Members

From mixin NodeBody

this
this(string id)
Undocumented in source.

Inherited Members

From Entity

transform
Transform transform;
id
string id;
scene
Scene scene;
visibility
Visibility visibility;
model
Model model;
addComponent
typeof(this) addComponent(T component)
removeComponent
typeof(this) removeComponent(ComponentType type)
component
T component()
start
void start()

Called after all scene entitys instantiation. It is optional.

update
void update()

Called every frame to update the current state of the scene entity. It is optional.

Meta