Creates a new Camera behavior.
Field of view in radians.
Aspect ratio (width / height).
Near clipping plane.
Far clipping plane.
Protected
transformReturns the world position of the camera.
Returns the world rotation of the camera.
Detach this behavior from the GameObject it is attached to.
The GameObject to detach this behavior from.
Returns the Model-View-Projection (MVP) matrix for the given model matrix.
The model matrix of the object.
The MVP matrix as a mat4.
Protected
observeProtected
Observe a LogicBehavior and call the observer function when the data changes.
Protected
onProtected
onConverts a 2D mouse screen position to a 3D world space direction (ray). This function assumes that the screen position corresponds to the mouse position on a 2D screen. It unprojects the mouse position into a direction in 3D space using the camera's view and projection matrices.
The 2D screen position of the mouse.
The normalized direction vector of the ray in world space.
Like onEnable, but should only be for internal use, so some non-abstact direct behaviors could expose attachedOn to the user.
The GameObject this behavior is attached to.
Protected
tickProtected
Called every frame. Override this method to add custom behavior.
The time in seconds since the last frame.
A 3D camera class that manages projection, view transformations, and screen-to-world raycasting for a rendering engine.