//////////////////////////// Water Simulation Controls ////////////////////////////////////////////////////////////// VisBaseEntity_cl *IController::AddWaterDrop(float x, float y, float z, float scaling) { VisBaseEntity_cl *ent = Vision::Game.CreateEntity("VisBaseEntity_cl", hkvVec3(x, y, z), "Assets\\Models\\Misc\\Sphere.Model"); ent->SetScaling(scaling); vHavokRigidBody *sphere = new vHavokRigidBody(); sphere->Havok_TightFit = true; sphere->Havok_Restitution = .35f; ent->AddComponent(sphere); ent->Tag(); entityStack->push(ent); return ent; }
void ParticleRainController::RainBalls(int numOfBalls){ while (ballCount < numOfBalls){ int randomx = rand() % 6000 - 3255; int randomy = rand() % 6000 - 1416; VisBaseEntity_cl *ent = Vision::Game.CreateEntity("VisBaseEntity_cl", hkvVec3(randomx, randomy, 3000), "Models\\Misc\\Sphere.Model"); vHavokRigidBody *ball = new vHavokRigidBody(); ball->Havok_TightFit = true; ball->Havok_Mass = 5.0f; ball->Havok_Restitution = 1.0f; ball->Shape_Type = ShapeType_SPHERE; ent->SetScaling(1.0f); ent->AddComponent(ball); ++ballCount; } ballCount = 0; }
bool WaterSimulationController::Run(VInputMap* inputMap){ if(inputMap->GetTrigger(CUSTOM_CONTROL_ONE)){ VisBaseEntity_cl *ent = this->AddSphere(0, 0, 300); ent->SetScaling(0.15f); ent->RemoveAllComponents(); vHavokRigidBody *sphere = new vHavokRigidBody(); sphere->Havok_TightFit = true; sphere->Havok_Restitution = 0.1f; ent->AddComponent(sphere); } if(inputMap->GetTrigger(CUSTOM_CONTROL_TWO)){ TriggerBoxEntity_cl *triggerbox = vdynamic_cast <TriggerBoxEntity_cl *> (Vision::Game.SearchEntity("triggerbox")); if(triggerbox->IsEnabled()) triggerbox->SetEnabled(false); else if(!triggerbox->IsEnabled()) triggerbox->SetEnabled(true); } return true; }