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
+11 -1
View File
@@ -22,6 +22,8 @@ void dd::Systems::PhysicsSystem::Initialize()
m_PhysicsWorld->SetContactListener(m_ContactListener);
InitializeWater();
EVENT_SUBSCRIBE_MEMBER(m_SetImpulse, PhysicsSystem::SetImpulse);
}
@@ -225,15 +227,23 @@ void dd::Systems::PhysicsSystem::CreateParticleGroup(EntityID e)
LOG_ERROR("No Transform component in CreateParticleGroup");
return;
}
LOG_INFO("------ CREATING PARTICLE GROUP");
b2ParticleGroupDef pd;
b2PolygonShape shape;
shape.SetAsBox(transform->Scale.x, transform->Scale.y);
pd.shape = &shape;
pd.flags = b2_elasticParticle;
pd.angle = -0.5f;
pd.angularVelocity = 2.0f;
pd.position.Set(transform->Position.x, transform->Position.y);
//pd.particleCount = 10;
//TODO: PUT IN LIST
t_watergroup = m_ParticleSystem->CreateParticleGroup(pd);
LOG_INFO("ParticleCount: %i", t_watergroup->GetParticleCount());
}
dd::Systems::PhysicsSystem::~PhysicsSystem()