Struct Triangle
Represents a three-dimensional triangle.
Assembly: FlaxEngine.dll
File: Engine/Core/Math/Triangle.h
Syntax
public struct Triangle
Constructors
Triangle()
Empty constructor.
Declaration
public Triangle() = default
Triangle(const Vector3& v0, const Vector3& v1, const Vector3& v2)
Initializes a new instance of the Triangle struct.
Declaration
public Triangle(const Vector3& v0, const Vector3& v1, const Vector3& v2)
Parameters
Vector3
v0
The first vertex. |
Vector3
v1
The second vertex . |
Vector3
v2
The third vertex. |
Fields
V0
The first vertex.
Declaration
public Vector3 V0
Field Value
Vector3
|
V1
The second vertex.
Declaration
public Vector3 V1
Field Value
Vector3
|
V2
The third vertex.
Declaration
public Vector3 V2
Field Value
Vector3
|
Methods
GetNormal()
Declaration
public Vector3 GetNormal() const
Returns
Vector3
|
Intersects(const Ray& ray)
Intersects(const Ray& ray, Real& distance)
Determines if there is an intersection between triangle and a ray. Returns distance to the intersection.
Declaration
public bool Intersects(const Ray& ray, Real& distance) const
Parameters
Ray
ray
|
Real
distance
|
Returns
bool
|
Intersects(const Ray& ray, Real& distance, Vector3& normal)
Declaration
public bool Intersects(const Ray& ray, Real& distance, Vector3& normal) const
Parameters
Ray
ray
|
Real
distance
|
Vector3
normal
|
Returns
bool
|
Intersects(const Ray& ray, Vector3& point)
Declaration
public bool Intersects(const Ray& ray, Vector3& point) const
Parameters
Ray
ray
|
Vector3
point
|
Returns
bool
|