Skip to content

Commit

Permalink
[Forest] Added skyrim music
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosK92 committed Dec 19, 2023
1 parent c511e83 commit 2bf6360
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Binary file added assets/music/skyrim.mp3
Binary file not shown.
4 changes: 2 additions & 2 deletions runtime/World/Components/PhysicsBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ namespace Spartan
const float k_default_deactivation_time = 2000;
const float k_default_mass = 1.0f;
const float k_default_restitution = 0.2f;
const float k_default_friction = 0.9f;
const float k_default_friction_rolling = 0.9f;
const float k_default_friction = 0.3f;
const float k_default_friction_rolling = 0.3f;
}

#define shape static_cast<btCollisionShape*>(m_shape)
Expand Down
15 changes: 15 additions & 0 deletions runtime/World/World.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ namespace Spartan
// add physics components
shared_ptr<PhysicsBody> rigid_body = m_default_model_floor->AddComponent<PhysicsBody>();
rigid_body->SetMass(0.0f); // static
rigid_body->SetFriction(1.0f);
rigid_body->SetFrictionRolling(1.0f);
rigid_body->SetShapeType(PhysicsShape::StaticPlane);
}
}
Expand Down Expand Up @@ -856,6 +858,17 @@ namespace Spartan
audio_source->SetAudioClip("project\\music\\underwater.mp3");
audio_source->SetPlayOnStart(false);
}

// wind
{
shared_ptr<Entity> sound = World::CreateEntity();
sound->SetObjectName("skyrim");
sound->SetParent(entity);

shared_ptr<AudioSource> audio_source = sound->AddComponent<AudioSource>();
audio_source->SetAudioClip("project\\music\\skyrim.mp3");
audio_source->SetLoop(true);
}
}

// terrain
Expand Down Expand Up @@ -906,6 +919,8 @@ namespace Spartan
// add physics so we can walk on it
PhysicsBody* rigid_body = m_default_terrain->AddComponent<PhysicsBody>().get();
rigid_body->SetMass(0.0f);
rigid_body->SetFriction(0.9f);
rigid_body->SetFrictionRolling(0.9f);

// water
{
Expand Down

0 comments on commit 2bf6360

Please sign in to comment.