15#include "../../Utils/Math/Quaternion.h"
16#include "../../Utils/Math/Vector3D.h"
Represents a 3D triangle with support for UV mapping and ray intersection testing.
String ToString()
Converts the triangle's data to a string representation.
Triangle3D()
Default constructor.
const Vector2D * p2UV
Pointer to the UV coordinates of the second vertex.
Vector3D * p1
Pointer to the first vertex of the triangle.
Vector3D * Normal()
Calculates and returns the normal of the triangle.
Vector3D * p3
Pointer to the third vertex of the triangle.
bool hasUV
Indicates whether the triangle has UV mapping.
Vector3D normal
Normal vector of the triangle.
bool DidIntersect(Vector3D ray, Vector3D direction, Vector3D *intersect, Vector3D *color)
Tests whether a ray intersects with the triangle.
Vector3D * p2
Pointer to the second vertex of the triangle.
const Vector2D * p3UV
Pointer to the UV coordinates of the third vertex.
Vector3D edge2
Edge vector from the first to the third vertex.
Vector3D edge1
Edge vector from the first to the second vertex.
const Vector2D * p1UV
Pointer to the UV coordinates of the first vertex.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.