GL - added test box to level

This commit is contained in:
lindaandersson 2014-01-27 14:43:39 +01:00
parent 3896514bae
commit a8dbf2a4c9
5 changed files with 17 additions and 10 deletions

View File

@ -113,8 +113,10 @@ namespace DanBias
void GameSession::ObjectMove(GameLogic::IObjectData* movedObject)
{
movedObject->GetID();
movedObject->GetOrientation();
/*int id= movedObject->GetID();
Oyster::Math::Float4x4 world = movedObject->GetOrientation();
Protocol_ObjectPosition p(world, 2);
Send(p.GetProtocol());*/
}

View File

@ -73,5 +73,9 @@ using namespace GameLogic;
void AttatchmentMassDriver::ForcePushAction(Oyster::Physics::ICustomBody *obj)
{
Oyster::Math::Float4 pushForce = Oyster::Math::Float4(1,0,0,0) * (500);
((Object*)obj->GetCustomTag())->ApplyLinearImpulse(pushForce);
Oyster::Physics::ICustomBody::State state;
state = obj->GetState();
state.ApplyLinearImpulse(pushForce);
obj->SetState(state);
//((Object*)obj->GetCustomTag())->ApplyLinearImpulse(pushForce);
}

View File

@ -39,18 +39,18 @@ void Level::InitiateLevel(float radius)
levelObj = new StaticObject(rigidBody, LevelCollision, OBJECT_TYPE::OBJECT_TYPE_WORLD);
API::SphericalBodyDescription sbDesc_TestBox;
sbDesc.centerPosition = Oyster::Math::Float4(3,15,0,0);
sbDesc.ignoreGravity = true;
sbDesc.radius = 8; //radius;
sbDesc.mass = 10e12f;
API::SimpleBodyDescription sbDesc_TestBox;
sbDesc_TestBox.centerPosition = Oyster::Math::Float4(3,15,0,0);
sbDesc_TestBox.ignoreGravity = false;
sbDesc_TestBox.mass = 10;
sbDesc_TestBox.size = Oyster::Math::Float4(2,2,2,0);
//sbDesc.mass = 0; //10^16
ICustomBody* rigidBody_TestBox = API::Instance().CreateRigidBody(sbDesc_TestBox).Release();
DynamicObject *testBox = new DynamicObject(rigidBody_TestBox,LevelCollision,OBJECT_TYPE::OBJECT_TYPE_BOX);
testBox = new DynamicObject(rigidBody_TestBox,LevelCollision,OBJECT_TYPE::OBJECT_TYPE_BOX);
/*API::Gravity gravityWell;

View File

@ -66,6 +66,7 @@ namespace GameLogic
GameMode gameMode;
Utility::DynamicMemory::SmartPointer<Oyster::Physics::ICustomBody> rigidBodyLevel;
StaticObject *levelObj;
DynamicObject *testBox;
};