Class Light
Represents a light source in the Genesis framework.
Inherited Members
Namespace: Genesis.Core
Assembly: Genesis.dll
Syntax
public class Light : GameElement
Constructors
Light(string, Vec3)
Creates a new instance of the Light class with the specified name and location.
Declaration
public Light(string name, Vec3 location)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the light. |
Vec3 | location | The 3D location of the light. |
Light(string, Vec3, float)
Creates a new instance of the Light class with the specified name, location and intensity.
Declaration
public Light(string name, Vec3 location, float intensity)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the light. |
Vec3 | location | The 3D location of the light. |
float | intensity | The intensity of the light. |
Properties
Intensity
Gets or sets the intensity of the light.
Declaration
public float Intensity { get; set; }
Property Value
Type | Description |
---|---|
float |
LightColor
Gets or sets the color of the light.
Declaration
public Color LightColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
Methods
GetLightColor()
Returns the light color in RGB values normalized between 0 and 1.
Declaration
public Vec3 GetLightColor()
Returns
Type | Description |
---|---|
Vec3 | A Vec3 representing the normalized RGB values of the light color. |
GetLightDirection(Camera)
Returns the direction vector from the light to the camera.
Declaration
public Vec3 GetLightDirection(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | The camera to which the direction is calculated. |
Returns
Type | Description |
---|---|
Vec3 | The normalized vector representing the light direction. |