More merge conflicts untanglement

This commit is contained in:
Dander7BD 2014-02-27 11:46:58 +01:00
parent 96cb865242
commit 779b2ee00c
10 changed files with 8 additions and 224 deletions

View File

@ -752,7 +752,6 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
player = (this->privData->players)[decoded.objectID]; player = (this->privData->players)[decoded.objectID];
if( player ) if( player )
<<<<<<< HEAD
{ {
if( this->privData->myId == decoded.objectID ) if( this->privData->myId == decoded.objectID )
{ {
@ -793,15 +792,12 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
case GameLogic::PlayerAction::PlayerAction_Idle: case GameLogic::PlayerAction::PlayerAction_Idle:
player->playAnimation(L"idle", true); player->playAnimation(L"idle", true);
break; break;
case GameLogic::WeaponAction::WeaponAction_PrimaryShoot: case GameLogic::WeaponAction::WeaponAction_PrimaryShoot:
break; break;
case GameLogic::WeaponAction::WeaponAction_SecondaryShoot: case GameLogic::WeaponAction::WeaponAction_SecondaryShoot:
break; break;
case GameLogic::WeaponAction::WeaponAction_Reload: case GameLogic::WeaponAction::WeaponAction_Reload:
break; break;
default: default:
break; break;
} }
@ -821,76 +817,6 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
} }
if( object ) if( object )
{ {
=======
{
if( this->privData->myId == decoded.objectID )
{
// dont delete my player
}
if( player )
{
player->SetVisible(false);
(this->privData->players)[decoded.objectID].Release();
}
}
}
return GameClientState::event_processed;
case protocol_Gameplay_ObjectAction:
{
Protocol_ObjectAction decoded(data);
C_Player *player;
player = (this->privData->players)[decoded.objectID];
if( player )
{
if( this->privData->myId == decoded.objectID )
{
// my player animation
//}
//else
//{
// HACK for now animate my char
switch (decoded.animationID)
{
case GameLogic::PlayerAction::PlayerAction_Walk:
player->playAnimation(L"run_forwards", true);
break;
case GameLogic::PlayerAction::PlayerAction_Jump:
player->playAnimation(L"movement", true);
break;
case GameLogic::PlayerAction::PlayerAction_Idle:
player->playAnimation(L"idle", true);
break;
case GameLogic::WeaponAction::WeaponAction_PrimaryShoot:
break;
case GameLogic::WeaponAction::WeaponAction_SecondaryShoot:
break;
case GameLogic::WeaponAction::WeaponAction_Reload:
break;
default:
break;
}
}
}
}
return GameClientState::event_processed;
case protocol_Gameplay_ObjectCollision:
{
Protocol_ObjectCollision decoded(data);
C_Object *object;
object = (this->privData->players)[decoded.objectID];
if( !object)
{
// if it is not a player
object = (*this->privData->dynamicObjects)[decoded.objectID];
}
if( object )
{
>>>>>>> origin/New-inputsystem
switch (decoded.collisionID) switch (decoded.collisionID)
{ {
case GameLogic::CollisionEvent::CollisionEvent_BasicCollision: case GameLogic::CollisionEvent::CollisionEvent_BasicCollision:

View File

@ -218,8 +218,3 @@ void GamingUI::OnMouseMoveVelocity ( Input::Struct::SAIPointInt2D coordinate, In
} }
} }
} }
<<<<<<< HEAD
=======
>>>>>>> origin/New-inputsystem

View File

@ -30,11 +30,7 @@ namespace GameLogic
typedef void(*ObjectEnabledFunction)(IObjectData* object); // Callback method that recieves and object typedef void(*ObjectEnabledFunction)(IObjectData* object); // Callback method that recieves and object
typedef void(*ObjectHpFunction)(IObjectData* object, float hp); // Callback method that sends obj HP typedef void(*ObjectHpFunction)(IObjectData* object, float hp); // Callback method that sends obj HP
typedef void(*ObjectRespawnedFunction)(IObjectData* object, Oyster::Math::Float3 spawnPos ); // Callback method that sends spawnPos typedef void(*ObjectRespawnedFunction)(IObjectData* object, Oyster::Math::Float3 spawnPos ); // Callback method that sends spawnPos
<<<<<<< HEAD
typedef void(*ObjectDeadFunction)(IObjectData* victim, IObjectData* killer, float seconds); // Callback method that sends killer and death timer typedef void(*ObjectDeadFunction)(IObjectData* victim, IObjectData* killer, float seconds); // Callback method that sends killer and death timer
=======
typedef void(*ObjectDeadFunction)(IObjectData* object, IObjectData* killer, float seconds); // Callback method that sends death timer
>>>>>>> origin/New-inputsystem
typedef void(*PickupEventFunction)(IObjectData* player, int pickupEffectID ); // Callback method that sends killer and death timer typedef void(*PickupEventFunction)(IObjectData* player, int pickupEffectID ); // Callback method that sends killer and death timer
typedef void(*AnimationEventFunction)(IObjectData* player, int actionID ); // Callback method that sends killer and death timer typedef void(*AnimationEventFunction)(IObjectData* player, int actionID ); // Callback method that sends killer and death timer
typedef void(*CollisionEventFunction)(IObjectData*object, int collisionID); typedef void(*CollisionEventFunction)(IObjectData*object, int collisionID);

