summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-08-08 13:02:51 +0200
committerraysan5 <[email protected]>2021-08-08 13:02:51 +0200
commitee72497eef324aaac0abede3bfe6a89b0e1d8fb7 (patch)
tree9f050c8d467559de0dd15f726bb21c07b0320e82 /src
parent5e63cd3c97a8b45c5effa961b00b533223c4e44f (diff)
downloadraylib-ee72497eef324aaac0abede3bfe6a89b0e1d8fb7.tar.gz
raylib-ee72497eef324aaac0abede3bfe6a89b0e1d8fb7.zip
REVIEWED: Some warnings...
Diffstat (limited to 'src')
-rw-r--r--src/models.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/models.c b/src/models.c
index 2b6f9a58..68785347 100644
--- a/src/models.c
+++ b/src/models.c
@@ -79,6 +79,7 @@
#define PAR_SHAPES_IMPLEMENTATION
#include "external/par_shapes.h" // Shapes 3d parametric generation
+ #undef bool
#endif
#if defined(_WIN32)
@@ -3178,11 +3179,10 @@ RayCollision GetRayCollisionBox(Ray ray, BoundingBox box)
collision.normal = Vector3Scale(collision.normal, 2.01f);
collision.normal = Vector3Divide(collision.normal, Vector3Subtract(box.max, box.min));
// The relevant elemets of the vector are now slightly larger than 1.0f (or smaller than -1.0f)
- // and the others are somewhere between -1.0 and 1.0
- // casting to int is exactly our wanted normal!
- collision.normal.x = (int)collision.normal.x;
- collision.normal.y = (int)collision.normal.y;
- collision.normal.z = (int)collision.normal.z;
+ // and the others are somewhere between -1.0 and 1.0 casting to int is exactly our wanted normal!
+ collision.normal.x = (float)((int)collision.normal.x);
+ collision.normal.y = (float)((int)collision.normal.y);
+ collision.normal.z = (float)((int)collision.normal.z);
collision.normal = Vector3Normalize(collision.normal);
@@ -4992,7 +4992,7 @@ static ModelAnimation *LoadGLTFModelAnimations(const char *fileName, int *animCo
{
output->framePoses[frame] = RL_MALLOC(output->boneCount*sizeof(Transform));
- for (unsigned int i = 0; i < output->boneCount; i++)
+ for (int i = 0; i < output->boneCount; i++)
{
if (data->nodes[i].has_translation) memcpy(&output->framePoses[frame][i].translation, data->nodes[i].translation, 3*sizeof(float));
else output->framePoses[frame][i].translation = Vector3Zero();
@@ -5185,7 +5185,7 @@ void LoadGLTFMesh(cgltf_data* data, cgltf_mesh* mesh, Model* outModel, Matrix cu
outModel->meshes[(*primitiveIndex)].vertices = ReadGLTFValuesAs(acc, cgltf_component_type_r_32f, false);
// Transform using the nodes matrix attributes
- for (unsigned int v = 0; v < outModel->meshes[(*primitiveIndex)].vertexCount; v++)
+ for (int v = 0; v < outModel->meshes[(*primitiveIndex)].vertexCount; v++)
{
Vector3 vertex = {
outModel->meshes[(*primitiveIndex)].vertices[(v*3 + 0)],
@@ -5211,7 +5211,7 @@ void LoadGLTFMesh(cgltf_data* data, cgltf_mesh* mesh, Model* outModel, Matrix cu
outModel->meshes[(*primitiveIndex)].normals = ReadGLTFValuesAs(acc, cgltf_component_type_r_32f, false);
// Transform using the nodes matrix attributes
- for (unsigned int v = 0; v < outModel->meshes[(*primitiveIndex)].vertexCount; v++)
+ for (int v = 0; v < outModel->meshes[(*primitiveIndex)].vertexCount; v++)
{
Vector3 normal = {
outModel->meshes[(*primitiveIndex)].normals[(v*3 + 0)],