Class GLVertex
- Namespace
- SearchAThing.OpenGL.Core
- Assembly
- netcore-opengl-core.dll
public class GLVertex : IGLVertex, IGLVertexManagerObject, INotifyPropertyChanged
- Inheritance
-
GLVertex
- Implements
- Inherited Members
- Extension Methods
Constructors
GLVertex()
Create a gl vertex ( default 0,0,0 ) [object].
public GLVertex()
GLVertex(in Vector3, in Color?)
Create a gl vertex with given position [object] and color.
public GLVertex(in Vector3 position, in Color? color)
Parameters
GLVertex(in Vector3, in Vector4?, in Vector3?, in Vector3?, in Vector2?)
Create a gl vertex with given position [object].
public GLVertex(in Vector3 position, in Vector4? rgbaColor = null, in Vector3? materialProperties = null, in Vector3? normal = null, in Vector2? textureST = null)
Parameters
position
Vector3Vertex position [object].
rgbaColor
Vector4?(Optional) Vertex color encoded in vector4 (range 0..1) as (red, green, blue, alpha).
Alpha=1 (full opaque).
Alpha=0 (full transparent). (Default: white).materialProperties
Vector3?(Optional) Describe the strength (0..1) of the ambient, diffuse, specular light effects. (Default: ambient:0.8, diffuse:0.6, strength:0.6).
normal
Vector3?(Optional) Vertex normal [object]. (Default: zero).
textureST
Vector2?(Optional) Vertex texture mapping in the range [0,0]...[1,1].
GLVertex(in Vector3, in Vector2)
Create a gl vertex with given position [object] and texture coord.
public GLVertex(in Vector3 position, in Vector2 textureST)
Parameters
position
Vector3Vector position [object].
textureST
Vector2Texture position in the ranage [0,0]...[1,1].
Properties
EffectiveNormal
Vertex normal [local] eventually inverted if flag InvertNormal present.
public Vector3 EffectiveNormal { get; }
Property Value
Flags
Vertex flags can used to switch some vertex feature.
By default no flags are active.
GLVertexFlag
[JsonProperty]
public GLVertexFlag Flags { get; set; }
Property Value
Index
GLVertexManager vertex index associated to this gl vertex or null if not yet registered to.
public uint? Index { get; }
Property Value
- uint?
InvertNormal
Invert the normal flag ( used by Mirror(in Matrix4x4).
public bool InvertNormal { get; set; }
Property Value
- See Also
IsAttached
States if this vertex is already registed to a vertex manager.
public bool IsAttached { get; }
Property Value
MaterialColor
Color encoded in vector4 (range 0..1) as (red, green, blue, alpha).
Alpha=1 (full opaque).
Alpha=0 (full transparent).
public Vector4 MaterialColor { get; set; }
Property Value
MaterialProperties
Describe the strength (0..1) of the ambient, diffuse, specular light effects.
public Vector3 MaterialProperties { get; set; }
Property Value
Normal
Vertex normal [local].
public Vector3 Normal { get; set; }
Property Value
ParentFigure
Figure referencing this vertex in one of their primitive's components.
Its null if related figure not yet added to the vertex manager.
public IGLFigure? ParentFigure { get; }
Property Value
ParentPrimitive
Primitive referencing this vertex in one of their components.
Its null if related figure not yet added to the vertex manager.
public IGLPrimitive? ParentPrimitive { get; }
Property Value
ParentVertexManager
Vertex manager which this object is registered to.
Before the object is added to the GLModel,
therefore to the GLVertexManager,
or after the object is removed from, this pointer is null.
public GLVertexManager? ParentVertexManager { get; }
Property Value
Position
Vertex position [local].
public Vector3 Position { get; set; }
Property Value
ScreenCoordMode
Evaluated through parent IGLFigure it states if this vertex has to be processed in the gl shader pipeline within UNINAME_uFigureScreenCoord uniform flag.
public bool ScreenCoordMode { get; }
Property Value
- See Also
Signature
String signature of this vertex, used by GLVertexManager to keep a unique vertex array of GLVertexStruct.
public string Signature { get; }
Property Value
TextureST
Vertex texture offset ( range [0,0] to [1,1] ).
public Vector2 TextureST { get; set; }
Property Value
Methods
Copy()
Create a copy of this gl vertex manager object copying all relevant data except the ParentVertexManager that will default to null for copies object until added to a vertex manager.
public IGLVertexManagerObject Copy()
Returns
Mirror(in Matrix4x4)
Mirror this vertex to the other side of given xy plane.
public GLVertex? Mirror(in Matrix4x4 refXYPlane)
Parameters
refXYPlane
Matrix4x4Reference xy plane.
Returns
- GLVertex
Copy of this vertex, mirrored.
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
ToString()
public override string ToString()
Returns
ToStruct()
Create a struct representation of this vertex.
Some information used only by framework itself not pertinent to those used by the shader, such as Index
are omitted.
public GLVertexStruct ToStruct()
Returns
- See Also
Events
PropertyChanged
public event PropertyChangedEventHandler? PropertyChanged