From 0d643a890d34b1e0c987ad20a0a64abdcb57f5b9 Mon Sep 17 00:00:00 2001 From: Erik Persson Date: Wed, 12 Feb 2014 10:43:41 +0100 Subject: [PATCH] GL - massdriver --- Code/Game/GameLogic/AttatchmentMassDriver.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Code/Game/GameLogic/AttatchmentMassDriver.cpp b/Code/Game/GameLogic/AttatchmentMassDriver.cpp index a2002566..9a90a524 100644 --- a/Code/Game/GameLogic/AttatchmentMassDriver.cpp +++ b/Code/Game/GameLogic/AttatchmentMassDriver.cpp @@ -104,10 +104,13 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float Oyster::Math::Float4x4 hitSpace = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/8,1,1,50); Oyster::Collision3D::Frustrum hitFrustum = Oyster::Collision3D::Frustrum(Oyster::Math3D::ViewProjectionMatrix(aim,hitSpace)); + + + Oyster::Collision3D::Cone *hitCone; forcePushData args; args.pushForce = pushForce; - Oyster::Physics::API::Instance().ApplyEffect(hitFrustum,&args,ForcePushAction); + //Oyster::Physics::API::Instance().ApplyEffect(hitFrustum,&args,ForcePushAction); } /******************************************************** @@ -126,7 +129,7 @@ void AttatchmentMassDriver::ForceZip(const WEAPON_FIRE &usage, float dt) void AttatchmentMassDriver::ForcePull(const WEAPON_FIRE &usage, float dt) { - if(hasObject) return; //this test checks if the weapon already has something picked up, if so then it cant use this function + //if(hasObject) return; //this test checks if the weapon already has something picked up, if so then it cant use this function PickUpObject(usage,dt); //first test if there is a nearby object to pickup @@ -142,19 +145,15 @@ void AttatchmentMassDriver::ForcePull(const WEAPON_FIRE &usage, float dt) forcePushData args; args.pushForce = -pushForce; - Oyster::Physics::API::Instance().ApplyEffect(hitFrustum,&args,ForcePushAction); + //Oyster::Physics::API::Instance().ApplyEffect(hitFrustum,&args,ForcePushAction); } void AttatchmentMassDriver::PickUpObject(const WEAPON_FIRE &usage, float dt) { Oyster::Math::Float3 pos = owner->GetPosition() + owner->GetLookDir().GetNormalized()*5; - Oyster::Collision3D::Sphere hitSphere = Oyster::Collision3D::Sphere(pos,20); - /*Oyster::Math::Float4x4 aim = Oyster::Math3D::ViewMatrix_LookAtDirection(owner->GetLookDir(), owner->GetRigidBody()->GetGravityNormal(), owner->GetPosition()); - - Oyster::Math::Float4x4 hitSpace = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/4,1,1,20); - Oyster::Collision3D::Frustrum hitFrustum = Oyster::Collision3D::Frustrum(Oyster::Math3D::ViewProjectionMatrix(aim,hitSpace)); -*/ - + Oyster::Collision3D::Sphere *hitSphere = new Oyster::Collision3D::Sphere(pos,20); Oyster::Physics::API::Instance().ApplyEffect(hitSphere,this,AttemptPickUp); + + delete hitSphere; }