GL - make rigidbody level

This commit is contained in:
Erik Persson 2014-01-16 11:40:29 +01:00
parent 0080a9f6f2
commit 225d8912da
4 changed files with 22 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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> gameMode;
SmartPointer<Oyster::Physics::ICustomBody> rigidBodyLevel;
SmartPointer<ICustomBody> 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)

View File

@ -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