|
Rehti MMORPG
1.0.0
Rehti MMORPG is a free and open source MMORPG game.
|
#include <iostream>#include "../../Config.hpp"#include "Assimp.hpp"#include "ObjectReader.hpp"#include "TextureReader.hpp"#include "Utils.hpp"#include <algorithm>#include <queue>
Functions | |
| float | interpolatedTimeFactor (const double now, const double prevTimeFrame, const double frameDiff, const double totalTime) |
| bool | equalD (const double a, const double b) |
| bool | equalF (const float a, const float b) |
| glm::vec3 | interpolateLinear (const glm::vec3 &start, const glm::vec3 &end, float timeFactor) |
| glm::quat | interpolateLinear (const glm::quat &start, const glm::quat &end, float timeFactor) |
| glm::vec3 | interpolateAIVectorkeys (const aiVectorKey ¤t, const aiVectorKey &prev, const double now, const double totalTicks) |
| glm::quat | interpolateAIQuatkeys (const aiQuatKey ¤t, const aiQuatKey &prev, const double now, double totalTicks) |
| bool | containsSubString (const std::string &str, const std::string &subStr) |
| bool | loadOBJFile (const std::string &path, std::vector< Vertex > &vertices, std::vector< uint32_t > &faces, const float scalingFactor) |
| Loads the object from the given path. More... | |
| bool | loadOBJTile (std::vector< Vertex > &vertices, std::vector< uint32_t > &faces) |
| Loads a double sided tile object. More... | |
| bool | loadGlTFFile (const std::string &path, std::vector< CharacterVertex > &vertices, std::vector< uint32_t > &indices, std::array< Animation, ANIMATION_TYPE_COUNT > &animations, std::vector< BoneNode > &bones, std::vector< glm::mat4 > &transformations) |
| Loads the object from the given path. More... | |
| size_t | loadAnimations (const aiScene *scene, std::map< std::string, uint32_t > nameToIndex, std::array< Animation, ANIMATION_TYPE_COUNT > &animations) |
| Loads animations from the given scene. More... | |
| size_t | fillSkeleton (aiNode *rootNode, std::vector< BoneNode > &boneList, std::vector< glm::mat4 > &transformations, std::map< std::string, uint32_t > &nameToIndex) |
| Fills the given vectors with hierarchy and bone data. More... | |
| glm::mat4 | aiMatrix4x4ToGlm (const aiMatrix4x4 &matrix) |
| Convert aiMatrix4x4 to glm::mat4. More... | |
| glm::quat | aiQuaternionToGlm (const aiQuaternion &quaternion) |
| Convert aiQuaternion to glm::quat. More... | |
| glm::vec3 | aiVector3DToGlm (const aiVector3D &vector) |
| Convert aiVector3D to glm::vec3. More... | |
| void | debugCharacterVertices (const std::vector< CharacterVertex > &vertices) |
| Prints out faulty vertices. More... | |
| Vertex | aiVector3DToVertex (const aiVector3D &vector) |
| Convert aiVector3D to Vertex. More... | |
| std::vector< Vertex > | aiVector3DVectorToVertexVector (const std::vector< aiVector3D > &vectors) |
| Convert vector of aiVector3D to vector of Vertex. More... | |
| std::vector< uint32_t > | aiFaceToFace (const aiFace &face) |
| Convert aiFace to RehtiGraphics Face. More... | |
| std::vector< uint32_t > | aiFaceVectorToFaceVector (const std::vector< aiFace > &faces) |
| Convert vector of aiFace to vector of RehtiGraphics Faces. More... | |
Variables | |
| constexpr double | EPSILON = 0.00001 |
| constexpr float | EPSILON_F = 0.00001f |
| std::vector<uint32_t> aiFaceToFace | ( | const aiFace & | face | ) |
Convert aiFace to RehtiGraphics Face.

| std::vector<uint32_t> aiFaceVectorToFaceVector | ( | const std::vector< aiFace > & | faces | ) |
Convert vector of aiFace to vector of RehtiGraphics Faces.

| glm::mat4 aiMatrix4x4ToGlm | ( | const aiMatrix4x4 & | matrix | ) |
Convert aiMatrix4x4 to glm::mat4.

| glm::quat aiQuaternionToGlm | ( | const aiQuaternion & | quaternion | ) |
Convert aiQuaternion to glm::quat.

| glm::vec3 aiVector3DToGlm | ( | const aiVector3D & | vector | ) |
Convert aiVector3D to glm::vec3.

| Vertex aiVector3DToVertex | ( | const aiVector3D & | vector | ) |
| std::vector<Vertex> aiVector3DVectorToVertexVector | ( | const std::vector< aiVector3D > & | vectors | ) |
|
inline |

| void debugCharacterVertices | ( | const std::vector< CharacterVertex > & | vertices | ) |
Prints out faulty vertices.
| vertices | to check |

|
inline |

|
inline |

| size_t fillSkeleton | ( | aiNode * | rootNode, |
| std::vector< BoneNode > & | boneList, | ||
| std::vector< glm::mat4 > & | transformations, | ||
| std::map< std::string, uint32_t > & | nameToIndex | ||
| ) |
Fills the given vectors with hierarchy and bone data.
| rootNode | is the root node of the hierarchy. |
| boneList | is the list of bones. |
| transformations | is the list of transformations. |
| nameToIndex | is the map of bone names to their indices. |


|
inline |


|
inline |


|
inline |

|
inline |
|
inline |

| size_t loadAnimations | ( | const aiScene * | scene, |
| const std::map< std::string, uint32_t > | nameToIndex, | ||
| std::array< Animation, ANIMATION_TYPE_COUNT > & | animations | ||
| ) |
Loads animations from the given scene.
| scene | to load animations from. |
| nameToIndex | map of bone names to their indices. |
| animations | array to fill with animations. |


| bool loadGlTFFile | ( | const std::string & | path, |
| std::vector< CharacterVertex > & | vertices, | ||
| std::vector< uint32_t > & | indices, | ||
| std::array< Animation, ANIMATION_TYPE_COUNT > & | animations, | ||
| std::vector< BoneNode > & | bones, | ||
| std::vector< glm::mat4 > & | transformations | ||
| ) |
Loads the object from the given path.
| path | to the object file. |
| vertices | Empty vector of float that will be filled with the vertices. |
| indices | Empty vector of unsigned int that will be filled with the indices. |
| animations | Empty array of Animation that will be filled with the animations. |
| bones | Empty vector of BoneNode that will be filled with the bones. |


| bool loadOBJFile | ( | const std::string & | path, |
| std::vector< Vertex > & | vertices, | ||
| std::vector< uint32_t > & | faces, | ||
| const float | scalingFactor = 1.0f |
||
| ) |
Loads the object from the given path.
| path | to the object file. |
| vertices | Empty vector of float that will be filled with the vertices. |
| indices | Empty vector of unsigned int that will be filled with the indices. |
| scalingFactor | The scaling factor for the vertices |


| bool loadOBJTile | ( | std::vector< Vertex > & | vertices, |
| std::vector< uint32_t > & | faces | ||
| ) |
Loads a double sided tile object.
| vertices | to be filled. |
| faces | to be filled. |

|
constexpr |
|
constexpr |