GL - jumppad testing

This commit is contained in:
Erik Persson 2014-02-12 14:45:10 +01:00
parent 14d492f22e
commit 6cbec3e2ac
5 changed files with 8 additions and 12 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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++;
}