#include <state.h>
Collaboration diagram for State:
Public Member Functions | |
v_set | getVertsForFullClosestPtSearch (Vertex const *const, vector3 const &, vector3 const &) |
v_set | getVertsForPartialClosestPtSearch (vector3 const &, vector3 const &) |
void | recordVertAdjFaceEdgeAngles (Vertex const *const) |
Search_Stats | updateClosestFaceToVertices (Vertex *const, v_set &, v_set &) |
void | updateAdjacentFacesInTree (Vertex const *const) |
void | updateVertexVD (Vertex *const) |
bool | extremeAngleFound (void) const |
bool | assignNewVertexCoords (Vertex *const, vector3 const *const, vector3 const &, bool &, bool &, bool &) |
bool | angleChangeIsWrong (float const &, float const &) const |
bool | vertexOutsideOctreeBounds (vector3 const *const) |
void | updateVertexNormals (v_set &fs) |
void | updateAdjacentFacesInOctree (Vertex *const v, hxa7241_graphics::Vector3r *const adjacent_face_lower, hxa7241_graphics::Vector3r *const adjacent_face_upper) |
void | updateOctree (Vertex *const v, hxa7241_graphics::Vector3r *const old_adjacent_face_lower, hxa7241_graphics::Vector3r *const old_adjacent_face_upper, hxa7241_graphics::Vector3r *const new_adjacent_face_lower, hxa7241_graphics::Vector3r *const new_adjacent_face_upper) |
float | getVD2 (void) |
void | setVD2 (float const &sqd_disp) |
Static Public Member Functions | |
static State & | instance (void) |
State & State::instance | ( | void | ) | [static] |
v_set State::getVertsForFullClosestPtSearch | ( | Vertex const * const | v, | |
vector3 const & | lower, | |||
vector3 const & | upper | |||
) |
Collect vertices whose closest point may now lie anywhere.
[in] | v | The current vertex. |
[in] | lower | Lower corner of desired search region. |
[in] | upper | Upper corner of desired search region. |
Collect vertices whose closest point may now lie on an adjacent face of current vertex.
[in] | lower | Lower corner of desired search region. |
[in] | upper | Upper corner of desired search region. |
void State::recordVertAdjFaceEdgeAngles | ( | Vertex const * const | v | ) |
Record all edge angles from adjacent faces to input vertex.
[in] | v | Vertex of interest. |
Search_Stats State::updateClosestFaceToVertices | ( | Vertex * const | v, | |
v_set & | fs, | |||
v_set & | ps | |||
) |
Search for new closest point to input vertices.
[in] | v | The current vertex. |
[in] | fs | Hashed set of vertex pointers requiring full closest point search. |
[in] | ps | Vector of vertex pointers requiring partial closest point search. |
void State::updateAdjacentFacesInTree | ( | Vertex const * const | v | ) |
Update the location of adjacent faces to moved vertex in octree.
[in] | v | Last moved vertex. |
void State::updateVertexVD | ( | Vertex * const | v | ) |
The virtual displacement of all vertices on adjacent faces of moved vertex will have changed, so update the appropriate maps.
[in] | v | The current vertex. |
bool State::extremeAngleFound | ( | void | ) | const |
Require vertex move to not worsen the condition of extreme angles.
bool State::assignNewVertexCoords | ( | Vertex * const | v, | |
vector3 const * const | new_pos, | |||
vector3 const & | old_pos, | |||
bool & | face_intersection, | |||
bool & | extreme_angle, | |||
bool & | outside_octree | |||
) |
Attempt move by input vertex.
[in] | v | Vertex to move. |
[in] | new_pos | New location of vertex after move. |
[out] | face_intersection | True if interecting faces were detected and move was aborted. |
[out] | extreme_angle | True if extreme angles (near 0 or 2*pi) were detected and move was aborted. |
[out] | outside_octree | True if vertex move breached octree boundary and move was aborted. |
bool State::angleChangeIsWrong | ( | float const & | old_angle, | |
float const & | new_angle | |||
) | const |
Determine if extreme angle improved.
[in] | old_angle | Extreme angle before the last vertex move. |
[in] | new_angle | Extreme angle after the last vertex move. |
bool State::vertexOutsideOctreeBounds | ( | vector3 const * | const | ) |
void State::updateVertexNormals | ( | v_set & | fs | ) |
Update vertex normals of vertices around moved vertex.
[in] | fs | Hashed set of vertex pointers requiring full closest point search. |
void State::updateAdjacentFacesInOctree | ( | Vertex *const | v, | |
hxa7241_graphics::Vector3r *const | adjacent_face_lower, | |||
hxa7241_graphics::Vector3r *const | adjacent_face_upper | |||
) |
Update the octree with the new position of input adjacent faces to moved vertex.
[in] | v | Moved vertex. |
[in] | adjacent_face_lower | Pointer to lower corner of pre-move bounding box of first adjacent face to moved vertex. |
[in] | adjacent_face_upper | Pointer to upper corner of pre-move bounding box of first adjacent face to moved vertex. |
void State::updateOctree | ( | Vertex *const | v, | |
hxa7241_graphics::Vector3r *const | old_adjacent_face_lower, | |||
hxa7241_graphics::Vector3r *const | old_adjacent_face_upper, | |||
hxa7241_graphics::Vector3r *const | new_adjacent_face_lower, | |||
hxa7241_graphics::Vector3r *const | new_adjacent_face_upper | |||
) |
Update the location of moved vertex adjacent faces in the octree.
[in] | v | Moved vertex. |
[in] | old_adjacent_face_lower | Pointer to lower corner of old bounding box of first adjacent face to moved vertex. |
[in] | old_adjacent_face_upper | Pointer to upper corner of old bounding box of first adjacent face to moved vertex. |
[in] | new_adjacent_face_lower | Pointer to lower corner of new bounding box of first adjacent face to moved vertex. |
[in] | new_adjacent_face_upper | Pointer to upper corner of new bounding box of first adjacent face to moved vertex. |
float State::getVD2 | ( | void | ) | [inline] |
Return stored virtual displacement squared.
void State::setVD2 | ( | float const & | sqd_disp | ) | [inline] |
Set stored virtual displacement squared.
[in] | sqd_disp | Squared virtual displacement. |