-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got morph targets working with obj sequences, started to create a GUI…
… for modification of uniforms at run-time. Trying to make eye normals look nicer.
- Loading branch information
Showing
228 changed files
with
4,112,012 additions
and
63,334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#ifndef EDGE_H | ||
#define EDGE_H | ||
|
||
#include <QOpenGLFunctions> | ||
|
||
struct Edge | ||
{ | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Default constructor. | ||
//----------------------------------------------------------------------------------------------------- | ||
Edge() = default; | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Default copy constructor. | ||
//----------------------------------------------------------------------------------------------------- | ||
Edge(const Edge&) = default; | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Default copy assignment operator. | ||
//----------------------------------------------------------------------------------------------------- | ||
Edge& operator=(const Edge&) = default; | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Default move constructor. | ||
//----------------------------------------------------------------------------------------------------- | ||
Edge(Edge&&) = default; | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Default move assignment operator. | ||
//----------------------------------------------------------------------------------------------------- | ||
Edge& operator=(Edge&&) = default; | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Default destructor. | ||
//----------------------------------------------------------------------------------------------------- | ||
~Edge() = default; | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Constructor that takes two vertex indices. | ||
/// @param _a is a vertex index representing one of the vertices that contributes to this edge. | ||
/// @param _b is a vertex index representing one of the vertices that contributes to this edge. | ||
//----------------------------------------------------------------------------------------------------- | ||
Edge(const GLushort _a, const GLushort _b) : | ||
p(std::min(_a, _b), std::max(_a, _b)) | ||
{} | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Used for hashing. | ||
//----------------------------------------------------------------------------------------------------- | ||
friend bool operator==(const Edge &_a, const Edge &_b) | ||
{ | ||
return _a.p == _b.p; | ||
} | ||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Internally stores a pair, which is sorted on construction. | ||
//----------------------------------------------------------------------------------------------------- | ||
std::pair<GLushort, GLushort> p; | ||
}; | ||
|
||
|
||
//----------------------------------------------------------------------------------------------------- | ||
/// @brief Define the hash struct for this Edge so we can create unordered_set's using it. | ||
//----------------------------------------------------------------------------------------------------- | ||
namespace std | ||
{ | ||
template <> | ||
struct hash<Edge> | ||
{ | ||
size_t operator()(const Edge &_key) const | ||
{ | ||
return std::hash<size_t>()(std::hash<GLushort>()(_key.p.first)) ^ std::hash<GLushort>()(_key.p.second); | ||
} | ||
}; | ||
} | ||
|
||
#endif // EDGE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.