diff --git a/Code/Game/GameLogic/CollisionManager.cpp b/Code/Game/GameLogic/CollisionManager.cpp index 698fb88f..a16d63fe 100644 --- a/Code/Game/GameLogic/CollisionManager.cpp +++ b/Code/Game/GameLogic/CollisionManager.cpp @@ -55,3 +55,8 @@ using namespace GameLogic; return Physics::ICustomBody::SubscriptMessage_none; } + + Oyster::Physics::ICustomBody::SubscriptMessage LevelCollision(const Oyster::Physics::ICustomBody *rigidBodyLevel, const Oyster::Physics::ICustomBody *obj) + { + return Physics::ICustomBody::SubscriptMessage_ignore_collision_response; + } diff --git a/Code/Game/GameLogic/CollisionManager.h b/Code/Game/GameLogic/CollisionManager.h index 18d482b4..21723885 100644 --- a/Code/Game/GameLogic/CollisionManager.h +++ b/Code/Game/GameLogic/CollisionManager.h @@ -14,7 +14,7 @@ namespace GameLogic //typedef SubscriptMessage (*EventAction_Collision)( const ICustomBody *proto, const ICustomBody *deuter ); static Oyster::Physics::ICustomBody::SubscriptMessage PlayerCollision(const Oyster::Physics::ICustomBody *rigidBodyPlayer, const Oyster::Physics::ICustomBody *obj); static Oyster::Physics::ICustomBody::SubscriptMessage BoxCollision(const Oyster::Physics::ICustomBody *rigidBodyBox, const Oyster::Physics::ICustomBody *obj); - + static Oyster::Physics::ICustomBody::SubscriptMessage LevelCollision(const Oyster::Physics::ICustomBody *rigidBodyLevel, const Oyster::Physics::ICustomBody *obj); //these are the specific collision case functions //void PlayerVBox(Player &player, DynamicObject &box); //void BoxVBox(DynamicObject &box1, DynamicObject &box2); diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index 9b3c90ff..81cad9e9 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -9,7 +9,7 @@ using namespace GameLogic; using namespace Utility::DynamicMemory; - +using namespace Oyster::Physics; struct Level::PrivateData { @@ -29,7 +29,7 @@ struct Level::PrivateData SmartPointer gameMode; - SmartPointer rigidBodyLevel; + SmartPointer rigidBodyLevel; }myData; @@ -47,6 +47,19 @@ Level::~Level(void) void Level::InitiateLevel(std::string levelPath) { +} +void Level::InitiateLevel(float radius) +{ + API::SphericalBodyDescription sbDesc; + sbDesc.centerPosition = Oyster::Math::Float4(0,0,0,0); + sbDesc.ignoreGravity = true; + sbDesc.radius = radius; + sbDesc.mass = 1e16; //10^20 + sbDesc.subscription = CollisionManager::LevelCollision; + + ICustomBody* rigidBody = API::Instance().CreateRigidBody(sbDesc).Release(); + + } void Level::AddPlayerToTeam(Player *player, int teamID) diff --git a/Code/Game/GameLogic/Level.h b/Code/Game/GameLogic/Level.h index fa450dc4..68dfca0f 100644 --- a/Code/Game/GameLogic/Level.h +++ b/Code/Game/GameLogic/Level.h @@ -21,6 +21,7 @@ namespace GameLogic * @param levelPath: Path to a file that contains all information on the level ********************************************************/ void InitiateLevel(std::string levelPath); + void Level::InitiateLevel(float radius); /******************************************************** * Creates a team in the level