Skip to content
Open
8 changes: 4 additions & 4 deletions includes/learnopengl/animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class Animation
const aiScene* scene = importer.ReadFile(animationPath, aiProcess_Triangulate);
assert(scene && scene->mRootNode);
auto animation = scene->mAnimations[0];
m_Duration = animation->mDuration;
m_TicksPerSecond = animation->mTicksPerSecond;
m_Duration = (float)animation->mDuration;
m_TicksPerSecond = (int)animation->mTicksPerSecond;
aiMatrix4x4 globalTransformation = scene->mRootNode->mTransformation;
globalTransformation = globalTransformation.Inverse();
ReadHierarchyData(m_RootNode, scene->mRootNode);
Expand All @@ -53,7 +53,7 @@ class Animation
}


inline float GetTicksPerSecond() { return m_TicksPerSecond; }
inline float GetTicksPerSecond() { return (float)m_TicksPerSecond; }
inline float GetDuration() { return m_Duration;}
inline const AssimpNodeData& GetRootNode() { return m_RootNode; }
inline const std::map<std::string,BoneInfo>& GetBoneIDMap()
Expand Down Expand Up @@ -95,7 +95,7 @@ class Animation
dest.transformation = AssimpGLMHelpers::ConvertMatrixToGLMFormat(src->mTransformation);
dest.childrenCount = src->mNumChildren;

for (int i = 0; i < src->mNumChildren; i++)
for (auto i = 0u; i < src->mNumChildren; i++)
{
AssimpNodeData newData;
ReadHierarchyData(newData, src->mChildren[i]);
Expand Down
13 changes: 8 additions & 5 deletions includes/learnopengl/bone.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ class Bone
public:
Bone(const std::string& name, int ID, const aiNodeAnim* channel)
:
m_LocalTransform(1.0f),
m_Name(name),
m_ID(ID),
m_LocalTransform(1.0f)
m_ID(ID)
{
m_NumPositions = channel->mNumPositionKeys;

for (int positionIndex = 0; positionIndex < m_NumPositions; ++positionIndex)
{
aiVector3D aiPosition = channel->mPositionKeys[positionIndex].mValue;
float timeStamp = channel->mPositionKeys[positionIndex].mTime;
float timeStamp = (float)channel->mPositionKeys[positionIndex].mTime;
KeyPosition data;
data.position = AssimpGLMHelpers::GetGLMVec(aiPosition);
data.timeStamp = timeStamp;
Expand All @@ -53,7 +53,7 @@ class Bone
for (int rotationIndex = 0; rotationIndex < m_NumRotations; ++rotationIndex)
{
aiQuaternion aiOrientation = channel->mRotationKeys[rotationIndex].mValue;
float timeStamp = channel->mRotationKeys[rotationIndex].mTime;
float timeStamp = (float)channel->mRotationKeys[rotationIndex].mTime;
KeyRotation data;
data.orientation = AssimpGLMHelpers::GetGLMQuat(aiOrientation);
data.timeStamp = timeStamp;
Expand All @@ -64,7 +64,7 @@ class Bone
for (int keyIndex = 0; keyIndex < m_NumScalings; ++keyIndex)
{
aiVector3D scale = channel->mScalingKeys[keyIndex].mValue;
float timeStamp = channel->mScalingKeys[keyIndex].mTime;
float timeStamp = (float)channel->mScalingKeys[keyIndex].mTime;
KeyScale data;
data.scale = AssimpGLMHelpers::GetGLMVec(scale);
data.timeStamp = timeStamp;
Expand Down Expand Up @@ -93,6 +93,7 @@ class Bone
return index;
}
assert(0);
return 0;
}

int GetRotationIndex(float animationTime)
Expand All @@ -103,6 +104,7 @@ class Bone
return index;
}
assert(0);
return 0;
}

int GetScaleIndex(float animationTime)
Expand All @@ -113,6 +115,7 @@ class Bone
return index;
}
assert(0);
return 0;
}


