GL collision with level should worm

This commit is contained in:
Erik Persson 2014-01-23 08:57:46 +01:00
parent 3f144289ec
commit 121fd51c45
5 changed files with 13 additions and 0 deletions

View File

@ -32,6 +32,9 @@ using namespace GameLogic;
case OBJECT_TYPE::OBJECT_TYPE_PLAYER:
//return Physics::ICustomBody::SubscriptMessage_none;
break;
case OBJECT_TYPE::OBJECT_TYPE_WORLD:
int test = 5;
break;
}
//return Physics::ICustomBody::SubscriptMessage_none;

View File

@ -26,8 +26,11 @@ void Level::InitiateLevel(float radius)
sbDesc.mass = 10e12f;
//sbDesc.mass = 0; //10^16
sbDesc.subscription_onCollisionResponse = Level::LevelCollision;
levelObj = new StaticObject(OBJECT_TYPE::OBJECT_TYPE_WORLD);
ICustomBody* rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
rigidBody->SetCustomTag(levelObj);
API::Instance().AddObject(rigidBody);
ICustomBody::State state;
rigidBody->GetState(state);

View File

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

View File

@ -14,6 +14,11 @@ StaticObject::StaticObject(void* collisionFunc, OBJECT_TYPE type)
:Object(collisionFunc,type)
{
}
StaticObject::StaticObject(OBJECT_TYPE type)
:Object(NULL,type)
{
}

View File

@ -17,6 +17,7 @@ namespace GameLogic
public:
StaticObject();
StaticObject(void* collisionFunc, OBJECT_TYPE type);
StaticObject(OBJECT_TYPE type);
~StaticObject(void);
private: