changes in massdriver
This commit is contained in:
parent
8f627f8a71
commit
b95e1d6b7a
|
@ -60,17 +60,18 @@ void AttatchmentMassDriver::Update(float dt)
|
|||
//update position of heldObject if there is an object being held
|
||||
if(hasObject)
|
||||
{
|
||||
Oyster::Physics::ICustomBody::State state;
|
||||
state = heldObject->GetState();
|
||||
//Oyster::Physics::ICustomBody::State state;
|
||||
//state = heldObject->GetState();
|
||||
Oyster::Math::Float3 ownerPos = owner->GetPosition();
|
||||
Oyster::Physics::ICustomBody::State ownerState = owner->GetRigidBody()->GetState();
|
||||
Oyster::Math::Float3 up = -ownerState.GetOrientation().v[2];
|
||||
up *= -0.3;
|
||||
Oyster::Math::Float3 pos = ownerPos + up + (owner->GetLookDir().GetNormalized()*10);
|
||||
Oyster::Math::Float3 pos = ownerPos + (owner->GetLookDir().GetNormalized()*5);
|
||||
|
||||
state.centerPos = pos;
|
||||
//state.centerPos = pos;
|
||||
heldObject->SetPosition(pos);
|
||||
|
||||
heldObject->SetState(state);
|
||||
//heldObject->SetState(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,10 +87,8 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float
|
|||
if(hasObject)
|
||||
{
|
||||
Oyster::Physics::API::Instance().ReleaseFromLimbo(heldObject);
|
||||
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (700);
|
||||
Oyster::Physics::ICustomBody::State state = heldObject->GetState();
|
||||
//state.ApplyLinearImpulse((Oyster::Math::Float3)pushForce);
|
||||
heldObject->SetState(state);
|
||||
pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (100);
|
||||
heldObject->ApplyImpulse((Oyster::Math::Float3)pushForce);
|
||||
|
||||
hasObject = false;
|
||||
heldObject = NULL;
|
||||
|
|
|
@ -40,10 +40,6 @@ using namespace GameLogic;
|
|||
PlayerVObject(*player,*realObj, kineticEnergyLoss);
|
||||
//player->playerState = PLAYER_STATE::PLAYER_STATE_WALKING;
|
||||
break;
|
||||
case OBJECT_TYPE::OBJECT_TYPE_JUMPPAD:
|
||||
int i = 0;
|
||||
// JUMP
|
||||
break;
|
||||
}
|
||||
|
||||
//return Physics::ICustomBody::SubscriptMessage_none;
|
||||
|
@ -144,7 +140,7 @@ using namespace GameLogic;
|
|||
{
|
||||
case OBJECT_TYPE::OBJECT_TYPE_BOX:
|
||||
//move obj to limbo in physics to make sure it wont collide with anything
|
||||
Oyster::Physics::API::Instance().MoveToLimbo(obj);
|
||||
// Oyster::Physics::API::Instance().MoveToLimbo(obj);
|
||||
weapon->heldObject = obj; //weapon now holds the object
|
||||
weapon->hasObject = true;
|
||||
|
||||
|
|
Loading…
Reference in New Issue