Triangle3.h
Go to the documentation of this file.
std::array< Vector3D, 3 > points
Three points.
Definition: Triangle3.h:25
Builder & WithNormals(const std::array< Vector3D, 3 > &normals)
Returns builder with normals.
std::array< Vector3D, 3 > normals
Three normals.
Definition: Triangle3.h:31
BoundingBox3D BoundingBoxLocal() const override
Returns the bounding box of this surface object in local frame.
Triangle3Ptr MakeShared() const
Builds shared pointer of Triangle3 instance.
std::array< Vector2D, 3 > uvs
Three UV coordinates.
Definition: Triangle3.h:34
void GetBarycentricCoords(const Vector3D &pt, double *b0, double *b1, double *b2) const
Returns barycentric coordinates for the given point pt.
Structure that represents ray-surface intersection point.
Definition: Surface3.h:23
void SetNormalsToFaceNormal()
Set Triangle3::normals to the face normal.
Definition: pybind11Utils.h:24
Triangle3(const Transform3 &transform=Transform3(), bool isNormalFlipped=false)
Constructs an empty triangle.
Builder & WithUVs(const std::array< Vector2D, 3 > &uvs)
Returns builder with uvs.
Transform3 transform
Local-to-world transform.
Definition: Surface3.h:36
bool IntersectsLocal(const Ray3D &ray) const override
SurfaceRayIntersection3 ClosestIntersectionLocal(const Ray3D &ray) const override
Returns the closest intersection point for given ray in local frame.
Front-end to create Triangle3 objects step by step.
Definition: Triangle3.h:89
Builder & WithPoints(const std::array< Vector3D, 3 > &points)
Returns builder with points.
bool isNormalFlipped
Flips normal when calling Surface3::closestNormal(...).
Definition: Surface3.h:39
Vector3D ClosestPointLocal(const Vector3D &otherPoint) const override
std::shared_ptr< Triangle3 > Triangle3Ptr
Shared pointer for the Triangle3 type.
Definition: Triangle3.h:84
Vector3D ClosestNormalLocal(const Vector3D &otherPoint) const override