From 6cbec3e2ac144cc3ab69806784f3b0e8b095ac75 Mon Sep 17 00:00:00 2001 From: Erik Persson Date: Wed, 12 Feb 2014 14:45:10 +0100 Subject: [PATCH] GL - jumppad testing --- Code/Game/GameLogic/AttatchmentMassDriver.cpp | 4 ++-- Code/Game/GameLogic/CollisionManager.cpp | 6 +----- Code/Game/GameLogic/JumpPad.cpp | 4 ++-- Code/Game/GameLogic/JumpPad.h | 2 +- Code/Game/GameLogic/Level.cpp | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.cpp b/Code/Game/GameLogic/AttatchmentMassDriver.cpp index 3f74bc1b..1e5d0640 100644 --- a/Code/Game/GameLogic/AttatchmentMassDriver.cpp +++ b/Code/Game/GameLogic/AttatchmentMassDriver.cpp @@ -87,7 +87,7 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float if(hasObject) { Oyster::Physics::API::Instance().ReleaseFromLimbo(heldObject); - pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (100); + pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (400); heldObject->ApplyImpulse((Oyster::Math::Float3)pushForce); hasObject = false; @@ -100,7 +100,7 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float Oyster::Math::Float lenght = 10; Oyster::Math::Float3 pos = owner->GetRigidBody()->GetState().centerPos; - pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (100); + pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (400); Oyster::Collision3D::Cone *hitCone = new Oyster::Collision3D::Cone(lenght,pos,(Oyster::Math::Float4)owner->GetRigidBody()->GetState().quaternion,radius); diff --git a/Code/Game/GameLogic/CollisionManager.cpp b/Code/Game/GameLogic/CollisionManager.cpp index e39de067..80513fd5 100644 --- a/Code/Game/GameLogic/CollisionManager.cpp +++ b/Code/Game/GameLogic/CollisionManager.cpp @@ -66,11 +66,7 @@ using namespace GameLogic; void SendObjectFlying(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 force) { - Oyster::Physics::ICustomBody::State state; - - state = obj.GetState(); - //state.ApplyLinearImpulse(force); - obj.SetState(state); + obj.ApplyImpulse(force); } diff --git a/Code/Game/GameLogic/JumpPad.cpp b/Code/Game/GameLogic/JumpPad.cpp index 15b80dc8..b716c710 100644 --- a/Code/Game/GameLogic/JumpPad.cpp +++ b/Code/Game/GameLogic/JumpPad.cpp @@ -8,10 +8,10 @@ JumpPad::JumpPad(void) { } -JumpPad::JumpPad(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type, Oyster::Math::Float3 pushForce) +JumpPad::JumpPad(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type, Oyster::Math::Float3 pushForce) :StaticObject(rigidBody, collisionFuncAfter, type) { - + this->pushForce = pushForce; } diff --git a/Code/Game/GameLogic/JumpPad.h b/Code/Game/GameLogic/JumpPad.h index 8d645a00..918ea0c1 100644 --- a/Code/Game/GameLogic/JumpPad.h +++ b/Code/Game/GameLogic/JumpPad.h @@ -9,7 +9,7 @@ namespace GameLogic JumpPad(void); JumpPad(Oyster::Physics::ICustomBody *rigidBody - ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss) + ,void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss) ,OBJECT_TYPE type, Oyster::Math::Float3 pushForce); ~JumpPad(void); diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index 57b39c92..15d855c3 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -181,9 +181,9 @@ void Level::InitiateLevel(float radius) this->staticObjects[0]->objectID = idCount++; // add jumppad - ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(4, 600.3, 0), 5, 0.5f, 0.8f, 0.6f); + ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(1, 1, 1), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(4, 600.3, 0), 5, 0.5f, 0.8f, 0.6f); - this->staticObjects.Push(new JumpPad(rigidBody_Jumppad, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_JUMPPAD, Oyster::Math::Float3(0,1,0))); + this->staticObjects.Push(new JumpPad(rigidBody_Jumppad, JumpPad::JumpPadActivated, OBJECT_TYPE::OBJECT_TYPE_JUMPPAD, Oyster::Math::Float3(0,2000,0))); rigidBody_Jumppad->SetCustomTag(this->staticObjects[1]); this->staticObjects[1]->objectID = idCount++; }