Merge branch 'GameLogic' of https://github.com/dean11/Danbias into GameServer

This commit is contained in:
dean11 2014-02-19 15:53:20 +01:00
commit 13755c0aeb
2 changed files with 40 additions and 40 deletions

View File

@ -190,45 +190,45 @@ bool GameState::Render()
}*/ }*/
// RB DEBUG render wire frame // RB DEBUG render wire frame
if(this->privData->renderWhireframe) //if(this->privData->renderWhireframe)
{ //{
Oyster::Graphics::API::StartRenderWireFrame(); // Oyster::Graphics::API::StartRenderWireFrame();
//
Oyster::Math3D::Float4x4 translation = Oyster::Math3D::TranslationMatrix(Float3( 0,132, 20)); // Oyster::Math3D::Float4x4 translation = Oyster::Math3D::TranslationMatrix(Float3( 0,132, 20));
Oyster::Math3D::Float4x4 scale = Oyster::Math3D::ScalingMatrix(Float3( 0.5f, 0.5f, 0.5f)); // Oyster::Math3D::Float4x4 scale = Oyster::Math3D::ScalingMatrix(Float3( 0.5f, 0.5f, 0.5f));
Oyster::Math3D::Float4x4 world = translation * scale; // Oyster::Math3D::Float4x4 world = translation * scale;
Oyster::Graphics::API::RenderDebugCube( world ); // Oyster::Graphics::API::RenderDebugCube( world );
Oyster::Graphics::API::RenderDebugCube(this->privData->player.getRBWorld()); // Oyster::Graphics::API::RenderDebugCube(this->privData->player.getRBWorld());
//
staticObject = this->privData->staticObjects->begin(); // staticObject = this->privData->staticObjects->begin();
for( ; staticObject != this->privData->staticObjects->end(); ++staticObject ) // for( ; staticObject != this->privData->staticObjects->end(); ++staticObject )
{ // {
if( staticObject->second->getBRtype() == RB_Type_Cube) // if( staticObject->second->getBRtype() == RB_Type_Cube)
{ // {
Oyster::Graphics::API::RenderDebugCube( staticObject->second->getRBWorld()); // Oyster::Graphics::API::RenderDebugCube( staticObject->second->getRBWorld());
} // }
if( staticObject->second->getBRtype() == RB_Type_Sphere) // if( staticObject->second->getBRtype() == RB_Type_Sphere)
{ // {
Oyster::Graphics::API::RenderDebugSphere( staticObject->second->getRBWorld()); // Oyster::Graphics::API::RenderDebugSphere( staticObject->second->getRBWorld());
} // }
} // }
//
dynamicObject = this->privData->dynamicObjects->begin(); // dynamicObject = this->privData->dynamicObjects->begin();
for( ; dynamicObject != this->privData->dynamicObjects->end(); ++dynamicObject ) // for( ; dynamicObject != this->privData->dynamicObjects->end(); ++dynamicObject )
{ // {
if( dynamicObject->second ) // if( dynamicObject->second )
{ // {
if( dynamicObject->second->getBRtype() == RB_Type_Cube) // if( dynamicObject->second->getBRtype() == RB_Type_Cube)
{ // {
Oyster::Graphics::API::RenderDebugCube( dynamicObject->second->getRBWorld()); // Oyster::Graphics::API::RenderDebugCube( dynamicObject->second->getRBWorld());
} // }
if( dynamicObject->second->getBRtype() == RB_Type_Sphere) // if( dynamicObject->second->getBRtype() == RB_Type_Sphere)
{ // {
Oyster::Graphics::API::RenderDebugSphere( dynamicObject->second->getRBWorld()); // Oyster::Graphics::API::RenderDebugSphere( dynamicObject->second->getRBWorld());
} // }
} // }
} // }
} //}
// !RB DEBUG // !RB DEBUG
Oyster::Graphics::API::EndFrame(); Oyster::Graphics::API::EndFrame();

View File

@ -23,7 +23,7 @@ using namespace GameLogic;
void Player::PlayerCollision(Oyster::Physics::ICustomBody *rigidBodyPlayer, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss) void Player::PlayerCollision(Oyster::Physics::ICustomBody *rigidBodyPlayer, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
{ {
Player *player = ((Game::PlayerData*)(rigidBodyPlayer->GetCustomTag()))->player; Player *player = ((Player*)(rigidBodyPlayer->GetCustomTag()));
Object *realObj = (Object*)obj->GetCustomTag(); //needs to be changed? Object *realObj = (Object*)obj->GetCustomTag(); //needs to be changed?
switch (realObj->GetObjectType()) switch (realObj->GetObjectType())