Table of Contents

Class GLPointLight

Namespace
SearchAThing.OpenGL.Core
Assembly
netcore-opengl-core.dll

Gl point light.

[JsonObject(MemberSerialization.OptIn)]
public class GLPointLight : INotifyPropertyChanged
Inheritance
GLPointLight
Implements
Inherited Members

Constructors

GLPointLight(Vector3?, Color?, bool)

Create a gl point light at given coordinates [local].

public GLPointLight(Vector3? pos = null, Color? color = null, bool showPoint = false)

Parameters

pos Vector3?

Light coordinate [local].

color Color?

Light color (ambient, diffuse, specular).

showPoint bool

If true a gl point will displayed where light is.

GLPointLight(float, float, float, in Color?, bool)

Create a gl point light at given coordinates [local].

public GLPointLight(float x, float y, float z, in Color? color = null, bool showPoint = false)

Parameters

x float

X coordinate [local].

y float

Y coordinate [local].

z float

Z coordinate [local].

color Color?

Light color (ambient, diffuse, specular).

showPoint bool

If true a gl point will displayed where light is.

Properties

Active

If false light don't drop any shadow nor affects vertex colours.

[JsonProperty]
public bool Active { get; set; }

Property Value

bool

Ambient

Ambient light color (Default:White).

[JsonProperty]
public Color Ambient { get; set; }

Property Value

Color

Constant

Light attenuation constant factor.

[JsonProperty]
public float Constant { get; set; }

Property Value

float

Diffuse

Diffuse light color (Default:white).

[JsonProperty]
public Color Diffuse { get; set; }

Property Value

Color

Linear

Light attenuation linear factor.

[JsonProperty]
public float Linear { get; set; }

Property Value

float

Position

Position [local].

[JsonProperty]
public Vector3 Position { get; set; }

Property Value

Vector3

Quadratic

Light attenuation quadratica factor.

[JsonProperty]
public float Quadratic { get; set; }

Property Value

float

ShowPoint

If true a Gl point will be shown where the light is positioned.
Colored yellow if light is active, darkgray if inactive.

[JsonProperty]
public bool ShowPoint { get; set; }

Property Value

bool

Specular

Specular light color (Default:white).

[JsonProperty]
public Color Specular { get; set; }

Property Value

Color

Methods

OnPropertyChanged(string?)

invoke this method to forward propertchanged event notification. note: not needed to specify propertyName set by compiler service to called property.

protected void OnPropertyChanged(string? propertyName = null)

Parameters

propertyName string

SetupAttenuation(GLModel, float?, float?, float?)

Setup light attenuation factor based on model bbox size.

public void SetupAttenuation(GLModel model, float? adjustConstant = 1, float? adjustLinear = 0, float? adjustQuadratic = 0)

Parameters

model GLModel

Gl model.

adjustConstant float?

Light constant attenuation factor.

adjustLinear float?

Light linear attenuation factor.

adjustQuadratic float?

Light quadratic attenuation factor.

Events

PropertyChanged

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler