Class PerspectiveCamera
Represents a perspective camera derived from the Camera class.
Inherited Members
Namespace: Genesis.Graphics
Assembly: Genesis.dll
Syntax
public class PerspectiveCamera : Camera
Constructors
PerspectiveCamera(Vec3, Vec3, float, float)
Constructor for the PerspectiveCamera class.
Declaration
public PerspectiveCamera(Vec3 location, Vec3 size, float near, float far)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | location | The position of the camera. |
Vec3 | size | The size of the camera. |
float | near | The near clipping plane of the camera. |
float | far | The far clipping plane of the camera. |
Methods
CameraFront()
Gets the front direction vector of the camera.
Declaration
public Vec3 CameraFront()
Returns
Type | Description |
---|---|
Vec3 | The front direction vector of the camera. |
CameraRight()
Declaration
public Vec3 CameraRight()
Returns
Type | Description |
---|---|
Vec3 |
CameraUp()
Declaration
public Vec3 CameraUp()
Returns
Type | Description |
---|---|
Vec3 |
Forward(float)
Calculates a point in front of the camera at a specified distance.
Declaration
public Vec3 Forward(float distance)
Parameters
Type | Name | Description |
---|---|---|
float | distance | The distance from the camera. |
Returns
Type | Description |
---|---|
Vec3 | The calculated point in front of the camera. |
GetFrustum(Viewport)
ToDo: Change FOV
Declaration
public Frustum GetFrustum(Viewport viewport)
Parameters
Type | Name | Description |
---|---|---|
Viewport | viewport |
Returns
Type | Description |
---|---|
Frustum |
GetProjectionMatrix(Camera)
Declaration
public static mat4 GetProjectionMatrix(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera |
Returns
Type | Description |
---|---|
mat4 |
GetViewMatrix(Camera)
Declaration
public static mat4 GetViewMatrix(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera |
Returns
Type | Description |
---|---|
mat4 |
LookAt(Vec3)
Adjusts the camera's orientation to look at a specified position.
Declaration
public void LookAt(Vec3 vec3)
Parameters
Type | Name | Description |
---|---|---|
Vec3 | vec3 | The position to look at. |
MoveBackward(float)
Moves the camera backward by a specified value.
Declaration
public void MoveBackward(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The distance to move the camera backward. |
MoveDown(float)
Moves the camera down by a specified value.
Declaration
public void MoveDown(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The distance to move the camera down. |
MoveForward(float)
Moves the camera forward by a specified value.
Declaration
public void MoveForward(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The distance to move the camera forward. |
MoveLeft(float)
Moves the camera left by a specified value.
Declaration
public void MoveLeft(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The distance to move the camera left. |
MoveRight(float)
Moves the camera right by a specified value.
Declaration
public void MoveRight(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The distance to move the camera right. |
MoveUp(float)
Moves the camera up by a specified value.
Declaration
public void MoveUp(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The distance to move the camera up. |
RenderToTexture(Game, IRenderDevice, Texture, Vec3)
Renders the scene to a texture using a specified render target and resolution.
Declaration
public void RenderToTexture(Game game, IRenderDevice renderer, Texture renderTarget, Vec3 resolution)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The Game instance. |
IRenderDevice | renderer | The render device. |
Texture | renderTarget | The render target texture. |
Vec3 | resolution | The resolution of the rendered texture. |
RenderToTexture(Game, IRenderDevice, int, Vec3)
Renders the scene to a texture using a specified render target ID and resolution.
Declaration
public void RenderToTexture(Game game, IRenderDevice renderer, int renderTarget, Vec3 resolution)
Parameters
Type | Name | Description |
---|---|---|
Game | game | The Game instance. |
IRenderDevice | renderer | The render device. |
int | renderTarget | The ID of the render target. |
Vec3 | resolution | The resolution of the rendered texture. |