Class GLLine
- Namespace
- SearchAThing.OpenGL.Core
- Assembly
- netcore-opengl-core.dll
Opengl line primitive.
public class GLLine : GLPrimitiveBase, IGLLine, IGLPrimitive, IGLVertexManagerObject, INotifyPropertyChanged
- Inheritance
-
GLLine
- Implements
- Inherited Members
- Extension Methods
Constructors
GLLine()
Create an opengl line.
public GLLine()
Remarks
This entity can be added into the model through a GLLineFigure.
GLLine(Line)
Create an opengl line by given geometric line template.
public GLLine(Line line)
Parameters
line
Line
Remarks
This entity can be added into the model through a GLLineFigure.
Properties
From
Line from vertex.
public GLVertex From { get; set; }
Property Value
Remarks
Changing this property will:
- checks that the incoming value is a detached vertex ( EnsureDetached(IGLVertexManagerObject) ).
- use RemoveVertex(GLVertex)
- set the value
- use AddVertex
To
Line to vertex.
public GLVertex To { get; set; }
Property Value
Remarks
Changing this property will:
- checks that the incoming value is a detached vertex ( EnsureDetached(IGLVertexManagerObject) ).
- use RemoveVertex(GLVertex)
- set the value
- use AddVertex(GLVertex, bool)
Vertexes
Enumerate primitive gl vertexes.
public override IEnumerable<GLVertex> Vertexes { get; }
Property Value
Methods
CopySpecialized(GLPrimitiveBase)
protected override void CopySpecialized(GLPrimitiveBase other)
Parameters
other
GLPrimitiveBase
FromTo(GLVertex, GLVertex)
Create a new opengl line by two points through given two gl vertexes.
public static GLLine FromTo(GLVertex from, GLVertex to)
Parameters
Returns
FromTo(in Vector2, in Vector2, in Color?)
Create a new opengl line by two given 2d points ( assuming z=0 ) setting given optional color.
public static GLLine FromTo(in Vector2 from, in Vector2 to, in Color? color = null)
Parameters
Returns
FromTo(in Vector3, in Vector3, in Color, in Color)
Create a new opengl line by two given points setting color of two points.
public static GLLine FromTo(in Vector3 from, in Vector3 to, in Color colorFrom, in Color colorTo)
Parameters
from
Vector3From position.
to
Vector3To position.
colorFrom
ColorFrom vertex color.
colorTo
ColorTo vertex color.
Returns
FromTo(in Vector3, in Vector3, in Color?)
Create a new opengl line by two given points setting given optional color.
public static GLLine FromTo(in Vector3 from, in Vector3 to, in Color? color = null)
Parameters
Returns
Intersect(in Matrix4x4)
Compute intersection point of this gl line to the given plane.
public Vector3? Intersect(in Matrix4x4 plane)
Parameters
plane
Matrix4x4World matrix plane.
Returns
- Vector3?
Intersection point or null if no intersection found.
- See Also
MakeInstance()
protected override GLPrimitiveBase MakeInstance()
Returns
Mirror(in Matrix4x4)
Create a mirrored primitive against given xy plane.
public override GLPrimitiveBase? Mirror(in Matrix4x4 xyPlane)
Parameters
xyPlane
Matrix4x4XY mirror plane.
Returns
- GLPrimitiveBase
Mirrored primitive.
PointV(GLVertex, GLVertex)
Create a new opengl line by given from point extending of the given vector.
public static GLLine PointV(GLVertex point, GLVertex v)
Parameters
Returns
PointV(in Vector2, in Vector2, in Color?)
Create a new opengl line by given 2d point extending of the given 2d vector (assuming Z=0) settings optionally the color.
public static GLLine PointV(in Vector2 point, in Vector2 v, in Color? color = null)
Parameters
Returns
PointV(in Vector3, in Vector3, in Color, in Color)
Create a new opengl line by given point extending of the given vector with given color for the from, to vertexes.
public static GLLine PointV(in Vector3 point, in Vector3 v, in Color colorFrom, in Color colorTo)
Parameters
point
Vector3From position.
v
Vector3Extension vector.
colorFrom
ColorFrom vertex color.
colorTo
ColorTo vertex color.
Returns
PointV(in Vector3, in Vector3, in Color?)
Create a new opengl line by given point extending from there extending of the given vector setting optionally the color.
public static GLLine PointV(in Vector3 point, in Vector3 v, in Color? color = null)
Parameters
point
Vector3From position.
v
Vector3Extension vector.
color
Color?Color to apply the line ( from, to vertexes ).
Returns
SimpleCmd(bool)
Retrieve e simple cmd representation of this primtiive.
Its a textual representation of primitive information useful to regen in a separate tool.
public override string SimpleCmd(bool includeHeader = true)
Parameters
includeHeader
boolIf true header will prepended to form a complete command.
Returns
ToString()
public override string ToString()