GL - more testing and changes to the level and using the physics API
This commit is contained in:
parent
ae6a570a12
commit
c30db71e94
|
@ -95,7 +95,7 @@ bool GameState::LoadModels(std::wstring mapFile)
|
||||||
|
|
||||||
// add box model
|
// add box model
|
||||||
modelData.world = Oyster::Math3D::Float4x4::identity;
|
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.world = modelData.world * translate;
|
||||||
modelData.modelPath = L"box.dan";
|
modelData.modelPath = L"box.dan";
|
||||||
modelData.id = 1;
|
modelData.id = 1;
|
||||||
|
|
|
@ -84,6 +84,13 @@ using namespace GameLogic;
|
||||||
Oyster::Math::Float3 pushForce = Oyster::Math::Float4(1,0,0) * (500);
|
Oyster::Math::Float3 pushForce = Oyster::Math::Float4(1,0,0) * (500);
|
||||||
Oyster::Physics::ICustomBody::State state;
|
Oyster::Physics::ICustomBody::State state;
|
||||||
Object *realObj = (Object*)obj->GetCustomTag();
|
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)
|
if(realObj->GetType() == OBJECT_TYPE_PLAYER || realObj->GetType() == OBJECT_TYPE_WORLD)
|
||||||
return;
|
return;
|
||||||
state = obj->GetState();
|
state = obj->GetState();
|
||||||
|
|
|
@ -138,7 +138,7 @@ bool Game::NewFrame()
|
||||||
if(this->players[i]->player) this->players[i]->player->EndFrame();
|
if(this->players[i]->player) this->players[i]->player->EndFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
//gameInstance.onMoveFnc(this->level);
|
gameInstance.onMoveFnc(this->level);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ Game::PlayerData::PlayerData()
|
||||||
{
|
{
|
||||||
//set some stats that are appropriate to a player
|
//set some stats that are appropriate to a player
|
||||||
Oyster::Physics::API::SimpleBodyDescription sbDesc;
|
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.size = Oyster::Math::Float3(4,7,4);
|
||||||
sbDesc.mass = 10;
|
sbDesc.mass = 10;
|
||||||
//create rigid body
|
//create rigid body
|
||||||
|
|
|
@ -41,7 +41,7 @@ void Level::InitiateLevel(float radius)
|
||||||
|
|
||||||
// add box
|
// add box
|
||||||
API::SimpleBodyDescription sbDesc_TestBox;
|
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.ignoreGravity = false;
|
||||||
sbDesc_TestBox.mass = 10;
|
sbDesc_TestBox.mass = 10;
|
||||||
sbDesc_TestBox.size = Oyster::Math::Float4(0.5f,0.5f,0.5f,0);
|
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);
|
testBox = new DynamicObject(rigidBody_TestBox, OBJECT_TYPE::OBJECT_TYPE_BOX);
|
||||||
rigidBody_TestBox->SetCustomTag(testBox);
|
rigidBody_TestBox->SetCustomTag(testBox);
|
||||||
rigidBody_TestBox->GetState(state);
|
rigidBody_TestBox->GetState(state);
|
||||||
state.ApplyLinearImpulse(Oyster::Math::Float3(0,0,4));
|
state.ApplyLinearImpulse(Oyster::Math::Float3(0,0,4000));
|
||||||
rigidBody_TestBox->SetState(state);
|
rigidBody_TestBox->SetState(state);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue