Skip to content

Commit

Permalink
Update models_bone_socket.c
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Feb 26, 2024
1 parent a6425fa commit 7fae41b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions examples/models/models_bone_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ int main(void)
InitWindow(screenWidth, screenHeight, "raylib [models] example - bone socket");

// Define the camera to look into our 3d world
Camera camera = {
.position = { 5.0f, 5.0f, 5.0f }, // Camera position
.target = { 0.0f, 2.0f, 0.0f }, // Camera looking at point
.up = { 0.0f, 1.0f, 0.0f }, // Camera up vector (rotation towards target)
.fovy = 45.0f, // Camera field-of-view Y
.projection = CAMERA_PERSPECTIVE // Camera projection type
};
Camera camera = { 0 };
camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position
camera.target = (Vector3){ 0.0f, 2.0f, 0.0f }; // Camera looking at point
camera.up = (Vector3){ 0.0f, 1.0f, 0.0f }; // Camera up vector (rotation towards target)
camera.fovy = 45.0f; // Camera field-of-view Y
camera.projection = CAMERA_PERSPECTIVE; // Camera projection type

// Load gltf model
Model characterModel = LoadModel("resources/models/gltf/greenman.glb"); // Load character model
Expand Down Expand Up @@ -132,7 +131,7 @@ int main(void)
DrawMesh(characterModel.meshes[0], characterModel.materials[1], characterModel.transform);

// Draw equipments (hat, sword, shield)
for (unsigned short i=0; i<BONE_SOCKETS; i++)
for (int i = 0; i < BONE_SOCKETS; i++)
{
if (!showEquip[i]) continue;

Expand Down Expand Up @@ -171,7 +170,7 @@ int main(void)
UnloadModel(characterModel); // Unload character model and meshes/material

// Unload equipment model and meshes/material
for (unsigned short i = 0; i < BONE_SOCKETS; i++) UnloadModel(equipModel[i]);
for (int i = 0; i < BONE_SOCKETS; i++) UnloadModel(equipModel[i]);

CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
Expand Down

0 comments on commit 7fae41b

Please sign in to comment.