void IController::Drain() { TriggerBoxEntity_cl *triggerbox = vdynamic_cast <TriggerBoxEntity_cl *> (Vision::Game.SearchEntity("triggerbox")); if(triggerbox->IsEnabled()) //if trigger box is enabled triggerbox->SetEnabled(false); //disable it else if(!triggerbox->IsEnabled()) //if trigger box is disabled triggerbox->SetEnabled(true); //enable it }
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; }