Struct MeshHalfEdge

Inheritance Relationships

Base Type

  • public std::enable_shared_from_this< MeshHalfEdge >

Struct Documentation

struct legion::physics::MeshHalfEdge : public std::enable_shared_from_this<MeshHalfEdge>

Public Functions

inline MeshHalfEdge(const math::vec3 &pPosition, const math::vec2 &pUVs, std::weak_ptr<SplittablePolygon> pOwner)
inline MeshHalfEdge(const math::vec3 &pPosition, const math::vec2 &pUVs)
inline MeshHalfEdge(const math::vec3 &pPosition)
inline auto getTriangle()
inline auto getShadowTriangle()
inline void setPairing(std::shared_ptr<MeshHalfEdge> &newPairing)
inline void cloneOnShadowEdge()
inline bool isSplitByPlane(const math::mat4 &transform, const math::vec3 &planePosition, const math::vec3 &planeNormal)
inline math::vec3 getWorldCentroid(const math::mat4 &transform) const

Given the transform of the entity associated with this edge, returns the centroid of the edge in world space.

inline bool isEdgePartlyAbovePlane(const math::mat4 &transform, const math::vec3 &planePosition, const math::vec3 &planeNormal)

Given the transform of the entity associated with this edge and the position and normal of the cutting plane, check if one of the vertices of the is above the plane.

inline bool isEdgePartlyBelowPlane(const math::mat4 &transform, const math::vec3 &planePosition, const math::vec3 &planeNormal)

Given the transform of the entity associated with this edge and the position and normal of the cutting plane, check if one of the vertices of the is below the plane.

inline std::tuple<float, float> getEdgeDistancesFromPlane(const math::mat4 &transform, const math::vec3 &planePosition, const math::vec3 &planeNormal)

Given the transform of the entity associated with this edge and the position and normal of the cutting plane, Gets Edge Distances From Plane.

inline std::tuple<math::vec3, math::vec3> getEdgeWorldPositions(const math::mat4 &transform)

Given the transform of the entity associated with this edge, returns the 2 vertices of the edge in world space.

inline math::vec3 getEdgeWorldPosition(const math::mat4 &transform)

Given the transform of the entity associated with this edge, returns ‘position’ in world space.

inline bool attemptGetTrianglesInEdges(std::shared_ptr<MeshHalfEdge> &nextEdge, std::shared_ptr<MeshHalfEdge> &prevEdge)
inline void markTriangleEdgeVisited()
inline void populateQueueWithTriangleNeighbor(std::queue<std::shared_ptr<MeshHalfEdge>> &edgeQueue)
inline void populateVectorWithTriangle(std::vector<std::shared_ptr<MeshHalfEdge>> &edgeVector)
inline bool isTriangleValid()
inline math::vec3 calculateEdgeNormal(const math::mat4 &transform)
inline bool isNormalCloseEnough(const math::vec3 &comparisonNormal, const math::mat4 &transform)
inline void DEBUG_drawInsetEdge(const math::mat4 &transform, math::vec3 &worldCentroid, float insetInterpolant)

Public Members

math::vec3 position
math::vec2 uv
std::shared_ptr<MeshHalfEdge> nextEdge = nullptr
std::shared_ptr<MeshHalfEdge> pairingEdge = nullptr
std::shared_ptr<MeshHalfEdge> shadowEdge = nullptr
std::weak_ptr<SplittablePolygon> owner
bool isVisited = false
bool isBoundary = false

Public Static Functions

static inline void connectIntoTriangle(std::shared_ptr<MeshHalfEdge> first, std::shared_ptr<MeshHalfEdge> second, std::shared_ptr<MeshHalfEdge> third)
static inline bool compareNormals(const math::vec3 &comparisonNormal, const math::vec3 &otherNormal)