SystemEX  Lacking
Additional generic collection types missing in .net
SystemEx.Drawing.SpotLight Class Reference

Spot light implementation. Adds inner and outer cone angles (phi/theta) expressed as cosine values. These values are used for smooth falloff inside the spotlight cone. More...

Inheritance diagram for SystemEx.Drawing.SpotLight:
Collaboration diagram for SystemEx.Drawing.SpotLight:

Public Member Functions

 SpotLight (float HalfPhi, float HalfTheta)
 SpotLight (float HalfPhi, float HalfTheta, Vec3f position, Vec3f direction, ColorR8G8B8 ambient, ColorR8G8B8 diffuse)
Public Member Functions inherited from SystemEx.Drawing.Light
 Light (Vec3f position, Vec3f direction, ColorR8G8B8 ambient, ColorR8G8B8 diffuse)
void SetProjParams (Projection projection)
 Sets the projection parameters for lights that require a frustum (typically spot lights or shadow-casting lights).

Protected Attributes

float m_cosHalfTheta
 Cosine of half the outer cone angle (theta). Defines the outer boundary of the spotlight.
float m_cosHalfPhi
 Cosine of half the inner cone angle (phi). Defines the fully illuminated inner region of the spotlight.
Protected Attributes inherited from SystemEx.Drawing.Light
Vec3f m_Position
 World-space position of the light.
Vec3f m_Direction
 Normalized world-space direction of the light. Used for directional and spot lights.
Vec3f m_Up
ColorHSV m_DiffuseColor
 Diffuse color contribution of the light. Defines the main visible light color.
ColorHSV m_AmbientColor
 Ambient color contribution of the light. Used for low-frequency indirect lighting.

Properties

float CosHalfPhi [get, set]
float CosHalfTheta [get, set]
float InnerConeAngle [get, set]
 Inner cone angle of the spotlight in degrees. Defines the fully illuminated inner region.
float OuterConeAngle [get, set]
 Outer cone angle of the spotlight in degrees. Defines the soft falloff region of the spotlight.
Properties inherited from SystemEx.Drawing.Light
ColorHSV Ambient [get, set]
ColorHSV Diffuse [get, set]
Vec3f Direction [get, set]
Vec3f Position [get, set]
Vec3f Up [get, set]
Vec3f LookAt [get]
Projection Projection [get]

Detailed Description

Spot light implementation. Adds inner and outer cone angles (phi/theta) expressed as cosine values. These values are used for smooth falloff inside the spotlight cone.

Constructor & Destructor Documentation

◆ SpotLight() [1/3]

SystemEx.Drawing.SpotLight.SpotLight ( )
138 : base() {
139 m_cosHalfPhi = 0.4f;
140 m_cosHalfTheta = 0.9f;
141 }

◆ SpotLight() [2/3]

SystemEx.Drawing.SpotLight.SpotLight ( float HalfPhi,
float HalfTheta )
142 : base() {
143 m_cosHalfPhi = HalfPhi;
144 m_cosHalfTheta = HalfTheta;
145 }

◆ SpotLight() [3/3]

SystemEx.Drawing.SpotLight.SpotLight ( float HalfPhi,
float HalfTheta,
Vec3f position,
Vec3f direction,
ColorR8G8B8 ambient,
ColorR8G8B8 diffuse )
149 : base(position, direction, ambient, diffuse) {
150 m_cosHalfPhi = HalfPhi;
151 m_cosHalfTheta = HalfTheta;
152 }

Member Data Documentation

◆ m_cosHalfPhi

float SystemEx.Drawing.SpotLight.m_cosHalfPhi
protected

Cosine of half the inner cone angle (phi). Defines the fully illuminated inner region of the spotlight.

◆ m_cosHalfTheta

float SystemEx.Drawing.SpotLight.m_cosHalfTheta
protected

Cosine of half the outer cone angle (theta). Defines the outer boundary of the spotlight.

Property Documentation

◆ CosHalfPhi

float SystemEx.Drawing.SpotLight.CosHalfPhi
getset
111{ get => m_cosHalfPhi; set => m_cosHalfPhi = value; }

◆ CosHalfTheta

float SystemEx.Drawing.SpotLight.CosHalfTheta
getset
113{ get => m_cosHalfTheta; set => m_cosHalfTheta = value; }

◆ InnerConeAngle

float SystemEx.Drawing.SpotLight.InnerConeAngle
getset

Inner cone angle of the spotlight in degrees. Defines the fully illuminated inner region.

119 {
120 get => MathF.Acos(m_cosHalfPhi) * 2.0f * (180.0f / MathF.PI);
121 set {
122 float halfAngleRad = (value * MathF.PI / 180.0f) * 0.5f;
123 m_cosHalfPhi = MathF.Cos(halfAngleRad);
124 }
125 }

◆ OuterConeAngle

float SystemEx.Drawing.SpotLight.OuterConeAngle
getset

Outer cone angle of the spotlight in degrees. Defines the soft falloff region of the spotlight.

130 {
131 get => MathF.Acos(m_cosHalfTheta) * 2.0f * (180.0f / MathF.PI);
132 set {
133 float halfAngleRad = (value * MathF.PI / 180.0f) * 0.5f;
134 m_cosHalfTheta = MathF.Cos(halfAngleRad);
135 }
136 }

The documentation for this class was generated from the following file:
  • Light.cs