GL - added jumppad model and rigidbody

This commit is contained in:
lindaandersson 2014-02-12 13:37:21 +01:00
parent 14077c6d4e
commit 97c3097fc7
5 changed files with 21 additions and 7 deletions

View File

@ -140,6 +140,13 @@ bool GameState::LoadModels()
this->staticObjects.Push(new C_StaticObj());
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
// add jumppad
modelData.position = Oyster::Math::Float3(4, 600.3, 0);
modelData.modelPath = L"jumppad_round.dan";
modelData.id = id++;
// load models
this->staticObjects.Push(new C_StaticObj());
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
// add player model
modelData.position = Oyster::Math::Float3(0, 602, 0);
@ -157,13 +164,7 @@ bool GameState::LoadModels()
this->dynamicObjects.Push(new C_DynamicObj());
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
// add jumppad
modelData.position = Oyster::Math::Float3(4, 600.3, 0);
modelData.modelPath = L"jumppad_round.dan";
modelData.id = id++;
// load models
this->dynamicObjects.Push(new C_DynamicObj());
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
// add sky sphere
modelData.position = Oyster::Math::Float3(0,0,0);

View File

@ -40,6 +40,10 @@ using namespace GameLogic;
PlayerVObject(*player,*realObj, kineticEnergyLoss);
//player->playerState = PLAYER_STATE::PLAYER_STATE_WALKING;
break;
case OBJECT_TYPE::OBJECT_TYPE_JUMPPAD:
int i = 0;
// JUMP
break;
}
//return Physics::ICustomBody::SubscriptMessage_none;

View File

@ -27,6 +27,7 @@ namespace GameLogic
OBJECT_TYPE_BOX = 1,
OBJECT_TYPE_WORLD = 2,
OBJECT_TYPE_GENERIC = 4,
OBJECT_TYPE_JUMPPAD = 8,
OBJECT_TYPE_UNKNOWN = -1,
};

View File

@ -179,6 +179,13 @@ void Level::InitiateLevel(float radius)
this->staticObjects.Push(new StaticObject(rigidBody_House, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_GENERIC));
rigidBody_House->SetCustomTag(this->staticObjects[0]);
this->staticObjects[0]->objectID = idCount++;
// add jumppad
ICustomBody* rigidBody_Jumppad = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(4, 600.3, 0), 5, 0.5f, 0.8f, 0.6f);
this->staticObjects.Push(new JumpPad(rigidBody_Jumppad, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_JUMPPAD, Oyster::Math::Float3(0,1,0)));
rigidBody_Jumppad->SetCustomTag(this->staticObjects[1]);
this->staticObjects[1]->objectID = idCount++;
}
void Level::AddPlayerToTeam(Player *player, int teamID)

View File

@ -9,6 +9,7 @@
#include "StaticObject.h"
#include "DynamicObject.h"
#include "GameModeType.h"
#include "JumpPad.h"
#include "Player.h"
#include "PhysicsAPI.h"
#include "TeamManager.h"