Class PointLight
Represents a point light source in the scene, which emits light in all directions from a specific position.
Inherited Members
Namespace: Genesis.Core
Assembly: Genesis.dll
Syntax
public class PointLight : Light
Constructors
PointLight(string, Vec3, float, bool)
Initializes a new instance of the PointLight class.
Declaration
public PointLight(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. |
Properties
ShadowRange
Gets or sets the range of the shadow for the point light.
Declaration
public float ShadowRange { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
GetLightProjectionMatrix(PerspectiveCamera, Viewport)
Calculates the projection matrix for the point light based on its shadow range.
Declaration
public override mat4 GetLightProjectionMatrix(PerspectiveCamera camera, Viewport viewport)
Parameters
Type | Name | Description |
---|---|---|
PerspectiveCamera | camera | The camera used for the scene (not directly utilized here). |
Viewport | viewport | The viewport dimensions (not directly utilized here). |
Returns
Type | Description |
---|---|
mat4 | A 4x4 orthographic projection matrix for the light. |
Overrides
GetLightViewMatrix()
Computes the view matrix for the point light.
Declaration
public override mat4 GetLightViewMatrix()
Returns
Type | Description |
---|---|
mat4 | A 4x4 view matrix for the light. |