@@ -570,8 +570,9 @@ void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float e
570570 rlBegin (RL_TRIANGLES );
571571 rlColor4ub (color .r , color .g , color .b , color .a );
572572
573- for (int i = 0 ; i < sides ; i ++ ) {
574- // compute the four vertices
573+ for (int i = 0 ; i < sides ; i ++ )
574+ {
575+ // Compute the four vertices
575576 float s1 = sinf (baseAngle * (i + 0 ))* startRadius ;
576577 float c1 = cosf (baseAngle * (i + 0 ))* startRadius ;
577578 Vector3 w1 = { startPos .x + s1 * b1 .x + c1 * b2 .x , startPos .y + s1 * b1 .y + c1 * b2 .y , startPos .z + s1 * b1 .z + c1 * b2 .z };
@@ -585,11 +586,12 @@ void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float e
585586 float c4 = cosf (baseAngle * (i + 1 ))* endRadius ;
586587 Vector3 w4 = { endPos .x + s4 * b1 .x + c4 * b2 .x , endPos .y + s4 * b1 .y + c4 * b2 .y , endPos .z + s4 * b1 .z + c4 * b2 .z };
587588
588- if (startRadius > 0 ) { //
589+ if (startRadius > 0 )
590+ {
589591 rlVertex3f (startPos .x , startPos .y , startPos .z ); // |
590592 rlVertex3f (w2 .x , w2 .y , w2 .z ); // T0
591593 rlVertex3f (w1 .x , w1 .y , w1 .z ); // |
592- } //
594+ }
593595 // w2 x.-----------x startPos
594596 rlVertex3f (w1 .x , w1 .y , w1 .z ); // | |\'. T0 /
595597 rlVertex3f (w2 .x , w2 .y , w2 .z ); // T1 | \ '. /
@@ -599,7 +601,8 @@ void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float e
599601 rlVertex3f (w4 .x , w4 .y , w4 .z ); // T2 '. \ |T3/
600602 rlVertex3f (w3 .x , w3 .y , w3 .z ); // | '. \ | /
601603 // '.\|/
602- if (endRadius > 0 ) { // 'x w3
604+ if (endRadius > 0 ) // 'x w3
605+ {
603606 rlVertex3f (endPos .x , endPos .y , endPos .z ); // |
604607 rlVertex3f (w3 .x , w3 .y , w3 .z ); // T3
605608 rlVertex3f (w4 .x , w4 .y , w4 .z ); // |
@@ -657,8 +660,9 @@ void DrawCylinderWiresEx(Vector3 startPos, Vector3 endPos, float startRadius, fl
657660 rlBegin (RL_LINES );
658661 rlColor4ub (color .r , color .g , color .b , color .a );
659662
660- for (int i = 0 ; i < sides ; i ++ ) {
661- // compute the four vertices
663+ for (int i = 0 ; i < sides ; i ++ )
664+ {
665+ // Compute the four vertices
662666 float s1 = sinf (baseAngle * (i + 0 ))* startRadius ;
663667 float c1 = cosf (baseAngle * (i + 0 ))* startRadius ;
664668 Vector3 w1 = { startPos .x + s1 * b1 .x + c1 * b2 .x , startPos .y + s1 * b1 .y + c1 * b2 .y , startPos .z + s1 * b1 .z + c1 * b2 .z };
@@ -4749,7 +4753,8 @@ static cgltf_result LoadFileGLTFCallback(const struct cgltf_memory_options *memo
47494753}
47504754
47514755// Release file data callback for cgltf
4752- static void ReleaseFileGLTFCallback (const struct cgltf_memory_options * memoryOptions , const struct cgltf_file_options * fileOptions , void * data ) {
4756+ static void ReleaseFileGLTFCallback (const struct cgltf_memory_options * memoryOptions , const struct cgltf_file_options * fileOptions , void * data )
4757+ {
47534758 UnloadFileData (data );
47544759}
47554760
@@ -5335,7 +5340,8 @@ static Model LoadGLTF(const char *fileName)
53355340 model .meshes [meshIndex ].animVertices = RL_CALLOC (model .meshes [meshIndex ].vertexCount * 3 , sizeof (float ));
53365341 memcpy (model .meshes [meshIndex ].animVertices , model .meshes [meshIndex ].vertices , model .meshes [meshIndex ].vertexCount * 3 * sizeof (float ));
53375342 model .meshes [meshIndex ].animNormals = RL_CALLOC (model .meshes [meshIndex ].vertexCount * 3 , sizeof (float ));
5338- if (model .meshes [meshIndex ].normals != NULL ) {
5343+ if (model .meshes [meshIndex ].normals != NULL )
5344+ {
53395345 memcpy (model .meshes [meshIndex ].animNormals , model .meshes [meshIndex ].normals , model .meshes [meshIndex ].vertexCount * 3 * sizeof (float ));
53405346 }
53415347
@@ -5379,7 +5385,7 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
53795385 break ;
53805386 }
53815387 }
5382-
5388+
53835389 float duration = fmax ((tend - tstart ), EPSILON );
53845390 float t = (time - tstart )/duration ;
53855391 t = (t < 0.0f )? 0.0f : t ;
@@ -5400,7 +5406,6 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
54005406
54015407 * r = v1 ;
54025408 } break ;
5403-
54045409 case cgltf_interpolation_type_linear :
54055410 {
54065411 float tmp [3 ] = { 0.0f };
@@ -5409,10 +5414,9 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
54095414 cgltf_accessor_read_float (output , keyframe + 1 , tmp , 3 );
54105415 Vector3 v2 = {tmp [0 ], tmp [1 ], tmp [2 ]};
54115416 Vector3 * r = data ;
5412-
5417+
54135418 * r = Vector3Lerp (v1 , v2 , t );
54145419 } break ;
5415-
54165420 case cgltf_interpolation_type_cubic_spline :
54175421 {
54185422 float tmp [3 ] = { 0.0f };
@@ -5428,6 +5432,7 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
54285432
54295433 * r = Vector3CubicHermite (v1 , tangent1 , v2 , tangent2 , t );
54305434 } break ;
5435+ default : break ;
54315436 }
54325437 }
54335438 else if (output -> type == cgltf_type_vec4 )
@@ -5444,7 +5449,6 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
54445449
54455450 * r = v1 ;
54465451 } break ;
5447-
54485452 case cgltf_interpolation_type_linear :
54495453 {
54505454 float tmp [4 ] = { 0.0f };
@@ -5453,10 +5457,9 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
54535457 cgltf_accessor_read_float (output , keyframe + 1 , tmp , 4 );
54545458 Vector4 v2 = {tmp [0 ], tmp [1 ], tmp [2 ], tmp [3 ]};
54555459 Vector4 * r = data ;
5456-
5460+
54575461 * r = QuaternionSlerp (v1 , v2 , t );
54585462 } break ;
5459-
54605463 case cgltf_interpolation_type_cubic_spline :
54615464 {
54625465 float tmp [4 ] = { 0.0f };
@@ -5477,12 +5480,13 @@ static bool GetPoseAtTimeGLTF(cgltf_interpolation_type interpolationType, cgltf_
54775480 {
54785481 v2 = Vector4Negate (v2 );
54795482 }
5480-
5483+
54815484 outTangent1 = Vector4Scale (outTangent1 , duration );
54825485 inTangent2 = Vector4Scale (inTangent2 , duration );
54835486
54845487 * r = QuaternionCubicHermiteSpline (v1 , outTangent1 , v2 , inTangent2 , t );
54855488 } break ;
5489+ default : break ;
54865490 }
54875491 }
54885492
0 commit comments