Expand Down
7 changes: 2 additions & 5 deletions includes/learnopengl/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ class Transform
m_isDirty = true;
}

const glm::vec3& getGlobalPosition() const
{
return m_modelMatrix[3];
}

const glm::vec3& getLocalPosition() const
{
return m_pos;
Expand Down Expand Up @@ -268,6 +263,8 @@ struct AABB : public BoundingVolume
AABB(const glm::vec3& inCenter, float iI, float iJ, float iK)
: BoundingVolume{}, center{ inCenter }, extents{ iI, iJ, iK }
{}

virtual ~AABB() = default;

std::array<glm::vec3, 8> getVertice() const
{
Expand Down
4 changes: 3 additions & 1 deletion includes/learnopengl/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Model
};


unsigned int TextureFromFile(const char *path, const string &directory, bool gamma)
unsigned int TextureFromFile(const char *path, const string &directory, bool)
{
string filename = string(path);
filename = directory + '/' + filename;
Expand All @@ -222,6 +222,8 @@ unsigned int TextureFromFile(const char *path, const string &directory, bool gam
format = GL_RGB;
else if (nrComponents == 4)
format = GL_RGBA;
else
throw std::runtime_error("textures are required to havve 1,3 or 4 components\n");

glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, data);
Expand Down
10 changes: 6 additions & 4 deletions includes/learnopengl/model_animation.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ class Model
}


void ExtractBoneWeightForVertices(std::vector<Vertex>& vertices, aiMesh* mesh, const aiScene* scene)
void ExtractBoneWeightForVertices(std::vector<Vertex>& vertices, aiMesh* mesh, const aiScene*)
{
auto& boneInfoMap = m_BoneInfoMap;
int& boneCount = m_BoneCounter;

for (int boneIndex = 0; boneIndex < mesh->mNumBones; ++boneIndex)
for (auto boneIndex = 0u; boneIndex < mesh->mNumBones; ++boneIndex)
{
int boneID = -1;
std::string boneName = mesh->mBones[boneIndex]->mName.C_Str();
Expand All @@ -196,14 +196,14 @@ class Model
{
int vertexId = weights[weightIndex].mVertexId;
float weight = weights[weightIndex].mWeight;
assert(vertexId <= vertices.size());
assert(static_cast<size_t>(vertexId) <= vertices.size());
SetVertexBoneData(vertices[vertexId], boneID, weight);
}
}
}


unsigned int TextureFromFile(const char* path, const string& directory, bool gamma = false)
unsigned int TextureFromFile(const char* path, const string& directory)
{
string filename = string(path);
filename = directory + '/' + filename;
Expand All @@ -222,6 +222,8 @@ class Model
format = GL_RGB;
else if (nrComponents == 4)
format = GL_RGBA;
else
throw std::runtime_error("textures are required to havve 1,3 or 4 components\n");

glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format, GL_UNSIGNED_BYTE, data);
Expand Down
2 changes: 1 addition & 1 deletion src/1.getting_started/1.1.hello_window/hello_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
2 changes: 1 addition & 1 deletion src/1.getting_started/3.3.shaders_class/shaders_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
2 changes: 1 addition & 1 deletion src/1.getting_started/4.1.textures/textures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
2 changes: 1 addition & 1 deletion src/1.getting_started/7.1.camera_circle/camera_circle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ void processInput(GLFWwindow *window)

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void framebuffer_size_callback(GLFWwindow*, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
Expand All @@ -311,7 +311,7 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)

// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
void mouse_callback(GLFWwindow*, double xposIn, double yposIn)
{
float xpos = static_cast<float>(xposIn);
float ypos = static_cast<float>(yposIn);
Expand Down Expand Up @@ -350,7 +350,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)

// glfw: whenever the mouse scroll wheel scrolls, this callback is called
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
void scroll_callback(GLFWwindow*, double, double yoffset)
{
fov -= (float)yoffset;
if (fov < 1.0f)
Expand Down
Loading