Protected_Protected_Protected_A flag indicating if the entity is active and should be updated. *
The aspect ratio of the viewport.
ProtectedbehavioursA collection of behaviours attached to the entity. * *
The type of projection this camera uses.
ProtecteddestroyedA flag indicating if the entity has been destroyed. * *
The type of the entity (e.g., STATIC, DYNAMIC). *
The distance to the far clipping plane.
The camera's field of view in DEGREES.
The distance to the near clipping plane.
The size of the orthographic projection (half the vertical size of the viewing volume).
The scene to which this entity belongs. *
A flag indicating if the entity should be rendered. *
The tag for the camera entity.
The transform component of the entity. *
A flag to determine if the entity should update in the editor. *
Gets the projection matrix.
Gets the view matrix.
StaticclassStaticmainGets the main camera instance.
Adds a new behaviour to the entity. *
The behaviour to add. *
Creates a deep copy of the current SceneEntity instance. *
ProtecteddeserializeDestroys the entity, cleaning up all attached behaviours. *
Draws the entity. *
Deserializes the camera's state from a JSON object.
The JSON object to deserialize from.
ProtectedgetRetrieves the first behaviour of a specific type from the collection. *
The constructor function of the type to filter by. *
Retrieves all behaviours of a specific type from the collection. *
The constructor function of the type to filter by. *
Initializes the camera, updating its matrices.
Removes a behaviour from the entity. *
The behaviour to remove. *
Unprojects a 2D screen coordinate to a specific 3D world position at a given distance from the camera. This is useful for placing objects directly in front of the camera based on mouse input.
The 2D screen position in pixels (e.g., from mouse input).
The distance from the camera along the ray.
The width of the viewport in pixels.
The height of the viewport in pixels.
The 3D world position.
Unprojects a 2D screen coordinate into a 3D ray in world space. This is useful for picking objects with the mouse.
The 2D screen position in pixels (e.g., from mouse input).
The width of the viewport in pixels.
The height of the viewport in pixels.
An object containing the ray's origin and direction vectors.
ProtectedserializeSerializes the camera's state to a JSON object.
Updates the camera each frame.
The elapsed time since the last update.
Updates the camera's projection matrix based on its current fieldOfView, aspectRatio, nearPlane, and farPlane. This should be called whenever the viewport dimensions change.
Converts a 3D world position to a 4D clip-space position. This is the final step before the hardware performs the perspective divide and rasterization.
The 3D world position vector to convert.
The 4D clip-space position vector.
Converts a world position to a 2D screen coordinate.
The world position vector to convert.
The width of the viewport in pixels.
The height of the viewport in pixels.
The 2D screen position in pixels.
StaticinstanciateStaticsetSets the main camera instance for static access.
The camera to set as the main camera.
Represents a camera in the 3D scene, responsible for generating the view and projection matrices.