3 #define GLM_FORCE_DEPTH_ZERO_TO_ONE
4 #include <glm/gtc/quaternion.hpp>
5 #include <glm/mat4x4.hpp>
6 #include <glm/vec3.hpp>
13 #include "../../../assets/generated/GeneratedAnimations.hpp"
15 #pragma region Constants
45 #pragma region AnimationTypes
72 std::array<GfxOrientation, MAX_BONES>
bones;
112 #pragma region GraphicsObjectTypes
202 return !(*
this == other);
constexpr glm::vec3 CHARACTER_MIN
Definition: BasicTypes.hpp:23
constexpr glm::vec3 CHARACTER_MAX
Definition: BasicTypes.hpp:24
ObjectType
Definition: BasicTypes.hpp:29
@ UNDEFINED
Definition: BasicTypes.hpp:34
@ AREA
Definition: BasicTypes.hpp:33
@ GAMEOBJECT
Definition: BasicTypes.hpp:31
@ CHARACTER
Definition: BasicTypes.hpp:30
@ TESTOBJECT
Definition: BasicTypes.hpp:32
constexpr size_t OBJECT_TYPE_COUNT
Definition: BasicTypes.hpp:26
constexpr uint32_t MAX_BONES
Definition: BasicTypes.hpp:18
std::array< AnimationType, ANIMATION_TYPE_COUNT > getAnimationTypes()
Definition: GraphicsTypes.cpp:96
constexpr glm::vec3 GAMEOBJECT_MIN
Definition: BasicTypes.hpp:20
constexpr glm::vec3 GAMEOBJECT_MAX
Definition: BasicTypes.hpp:21
constexpr uint32_t BONES_PER_VERTEX
Definition: BasicTypes.hpp:17
uint32_t getAnimIndex(AnimationType animType)
Definition: GraphicsTypes.cpp:106
std::array< ObjectType, OBJECT_TYPE_COUNT > getObjectTypes()
Definition: GraphicsTypes.cpp:86
Definition: BasicTypes.hpp:190
glm::vec3 animationDirection
Definition: BasicTypes.hpp:191
bool looping
Definition: BasicTypes.hpp:194
bool operator!=(const AnimationConfig &other) const
Definition: BasicTypes.hpp:200
float duration
Definition: BasicTypes.hpp:193
AnimationType animType
Definition: BasicTypes.hpp:192
bool operator==(const AnimationConfig &other) const
Definition: BasicTypes.hpp:196
Definition: BasicTypes.hpp:70
double time
time of this animation node in ticks
Definition: BasicTypes.hpp:71
std::array< GfxOrientation, MAX_BONES > bones
bone orientations
Definition: BasicTypes.hpp:72
Immutable animation data. Animations should be stored somewhere and requested when needed to be store...
Definition: BasicTypes.hpp:79
double totalTicks
total ticks in the animation
Definition: BasicTypes.hpp:80
float duration
duration of the animation in seconds
Definition: BasicTypes.hpp:82
double ticksPerSecond
ticks per second
Definition: BasicTypes.hpp:81
std::vector< AnimationNode > animationNodes
animation nodes
Definition: BasicTypes.hpp:83
Definition: BasicTypes.hpp:94
std::vector< uint32_t > children
indices of the children in bone array.
Definition: BasicTypes.hpp:97
int parent
index of the parent in bone array.
Definition: BasicTypes.hpp:96
glm::mat4 boneOffset
offset matrix of the bone
Definition: BasicTypes.hpp:95
Camera data used for shading.
Definition: BasicTypes.hpp:147
glm::vec3 position
Definition: BasicTypes.hpp:148
glm::vec3 direction
Definition: BasicTypes.hpp:149
Definition: BasicTypes.hpp:87
AnimationType currentAnimation
Definition: BasicTypes.hpp:88
std::array< Animation, ANIMATION_TYPE_COUNT > animations
Definition: BasicTypes.hpp:90
double currentTicks
Definition: BasicTypes.hpp:89
Definition: BasicTypes.hpp:101
CharacterAnimationData animationData
Definition: BasicTypes.hpp:106
GfxOrientation characterOrientation
orientation of the character
Definition: BasicTypes.hpp:102
std::vector< BoneNode > bones
Definition: BasicTypes.hpp:105
glm::mat4 inverseGlobalTransformation
inverse global transformation of the character
Definition: BasicTypes.hpp:103
std::array< glm::mat4, MAX_BONES > boneTransformations
bone transformation storage data
Definition: BasicTypes.hpp:104
void advanceAnimation(float dt)
Definition: GraphicsTypes.cpp:133
Definition: BasicTypes.hpp:168
glm::vec3 pos
Definition: BasicTypes.hpp:169
glm::uvec4 boneIDs
Definition: BasicTypes.hpp:171
glm::vec4 boneWeights
Definition: BasicTypes.hpp:172
glm::vec2 texCoord
Definition: BasicTypes.hpp:173
glm::vec3 normal
Definition: BasicTypes.hpp:170
Directional light struct representing a directional light.
Definition: BasicTypes.hpp:118
glm::vec3 color
color of the directional light
Definition: BasicTypes.hpp:120
glm::vec3 direction
direction of the directional light
Definition: BasicTypes.hpp:119
float intensity
intensity of the directional light
Definition: BasicTypes.hpp:121
Definition: BasicTypes.hpp:48
glm::vec3 scale
scale of the node
Definition: BasicTypes.hpp:51
glm::mat4 getTransformationMatrix() const
Compiles the transformation matrix of this orientation.
Definition: GraphicsTypes.cpp:111
glm::quat rotation
rotation of the node
Definition: BasicTypes.hpp:50
glm::vec3 position
position of the node
Definition: BasicTypes.hpp:49
static GfxOrientation interpolate(GfxOrientation first, GfxOrientation second, float factor)
Interpolates between two orientations linearly.
Definition: GraphicsTypes.cpp:122
Definition: BasicTypes.hpp:153
int id
Definition: BasicTypes.hpp:154
ObjectType objectType
Definition: BasicTypes.hpp:155
glm::vec3 hitPoint
Definition: BasicTypes.hpp:156
int button
The button that was pressed. For example GLFW_MOUSE_BUTTON_LEFT.
Definition: BasicTypes.hpp:157
Definition: BasicTypes.hpp:161
unsigned char * pixels
Definition: BasicTypes.hpp:162
int height
Definition: BasicTypes.hpp:164
int width
Definition: BasicTypes.hpp:163
Definition: BasicTypes.hpp:135
glm::vec3 diffuse
diffuse color of the material
Definition: BasicTypes.hpp:137
glm::vec3 specular
specular color of the material
Definition: BasicTypes.hpp:138
static PhongMaterial getDefaultMaterial()
Definition: GraphicsTypes.cpp:346
float shininess
shininess of the material
Definition: BasicTypes.hpp:139
glm::vec3 ambient
ambient color of the material
Definition: BasicTypes.hpp:136
Point light struct representing a point that shines light in all directions.
Definition: BasicTypes.hpp:128
glm::vec3 position
position of the point light
Definition: BasicTypes.hpp:129
glm::vec3 color
color of the point light
Definition: BasicTypes.hpp:130
float intensity
intensity of the point light
Definition: BasicTypes.hpp:131
Definition: BasicTypes.hpp:184
glm::vec3 color
Definition: BasicTypes.hpp:186
glm::vec3 pos
Definition: BasicTypes.hpp:185
Definition: MapObjLoader.hpp:10
glm::vec3 normal
Definition: BasicTypes.hpp:179
glm::vec2 texCoord
Definition: BasicTypes.hpp:180
glm::vec3 pos
Definition: BasicTypes.hpp:178