Merge branch 'GameLogic' of https://github.com/dean11/Danbias into GameLogic

Conflicts:
	Code/Game/GameLogic/AttatchmentMassDriver.cpp
	Code/Game/GameLogic/Game_PlayerData.cpp
	Code/Game/GameLogic/Level.cpp
This commit is contained in:
Erik Persson 2014-01-31 14:16:32 +01:00
commit 16f535bfa3
5 changed files with 31 additions and 5 deletions

View File

@ -88,6 +88,8 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key
// send data to server // send data to server
// check data from server // check data from server
// create game // create game
if( KeyInput->IsKeyPressed(DIK_C)) if( KeyInput->IsKeyPressed(DIK_C))
{ {
@ -118,6 +120,9 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key
} }
return ClientState_Lobby; return ClientState_Lobby;
} }
return ClientState_Same; return ClientState_Same;
} }
bool LoginState::Render() bool LoginState::Render()

View File

@ -46,8 +46,17 @@ void AttatchmentMassDriver::UseAttatchment(const GameLogic::WEAPON_FIRE &usage,
********************************************************/ ********************************************************/
void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float dt) void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float dt)
{ {
<<<<<<< HEAD
Oyster::Math::Float4 pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (500 * dt); Oyster::Math::Float4 pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (500 * dt);
Oyster::Math::Float4x4 aim = Oyster::Math3D::ViewMatrix_LookAtDirection(owner->GetLookDir(), owner->GetRigidBody()->GetGravityNormal(), owner->GetPosition()); Oyster::Math::Float4x4 aim = Oyster::Math3D::ViewMatrix_LookAtDirection(owner->GetLookDir(), owner->GetRigidBody()->GetGravityNormal(), owner->GetPosition());
=======
//Oyster::Math::Float4 pushForce = Oyster::Math::Float4(this->owner->GetLookDir()) * (500 * dt);
Oyster::Math::Float3 look = owner->GetLookDir();
Oyster::Math::Float3 up = -owner->GetRigidBody()->GetGravityNormal();
Oyster::Math::Float3 pos = owner->GetPosition();
Oyster::Math::Float4x4 aim = Oyster::Math3D::OrientationMatrix_LookAtDirection(owner->GetLookDir(), -owner->GetRigidBody()->GetGravityNormal(), owner->GetPosition());
>>>>>>> e3376eba7c97c866917da6737d311f6b99240075
Oyster::Math::Float4x4 hitSpace = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/4,1,1,20); Oyster::Math::Float4x4 hitSpace = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/4,1,1,20);
Oyster::Collision3D::Frustrum hitFrustum = Oyster::Collision3D::Frustrum(Oyster::Math3D::ViewProjectionMatrix(aim,hitSpace)); Oyster::Collision3D::Frustrum hitFrustum = Oyster::Collision3D::Frustrum(Oyster::Math3D::ViewProjectionMatrix(aim,hitSpace));
forcePushData args; forcePushData args;

View File

@ -20,7 +20,6 @@ using namespace GameLogic;
Player *player = ((Game::PlayerData*)(rigidBodyPlayer->GetCustomTag()))->player; Player *player = ((Game::PlayerData*)(rigidBodyPlayer->GetCustomTag()))->player;
Object *realObj = (Object*)obj->GetCustomTag(); //needs to be changed? Object *realObj = (Object*)obj->GetCustomTag(); //needs to be changed?
return;
switch (realObj->GetObjectType()) switch (realObj->GetObjectType())
{ {
case OBJECT_TYPE::OBJECT_TYPE_GENERIC: case OBJECT_TYPE::OBJECT_TYPE_GENERIC:
@ -69,6 +68,10 @@ using namespace GameLogic;
{ {
return Physics::ICustomBody::SubscriptMessage_none; return Physics::ICustomBody::SubscriptMessage_none;
} }
Oyster::Physics::ICustomBody::SubscriptMessage Object::DefaultCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
{
return Physics::ICustomBody::SubscriptMessage_none;
}
//Oyster::Physics::ICustomBody::SubscriptMessage //Oyster::Physics::ICustomBody::SubscriptMessage
Oyster::Physics::ICustomBody::SubscriptMessage Level::LevelCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj) Oyster::Physics::ICustomBody::SubscriptMessage Level::LevelCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj)
{ {

View File

@ -7,9 +7,13 @@ Game::PlayerData::PlayerData()
{ {
//set some stats that are appropriate to a player //set some stats that are appropriate to a player
Oyster::Physics::API::SimpleBodyDescription sbDesc; Oyster::Physics::API::SimpleBodyDescription sbDesc;
sbDesc.centerPosition = Oyster::Math::Float3(0,320,0); sbDesc.centerPosition = Oyster::Math::Float3(10,350,0);
sbDesc.size = Oyster::Math::Float3(4,7,4); sbDesc.size = Oyster::Math::Float3(4,7,4);
<<<<<<< HEAD
sbDesc.mass = 90; sbDesc.mass = 90;
=======
sbDesc.mass = 70;
>>>>>>> e3376eba7c97c866917da6737d311f6b99240075
//create rigid body //create rigid body
Oyster::Physics::ICustomBody *rigidBody = Oyster::Physics::API::Instance().CreateRigidBody(sbDesc).Release(); Oyster::Physics::ICustomBody *rigidBody = Oyster::Physics::API::Instance().CreateRigidBody(sbDesc).Release();

View File

@ -41,18 +41,23 @@ void Level::InitiateLevel(float radius)
// add box // add box
API::SimpleBodyDescription sbDesc_TestBox; API::SimpleBodyDescription sbDesc_TestBox;
sbDesc_TestBox.centerPosition = Oyster::Math::Float4(4,320,0,0); sbDesc_TestBox.centerPosition = Oyster::Math::Float4(0,320,0,0);
sbDesc_TestBox.ignoreGravity = false; sbDesc_TestBox.ignoreGravity = false;
<<<<<<< HEAD
sbDesc_TestBox.mass = 10; sbDesc_TestBox.mass = 10;
sbDesc_TestBox.size = Oyster::Math::Float4(4,4,4,0); sbDesc_TestBox.size = Oyster::Math::Float4(4,4,4,0);
=======
sbDesc_TestBox.mass = 50;
sbDesc_TestBox.size = Oyster::Math::Float4(1,1,1,0);
>>>>>>> e3376eba7c97c866917da6737d311f6b99240075
ICustomBody* rigidBody_TestBox = API::Instance().CreateRigidBody(sbDesc_TestBox).Release(); ICustomBody* rigidBody_TestBox = API::Instance().CreateRigidBody(sbDesc_TestBox).Release();
rigidBody_TestBox->SetSubscription(Level::PhysicsOnMoveLevel); rigidBody_TestBox->SetSubscription(Level::PhysicsOnMoveLevel);
testBox = new DynamicObject(rigidBody_TestBox, OBJECT_TYPE::OBJECT_TYPE_BOX); testBox = new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX);
rigidBody_TestBox->SetCustomTag(testBox); rigidBody_TestBox->SetCustomTag(testBox);
rigidBody_TestBox->GetState(state); rigidBody_TestBox->GetState(state);
state.ApplyLinearImpulse(Oyster::Math::Float3(0,20,0)); state.ApplyLinearImpulse(Oyster::Math::Float3(0,0,0));
rigidBody_TestBox->SetState(state); rigidBody_TestBox->SetState(state);