GL - added jumppad model and rigidbody
This commit is contained in:
parent
14077c6d4e
commit
97c3097fc7
|
@ -140,6 +140,13 @@ bool GameState::LoadModels()
|
||||||
this->staticObjects.Push(new C_StaticObj());
|
this->staticObjects.Push(new C_StaticObj());
|
||||||
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
|
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
|
// add player model
|
||||||
modelData.position = Oyster::Math::Float3(0, 602, 0);
|
modelData.position = Oyster::Math::Float3(0, 602, 0);
|
||||||
|
@ -157,13 +164,7 @@ bool GameState::LoadModels()
|
||||||
this->dynamicObjects.Push(new C_DynamicObj());
|
this->dynamicObjects.Push(new C_DynamicObj());
|
||||||
this->dynamicObjects[this->dynamicObjects.Size() -1 ]->Init(modelData);
|
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
|
// add sky sphere
|
||||||
modelData.position = Oyster::Math::Float3(0,0,0);
|
modelData.position = Oyster::Math::Float3(0,0,0);
|
||||||
|
|
|
@ -40,6 +40,10 @@ using namespace GameLogic;
|
||||||
PlayerVObject(*player,*realObj, kineticEnergyLoss);
|
PlayerVObject(*player,*realObj, kineticEnergyLoss);
|
||||||
//player->playerState = PLAYER_STATE::PLAYER_STATE_WALKING;
|
//player->playerState = PLAYER_STATE::PLAYER_STATE_WALKING;
|
||||||
break;
|
break;
|
||||||
|
case OBJECT_TYPE::OBJECT_TYPE_JUMPPAD:
|
||||||
|
int i = 0;
|
||||||
|
// JUMP
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
//return Physics::ICustomBody::SubscriptMessage_none;
|
//return Physics::ICustomBody::SubscriptMessage_none;
|
||||||
|
|
|
@ -27,6 +27,7 @@ namespace GameLogic
|
||||||
OBJECT_TYPE_BOX = 1,
|
OBJECT_TYPE_BOX = 1,
|
||||||
OBJECT_TYPE_WORLD = 2,
|
OBJECT_TYPE_WORLD = 2,
|
||||||
OBJECT_TYPE_GENERIC = 4,
|
OBJECT_TYPE_GENERIC = 4,
|
||||||
|
OBJECT_TYPE_JUMPPAD = 8,
|
||||||
OBJECT_TYPE_UNKNOWN = -1,
|
OBJECT_TYPE_UNKNOWN = -1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -179,6 +179,13 @@ void Level::InitiateLevel(float radius)
|
||||||
this->staticObjects.Push(new StaticObject(rigidBody_House, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_GENERIC));
|
this->staticObjects.Push(new StaticObject(rigidBody_House, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_GENERIC));
|
||||||
rigidBody_House->SetCustomTag(this->staticObjects[0]);
|
rigidBody_House->SetCustomTag(this->staticObjects[0]);
|
||||||
this->staticObjects[0]->objectID = idCount++;
|
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)
|
void Level::AddPlayerToTeam(Player *player, int teamID)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "StaticObject.h"
|
#include "StaticObject.h"
|
||||||
#include "DynamicObject.h"
|
#include "DynamicObject.h"
|
||||||
#include "GameModeType.h"
|
#include "GameModeType.h"
|
||||||
|
#include "JumpPad.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "PhysicsAPI.h"
|
#include "PhysicsAPI.h"
|
||||||
#include "TeamManager.h"
|
#include "TeamManager.h"
|
||||||
|
|
Loading…
Reference in New Issue