View File

@ -54,18 +54,13 @@ void Player::initPlayerData()
this->playerStats.hp = MAX_HP; this->playerStats.hp = MAX_HP;
this->playerStats.movementSpeed = BASIC_SPEED; this->playerStats.movementSpeed = BASIC_SPEED;
this->playerState = PLAYER_STATE_IDLE; this->playerState = PLAYER_STATE_IDLE;
<<<<<<< HEAD
this->lookDir = Float3( 0.0f, 0.0f, -1.0f ); this->lookDir = Float3( 0.0f, 0.0f, -1.0f );
=======
this->lookDir = Oyster::Math::Float3(0,0,-1);
>>>>>>> origin/New-inputsystem
this->key_forward = 0; this->key_forward = 0;
this->key_backward = 0; this->key_backward = 0;
this->key_strafeRight = 0; this->key_strafeRight = 0;
this->key_strafeLeft = 0; this->key_strafeLeft = 0;
this->key_jump = 0; this->key_jump = 0;
<<<<<<< HEAD
this->RecentlyAffected = 0; this->RecentlyAffected = 0;
this->deathTimer = 0; this->deathTimer = 0;
@ -75,20 +70,11 @@ void Player::initPlayerData()
state.staticFrictionCoeff = 0.0f; state.staticFrictionCoeff = 0.0f;
state.dynamicFrictionCoeff = 0.0f; state.dynamicFrictionCoeff = 0.0f;
this->rigidBody->SetState( state ); this->rigidBody->SetState( state );
=======
this->deathTimer = 0;
this->rotationUp = 0;
>>>>>>> origin/New-inputsystem
} }
void Player::BeginFrame() void Player::BeginFrame()
{ {
<<<<<<< HEAD if( this->playerState & (PLAYER_STATE_DEAD | PLAYER_STATE_DIED) )
if( this->playerState != PLAYER_STATE_DEAD && this->playerState != PLAYER_STATE_DIED )
=======
if( this->playerState != PLAYER_STATE_DEAD && PLAYER_STATE_DIED)
>>>>>>> origin/New-inputsystem
{ {
static const Float maxSpeed = 30.0f; static const Float maxSpeed = 30.0f;
@ -96,11 +82,7 @@ void Player::BeginFrame()
// Rotate player accordingly // Rotate player accordingly
this->rigidBody->AddRotationAroundY(this->rotationUp); this->rigidBody->AddRotationAroundY(this->rotationUp);
this->rigidBody->SetUp(this->rigidBody->GetState().centerPos.GetNormalized()); this->rigidBody->SetUp( this->rigidBody->GetState().centerPos.GetNormalized() );
<<<<<<< HEAD
this->rotationUp = 0;
=======
>>>>>>> origin/New-inputsystem
// Direction data // Direction data
Oyster::Math::Float4x4 orientation; Oyster::Math::Float4x4 orientation;
@ -119,15 +101,10 @@ void Player::BeginFrame()
Float3 upVelocity = linearVelocity * Float3(fabs(upDir.x), fabs(upDir.y), fabs(upDir.z) ); Float3 upVelocity = linearVelocity * Float3(fabs(upDir.x), fabs(upDir.y), fabs(upDir.z) );
// Walking data // Walking data
<<<<<<< HEAD
Float3 walkDirection = Float3( 0.0f ); Float3 walkDirection = Float3( 0.0f );
Float &walkSpeed = this->playerStats.movementSpeed; Float &walkSpeed = this->playerStats.movementSpeed;
Float frameTime = gameInstance->GetFrameTime(); Float frameTime = gameInstance->GetFrameTime();
=======
Oyster::Math::Float3 walkDirection = Oyster::Math::Float3(0.0, 0.0, 0.0);
Oyster::Math::Float walkSpeed = this->playerStats.movementSpeed*0.2f;
>>>>>>> origin/New-inputsystem
// Check for input // Check for input
if(key_forward > 0.001) if(key_forward > 0.001)
@ -152,11 +129,7 @@ void Player::BeginFrame()
} }
// Dampen velocity if certain keys are not pressed // Dampen velocity if certain keys are not pressed
<<<<<<< HEAD
if( key_jump <= 0.001 && IsWalking() ) if( key_jump <= 0.001 && IsWalking() )
=======
if(key_jump <= 0.001 && IsWalking())
>>>>>>> origin/New-inputsystem
{ {
if(key_forward <= 0.001 && key_backward <= 0.001) if(key_forward <= 0.001 && key_backward <= 0.001)
{ {
@ -168,21 +141,7 @@ void Player::BeginFrame()
} }
} }
<<<<<<< HEAD
if( walkDirection == Float3::null ) if( walkDirection == Float3::null )
=======
if(walkDirection == Oyster::Math::Float3::null)
{
if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING)
{
if(this->playerState != PLAYER_STATE::PLAYER_STATE_IDLE)
this->gameInstance->onActionEventFnc( this, PlayerAction::PlayerAction_Idle);
this->playerState = PLAYER_STATE::PLAYER_STATE_IDLE;
}
}
// Walk if walkdirection is something
if(walkDirection != Oyster::Math::Float3::null)
>>>>>>> origin/New-inputsystem
{ {
if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING) if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING)
{ {
@ -209,7 +168,7 @@ void Player::BeginFrame()
} }
// If in the air, accelerate slower // If in the air, accelerate slower
if(IsJumping()) if( IsJumping() )
{ {
if(forwardSpeed < maxSpeed) if(forwardSpeed < maxSpeed)
{ {
@ -220,10 +179,6 @@ void Player::BeginFrame()
rightVelocity += walkDirection*Oyster::Math::Float3(fabs(rightDir.x), fabs(rightDir.y), fabs(rightDir.z)) * walkSpeed*0.2f; rightVelocity += walkDirection*Oyster::Math::Float3(fabs(rightDir.x), fabs(rightDir.y), fabs(rightDir.z)) * walkSpeed*0.2f;
} }
} }
<<<<<<< HEAD
=======
>>>>>>> origin/New-inputsystem
if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING) if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING)
{ {
if(this->playerState != PLAYER_STATE::PLAYER_STATE_WALKING) if(this->playerState != PLAYER_STATE::PLAYER_STATE_WALKING)
@ -242,13 +197,8 @@ void Player::BeginFrame()
//Jump //Jump
if(key_jump > 0.001) if(key_jump > 0.001)
{ {
<<<<<<< HEAD
this->key_jump -= this->gameInstance->GetFrameTime(); this->key_jump -= this->gameInstance->GetFrameTime();
if(IsWalking()) if(IsWalking())
=======
this->key_jump -= this->gameInstance->GetFrameTime();
if(IsWalking())
>>>>>>> origin/New-inputsystem
{ {
Oyster::Math::Float3 up = this->rigidBody->GetState().centerPos.GetNormalized(); Oyster::Math::Float3 up = this->rigidBody->GetState().centerPos.GetNormalized();
this->rigidBody->ApplyImpulse(up*this->rigidBody->GetState().mass * 20); this->rigidBody->ApplyImpulse(up*this->rigidBody->GetState().mass * 20);
@ -269,13 +219,7 @@ void Player::BeginFrame()
} }
} }
<<<<<<< HEAD
void Player::EndFrame()
{
}
=======
void Player::EndFrame() { /* do nothing .. for now */ } void Player::EndFrame() { /* do nothing .. for now */ }
>>>>>>> origin/New-inputsystem
void Player::Move(const PLAYER_MOVEMENT &movement) void Player::Move(const PLAYER_MOVEMENT &movement)
{ {
@ -399,7 +343,6 @@ PLAYER_STATE Player::GetState() const
void Player::DamageLife(int damage) void Player::DamageLife(int damage)
{ {
<<<<<<< HEAD
if(damage != 0) if(damage != 0)
{ {
this->playerStats.hp -= damage; this->playerStats.hp -= damage;
@ -415,33 +358,7 @@ void Player::DamageLife(int damage)
this->playerStats.hp = 0; this->playerStats.hp = 0;
this->playerState = PLAYER_STATE_DIED; this->playerState = PLAYER_STATE_DIED;
} }
=======
this->playerStats.hp -= damage;
// send hp to client
this->gameInstance->onDamageTakenFnc( this, this->playerStats.hp);
if(this->playerStats.hp <= 0)
{
this->playerStats.hp = 0;
this->playerState = PLAYER_STATE_DIED;
} }
}
bool Player::deathTimerTick(float dt)
{
this->deathTimer -= dt;
if( this->deathTimer <= 0)
{
return true;
>>>>>>> origin/New-inputsystem
}
return false;
}
void Player::setDeathTimer(float deathTimer)
{
this->deathTimer = deathTimer;
this->playerState = PLAYER_STATE_DEAD;
} }
bool Player::deathTimerTick(float dt) bool Player::deathTimerTick(float dt)

View File

@ -10,11 +10,7 @@
#include "DynamicArray.h" #include "DynamicArray.h"
const float MAX_HP = 100.0f; const float MAX_HP = 100.0f;
<<<<<<< HEAD const float BASIC_SPEED = 30.0f * 0.2f;
const float BASIC_SPEED = 30.0f;// * 0.2f;
=======
const float BASIC_SPEED = 30.0f;
>>>>>>> origin/New-inputsystem
namespace GameLogic namespace GameLogic
{ {

View File

@ -102,11 +102,7 @@ namespace DanBias
static void ObjectEnabled ( GameLogic::IObjectData* movedObject ); static void ObjectEnabled ( GameLogic::IObjectData* movedObject );
static void ObjectDamaged ( GameLogic::IObjectData* movedObject, float hp ); static void ObjectDamaged ( GameLogic::IObjectData* movedObject, float hp );
static void ObjectRespawned ( GameLogic::IObjectData* movedObject, Oyster::Math::Float3 spawnPos ); static void ObjectRespawned ( GameLogic::IObjectData* movedObject, Oyster::Math::Float3 spawnPos );
<<<<<<< HEAD
static void ObjectDead ( GameLogic::IObjectData* victim, GameLogic::IObjectData* killer, float seconds ); static void ObjectDead ( GameLogic::IObjectData* victim, GameLogic::IObjectData* killer, float seconds );
=======
static void ObjectDead ( GameLogic::IObjectData* movedObject, GameLogic::IObjectData* killer, float seconds );
>>>>>>> origin/New-inputsystem
static void PickupEvent ( GameLogic::IObjectData* movedObject, int pickupEffectID ); static void PickupEvent ( GameLogic::IObjectData* movedObject, int pickupEffectID );
static void ActionEvent ( GameLogic::IObjectData* movedObject , int actionID ); static void ActionEvent ( GameLogic::IObjectData* movedObject , int actionID );
static void CollisionEvent ( GameLogic::IObjectData* Object , int collisionID ); static void CollisionEvent ( GameLogic::IObjectData* Object , int collisionID );

View File

@ -162,11 +162,7 @@ using namespace DanBias;
{ {
GameSession::gameSession->Send(Protocol_ObjectRespawn(movedObject->GetID(), spawnPos).GetProtocol()); GameSession::gameSession->Send(Protocol_ObjectRespawn(movedObject->GetID(), spawnPos).GetProtocol());
} }
<<<<<<< HEAD
void GameSession::ObjectDead( GameLogic::IObjectData* victim, GameLogic::IObjectData* killer, float seconds ) void GameSession::ObjectDead( GameLogic::IObjectData* victim, GameLogic::IObjectData* killer, float seconds )
=======
void GameSession::ObjectDead( GameLogic::IObjectData* movedObject, GameLogic::IObjectData* killer, float seconds )
>>>>>>> origin/New-inputsystem
{ {
GameSession::gameSession->Send(Protocol_ObjectDie(victim->GetID(), killer->GetID(), seconds).GetProtocol()); GameSession::gameSession->Send(Protocol_ObjectDie(victim->GetID(), killer->GetID(), seconds).GetProtocol());
} }
@ -185,21 +181,7 @@ using namespace DanBias;
// send action protocol // send action protocol
GameSession::gameSession->Send(Protocol_ObjectCollision(movedObject->GetID(), collisionID).GetProtocol()); GameSession::gameSession->Send(Protocol_ObjectCollision(movedObject->GetID(), collisionID).GetProtocol());
} }
void GameSession::PickupEvent( GameLogic::IObjectData* movedObject, int pickupEffectID )
{
// send pickup protocol
GameSession::gameSession->Send(Protocol_ObjectPickup(movedObject->GetID(), pickupEffectID).GetProtocol());
}
void GameSession::ActionEvent( GameLogic::IObjectData* movedObject , int actionID )
{
// send action protocol
GameSession::gameSession->Send(Protocol_ObjectAction(movedObject->GetID(), actionID).GetProtocol());
}
void GameSession::CollisionEvent( GameLogic::IObjectData* movedObject , int collisionID )
{
// send action protocol
GameSession::gameSession->Send(Protocol_ObjectCollision(movedObject->GetID(), collisionID).GetProtocol());
}
//*****************************************************// //*****************************************************//
//****************** Protocol methods *****************// //****************** Protocol methods *****************//
//******************************************************************************************************************// //******************************************************************************************************************//

View File

@ -68,7 +68,7 @@ void API_Impl::SetGravity(float gravity)
// Bullet physics // Bullet physics
ICustomBody* API_Impl::AddCollisionSphere(float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction) ICustomBody* API_Impl::AddCollisionSphere(float radius, ::Oyster::Math::Float4 rotation, ::Oyster::Math::Float3 position, float mass, float restitution, float staticFriction, float dynamicFriction)
{ {
SimpleRigidBody* body = new SimpleRigidBody; SimpleRigidBody* body = new SimpleRigidBody();
SimpleRigidBody::State state; SimpleRigidBody::State state;
// Add collision shape // Add collision shape

View File

@ -239,7 +239,6 @@ void SimpleRigidBody::SetUp(::Oyster::Math::Float3 up)
btQuaternion newRotation; btQuaternion newRotation;
btTransform trans; btTransform trans;
trans = this->rigidBody->getWorldTransform(); trans = this->rigidBody->getWorldTransform();
<<<<<<< HEAD
btVector3 v1 = trans.getBasis().getColumn(1); btVector3 v1 = trans.getBasis().getColumn(1);
btVector3 v2(up.x, up.y, up.z); btVector3 v2(up.x, up.y, up.z);
@ -248,35 +247,17 @@ void SimpleRigidBody::SetUp(::Oyster::Math::Float3 up)
btVector3 a = v1.cross(v2); btVector3 a = v1.cross(v2);
if (v1.dot(v2) < -0.999999) if (v1.dot(v2) < -0.999999)
=======
btVector3 v1 = trans.getBasis().getColumn(1);
btVector3 v2(up.x, up.y, up.z);
btQuaternion q;
btVector3 a = v1.cross(v2);
if (v1.dot(v2) < -0.999999)
>>>>>>> origin/New-inputsystem
{ {
btVector3 xCrossPre = btVector3(1, 0 ,0).cross(v1); btVector3 xCrossPre = btVector3(1, 0 ,0).cross(v1);
if(xCrossPre.length() < 0.000001) if(xCrossPre.length() < 0.000001)
xCrossPre = btVector3(0, 1 ,0).cross(v1); xCrossPre = btVector3(0, 1 ,0).cross(v1);
xCrossPre.normalize(); xCrossPre.normalize();
q.setRotation(xCrossPre, 3.1415); q.setRotation(xCrossPre, 3.1415);
<<<<<<< HEAD
}
else if (v1.dot(v2) > 0.999999)
{
q = btQuaternion(0, 0, 0, 1);
}
=======
} }
else if (v1.dot(v2) > 0.999999) else if (v1.dot(v2) > 0.999999)
{ {
q = btQuaternion(0, 0, 0, 1); q = btQuaternion(0, 0, 0, 1);
} }
>>>>>>> origin/New-inputsystem
else else
{ {
q.setX(a.x()); q.setX(a.x());

View File

@ -29,11 +29,8 @@ namespace Oyster
void SetRotation(Math::Quaternion quaternion); void SetRotation(Math::Quaternion quaternion);
void SetRotation(Math::Float3 eulerAngles); void SetRotation(Math::Float3 eulerAngles);
void SetRotation(::Oyster::Math::Float4x4 rotation); void SetRotation(::Oyster::Math::Float4x4 rotation);
<<<<<<< HEAD
void AddRotationAroundY(::Oyster::Math::Float angle);
=======
void AddRotationAroundY(Math::Float angle); void AddRotationAroundY(Math::Float angle);
>>>>>>> origin/New-inputsystem
void SetAngularFactor(Math::Float factor); void SetAngularFactor(Math::Float factor);
void SetMass(Math::Float mass); void SetMass(Math::Float mass);
@ -62,8 +59,6 @@ namespace Oyster
void SetCustomTag( void *ref ); void SetCustomTag( void *ref );
void* GetCustomTag() const; void* GetCustomTag() const;
// Class specific // Class specific
void SetCollisionShape(btCollisionShape* shape); void SetCollisionShape(btCollisionShape* shape);
void SetMotionState(btDefaultMotionState* motionState); void SetMotionState(btDefaultMotionState* motionState);