Class DirectionalLight
Represents a directional light source in the scene, such as sunlight.
Inherited Members
Namespace: Genesis.Core
Assembly: Genesis.dll
Syntax
public class DirectionalLight : Light
Constructors
DirectionalLight(string, Vec3, float, bool)
Initializes a new instance of the DirectionalLight class.
Declaration
public DirectionalLight(string name, Vec3 location, float intensity, bool castShadows = true)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the light. |
Vec3 | location | The position of the light source. |
float | intensity | The intensity of the light. |
bool | castShadows | Indicates whether the light casts shadows. |
Methods
GetLightProjectionMatrix(PerspectiveCamera, Viewport)
Calculates the projection matrix for the directional light based on the provided camera and viewport.
Declaration
public override mat4 GetLightProjectionMatrix(PerspectiveCamera camera, Viewport viewport)
Parameters
Type | Name | Description |
---|---|---|
PerspectiveCamera | camera | The camera used to define the view frustum. |
Viewport | viewport | The viewport dimensions. |
Returns
Type | Description |
---|---|
mat4 | A 4x4 projection matrix for the light. |
Overrides
GetLightViewMatrix()
Computes the view matrix for the directional light.
Declaration
public override mat4 GetLightViewMatrix()
Returns
Type | Description |
---|---|
mat4 | A 4x4 view matrix for the light. |