Continued work on water, can now get 1 particle? maybe? Gotta get rendering to work so i can test it.

This commit is contained in:
tleety
2015-09-21 16:00:20 +02:00
parent b32934dba6
commit 1e70e151ee
8 changed files with 1123 additions and 30 deletions
+25 -28
View File
@@ -100,34 +100,28 @@ public:
m_World->Initialize();
//TODO: Remove tobias light-test code.
/*{
}*/
//OctoBall
{
auto ent = m_World->CreateEntity();
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
transform->Position = glm::vec3(0.5f, 0.f, -9.9f);
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
transform->Velocity = glm::vec3(1.0f, -5.f, 0.f);
auto model = m_World->AddComponent<Components::Model>(ent);
model->ModelFile = "Models/Test/Ball/Ballopus.obj";
std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
std::shared_ptr<Components::Ball> ball = m_World->AddComponent<Components::Ball>(ent);
std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
physics->Static = false;
auto plight = m_World->AddComponent<Components::PointLight>(ent);
plight->Radius = 2.f;
m_World->CommitEntity(ent);
}
// {
// auto ent = m_World->CreateEntity();
// std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
// transform->Position = glm::vec3(0.5f, 0.f, -9.9f);
// transform->Scale = glm::vec3(1.f, 1.f, 1.f);
// transform->Velocity = glm::vec3(1.0f, -5.f, 0.f);
//
// auto model = m_World->AddComponent<Components::Model>(ent);
// model->ModelFile = "Models/Test/Ball/Ballopus.obj";
//
// std::shared_ptr<Components::CircleShape> circleShape = m_World->AddComponent<Components::CircleShape>(ent);
// std::shared_ptr<Components::Ball> ball = m_World->AddComponent<Components::Ball>(ent);
//
// std::shared_ptr<Components::Physics> physics = m_World->AddComponent<Components::Physics>(ent);
// physics->Static = false;
//
// auto plight = m_World->AddComponent<Components::PointLight>(ent);
// plight->Radius = 2.f;
//
// m_World->CommitEntity(ent);
// }
//PointLightTest
{
@@ -136,6 +130,7 @@ public:
transform->Position = glm::vec3(2.f, 1.5f, -9.f);
auto pl = m_World->AddComponent<Components::PointLight>(t_Light);
pl->Radius = 8.f;
m_World->CommitEntity(t_Light);
}
//Halfpipe background test model.
@@ -146,17 +141,19 @@ public:
transform->Scale = glm::vec3(15.f);
auto model = m_World->AddComponent<Components::Model>(t_halfPipe);
model->ModelFile = "Models/Test/halfpipe/Halfpipe.obj";
m_World->CommitEntity(t_halfPipe);
}
//Water test
{
auto t_waterBody = m_World->CreateEntity();
auto transform = m_World->AddComponent<Components::Transform>(t_waterBody);
transform->Position = glm::vec3(0.f, 0.f, -10.f);
transform->Position = glm::vec3(1.5f, 1.5f, -10.f);
auto water = m_World->AddComponent<Components::WaterVolume>(t_waterBody);
auto sprite = m_World->AddComponent<Components::Sprite>(t_waterBody);
sprite->SpriteFile = "Textures/Test/Brick_Diffuse.png";
auto body = m_World->AddComponent<Components::RectangleShape>(t_waterBody);
m_World->CommitEntity(t_waterBody);
}
{