GL - more testing and changes to the level and using the physics API

This commit is contained in:
Erik Persson 2014-01-31 09:12:15 +01:00
parent ae6a570a12
commit c30db71e94
5 changed files with 12 additions and 5 deletions

View File

@ -95,7 +95,7 @@ bool GameState::LoadModels(std::wstring mapFile)
// add box model
modelData.world = Oyster::Math3D::Float4x4::identity;
translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(-5,15,0));
translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(4,320,0));
modelData.world = modelData.world * translate;
modelData.modelPath = L"box.dan";
modelData.id = 1;

View File

@ -84,6 +84,13 @@ using namespace GameLogic;
Oyster::Math::Float3 pushForce = Oyster::Math::Float4(1,0,0) * (500);
Oyster::Physics::ICustomBody::State state;
Object *realObj = (Object*)obj->GetCustomTag();
if(realObj->GetType() == OBJECT_TYPE_BOX)
{
state = obj->GetState();
state.SetOrientation(Oyster::Math::Float3(1,0.5,1),Oyster::Math::Float3(1,0.5,1));
obj->SetState(state);
}
if(realObj->GetType() == OBJECT_TYPE_PLAYER || realObj->GetType() == OBJECT_TYPE_WORLD)
return;
state = obj->GetState();

View File

@ -138,7 +138,7 @@ bool Game::NewFrame()
if(this->players[i]->player) this->players[i]->player->EndFrame();
}
//gameInstance.onMoveFnc(this->level);
gameInstance.onMoveFnc(this->level);
return true;
}

View File

@ -7,7 +7,7 @@ Game::PlayerData::PlayerData()
{
//set some stats that are appropriate to a player
Oyster::Physics::API::SimpleBodyDescription sbDesc;
sbDesc.centerPosition = Oyster::Math::Float3(0,350,0);
sbDesc.centerPosition = Oyster::Math::Float3(0,320,0);
sbDesc.size = Oyster::Math::Float3(4,7,4);
sbDesc.mass = 10;
//create rigid body

View File

@ -41,7 +41,7 @@ void Level::InitiateLevel(float radius)
// add box
API::SimpleBodyDescription sbDesc_TestBox;
sbDesc_TestBox.centerPosition = Oyster::Math::Float4(-5,15,0,0);
sbDesc_TestBox.centerPosition = Oyster::Math::Float4(4,320,0,0);
sbDesc_TestBox.ignoreGravity = false;
sbDesc_TestBox.mass = 10;
sbDesc_TestBox.size = Oyster::Math::Float4(0.5f,0.5f,0.5f,0);
@ -52,7 +52,7 @@ void Level::InitiateLevel(float radius)
testBox = new DynamicObject(rigidBody_TestBox, OBJECT_TYPE::OBJECT_TYPE_BOX);
rigidBody_TestBox->SetCustomTag(testBox);
rigidBody_TestBox->GetState(state);
state.ApplyLinearImpulse(Oyster::Math::Float3(0,0,4));
state.ApplyLinearImpulse(Oyster::Math::Float3(0,0,4000));
rigidBody_TestBox->SetState(state);