GameLogic - fixed wrong pointer cast
This commit is contained in:
parent
b81995b84b
commit
89b73cdf01
|
@ -190,45 +190,45 @@ bool GameState::Render()
|
|||
}*/
|
||||
|
||||
// RB DEBUG render wire frame
|
||||
if(this->privData->renderWhireframe)
|
||||
{
|
||||
Oyster::Graphics::API::StartRenderWireFrame();
|
||||
|
||||
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 world = translation * scale;
|
||||
Oyster::Graphics::API::RenderDebugCube( world );
|
||||
Oyster::Graphics::API::RenderDebugCube(this->privData->player.getRBWorld());
|
||||
|
||||
staticObject = this->privData->staticObjects->begin();
|
||||
for( ; staticObject != this->privData->staticObjects->end(); ++staticObject )
|
||||
{
|
||||
if( staticObject->second->getBRtype() == RB_Type_Cube)
|
||||
{
|
||||
Oyster::Graphics::API::RenderDebugCube( staticObject->second->getRBWorld());
|
||||
}
|
||||
if( staticObject->second->getBRtype() == RB_Type_Sphere)
|
||||
{
|
||||
Oyster::Graphics::API::RenderDebugSphere( staticObject->second->getRBWorld());
|
||||
}
|
||||
}
|
||||
|
||||
dynamicObject = this->privData->dynamicObjects->begin();
|
||||
for( ; dynamicObject != this->privData->dynamicObjects->end(); ++dynamicObject )
|
||||
{
|
||||
if( dynamicObject->second )
|
||||
{
|
||||
if( dynamicObject->second->getBRtype() == RB_Type_Cube)
|
||||
{
|
||||
Oyster::Graphics::API::RenderDebugCube( dynamicObject->second->getRBWorld());
|
||||
}
|
||||
if( dynamicObject->second->getBRtype() == RB_Type_Sphere)
|
||||
{
|
||||
Oyster::Graphics::API::RenderDebugSphere( dynamicObject->second->getRBWorld());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//if(this->privData->renderWhireframe)
|
||||
//{
|
||||
// Oyster::Graphics::API::StartRenderWireFrame();
|
||||
//
|
||||
// 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 world = translation * scale;
|
||||
// Oyster::Graphics::API::RenderDebugCube( world );
|
||||
// Oyster::Graphics::API::RenderDebugCube(this->privData->player.getRBWorld());
|
||||
//
|
||||
// staticObject = this->privData->staticObjects->begin();
|
||||
// for( ; staticObject != this->privData->staticObjects->end(); ++staticObject )
|
||||
// {
|
||||
// if( staticObject->second->getBRtype() == RB_Type_Cube)
|
||||
// {
|
||||
// Oyster::Graphics::API::RenderDebugCube( staticObject->second->getRBWorld());
|
||||
// }
|
||||
// if( staticObject->second->getBRtype() == RB_Type_Sphere)
|
||||
// {
|
||||
// Oyster::Graphics::API::RenderDebugSphere( staticObject->second->getRBWorld());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// dynamicObject = this->privData->dynamicObjects->begin();
|
||||
// for( ; dynamicObject != this->privData->dynamicObjects->end(); ++dynamicObject )
|
||||
// {
|
||||
// if( dynamicObject->second )
|
||||
// {
|
||||
// if( dynamicObject->second->getBRtype() == RB_Type_Cube)
|
||||
// {
|
||||
// Oyster::Graphics::API::RenderDebugCube( dynamicObject->second->getRBWorld());
|
||||
// }
|
||||
// if( dynamicObject->second->getBRtype() == RB_Type_Sphere)
|
||||
// {
|
||||
// Oyster::Graphics::API::RenderDebugSphere( dynamicObject->second->getRBWorld());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// !RB DEBUG
|
||||
|
||||
Oyster::Graphics::API::EndFrame();
|
||||
|
|
|
@ -23,7 +23,7 @@ using namespace GameLogic;
|
|||
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?
|
||||
|
||||
switch (realObj->GetObjectType())
|
||||
|
|
Loading…
Reference in New Issue