More merge conflicts untanglement
This commit is contained in:
parent
96cb865242
commit
779b2ee00c
|
@ -752,7 +752,6 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
|
|||
player = (this->privData->players)[decoded.objectID];
|
||||
|
||||
if( player )
|
||||
<<<<<<< HEAD
|
||||
{
|
||||
if( this->privData->myId == decoded.objectID )
|
||||
{
|
||||
|
@ -793,15 +792,12 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
|
|||
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;
|
||||
}
|
||||
|
@ -821,76 +817,6 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState
|
|||
}
|
||||
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)
|
||||
{
|
||||
case GameLogic::CollisionEvent::CollisionEvent_BasicCollision:
|
||||
|
|
|
@ -217,9 +217,4 @@ void GamingUI::OnMouseMoveVelocity ( Input::Struct::SAIPointInt2D coordinate, In
|
|||
this->sharedData->network->Send( Protocol_PlayerLeftTurn((coordinate.x) * this->sharedData->mouseSensitivity, this->camera->GetLook()) );
|
||||
}
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> origin/New-inputsystem
|
||||
}
|
|
@ -30,11 +30,7 @@ namespace GameLogic
|
|||
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(*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* 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(*AnimationEventFunction)(IObjectData* player, int actionID ); // Callback method that sends killer and death timer
|
||||
typedef void(*CollisionEventFunction)(IObjectData*object, int collisionID);
|
||||
|
|
|
@ -54,18 +54,13 @@ void Player::initPlayerData()
|
|||
this->playerStats.hp = MAX_HP;
|
||||
this->playerStats.movementSpeed = BASIC_SPEED;
|
||||
this->playerState = PLAYER_STATE_IDLE;
|
||||
<<<<<<< HEAD
|
||||
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_backward = 0;
|
||||
this->key_strafeRight = 0;
|
||||
this->key_strafeLeft = 0;
|
||||
this->key_jump = 0;
|
||||
<<<<<<< HEAD
|
||||
this->RecentlyAffected = 0;
|
||||
this->deathTimer = 0;
|
||||
|
||||
|
@ -75,20 +70,11 @@ void Player::initPlayerData()
|
|||
state.staticFrictionCoeff = 0.0f;
|
||||
state.dynamicFrictionCoeff = 0.0f;
|
||||
this->rigidBody->SetState( state );
|
||||
=======
|
||||
this->deathTimer = 0;
|
||||
|
||||
this->rotationUp = 0;
|
||||
>>>>>>> origin/New-inputsystem
|
||||
}
|
||||
|
||||
void Player::BeginFrame()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if( this->playerState != PLAYER_STATE_DEAD && this->playerState != PLAYER_STATE_DIED )
|
||||
=======
|
||||
if( this->playerState != PLAYER_STATE_DEAD && PLAYER_STATE_DIED)
|
||||
>>>>>>> origin/New-inputsystem
|
||||
if( this->playerState & (PLAYER_STATE_DEAD | PLAYER_STATE_DIED) )
|
||||
{
|
||||
static const Float maxSpeed = 30.0f;
|
||||
|
||||
|
@ -96,11 +82,7 @@ void Player::BeginFrame()
|
|||
|
||||
// Rotate player accordingly
|
||||
this->rigidBody->AddRotationAroundY(this->rotationUp);
|
||||
this->rigidBody->SetUp(this->rigidBody->GetState().centerPos.GetNormalized());
|
||||
<<<<<<< HEAD
|
||||
this->rotationUp = 0;
|
||||
=======
|
||||
>>>>>>> origin/New-inputsystem
|
||||
this->rigidBody->SetUp( this->rigidBody->GetState().centerPos.GetNormalized() );
|
||||
|
||||
// Direction data
|
||||
Oyster::Math::Float4x4 orientation;
|
||||
|
@ -119,15 +101,10 @@ void Player::BeginFrame()
|
|||
Float3 upVelocity = linearVelocity * Float3(fabs(upDir.x), fabs(upDir.y), fabs(upDir.z) );
|
||||
|
||||
// Walking data
|
||||
<<<<<<< HEAD
|
||||
Float3 walkDirection = Float3( 0.0f );
|
||||
Float &walkSpeed = this->playerStats.movementSpeed;
|
||||
|
||||
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
|
||||
if(key_forward > 0.001)
|
||||
|
@ -152,11 +129,7 @@ void Player::BeginFrame()
|
|||
}
|
||||
|
||||
// Dampen velocity if certain keys are not pressed
|
||||
<<<<<<< HEAD
|
||||
if( key_jump <= 0.001 && IsWalking() )
|
||||
=======
|
||||
if(key_jump <= 0.001 && IsWalking())
|
||||
>>>>>>> origin/New-inputsystem
|
||||
{
|
||||
if(key_forward <= 0.001 && key_backward <= 0.001)
|
||||
{
|
||||
|
@ -168,21 +141,7 @@ void Player::BeginFrame()
|
|||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
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)
|
||||
{
|
||||
|
@ -209,7 +168,7 @@ void Player::BeginFrame()
|
|||
}
|
||||
|
||||
// If in the air, accelerate slower
|
||||
if(IsJumping())
|
||||
if( IsJumping() )
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> origin/New-inputsystem
|
||||
if(this->playerState != PLAYER_STATE::PLAYER_STATE_JUMPING)
|
||||
{
|
||||
if(this->playerState != PLAYER_STATE::PLAYER_STATE_WALKING)
|
||||
|
@ -242,13 +197,8 @@ void Player::BeginFrame()
|
|||
//Jump
|
||||
if(key_jump > 0.001)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
this->key_jump -= this->gameInstance->GetFrameTime();
|
||||
if(IsWalking())
|
||||
=======
|
||||
this->key_jump -= this->gameInstance->GetFrameTime();
|
||||
if(IsWalking())
|
||||
>>>>>>> origin/New-inputsystem
|
||||
{
|
||||
Oyster::Math::Float3 up = this->rigidBody->GetState().centerPos.GetNormalized();
|
||||
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 */ }
|
||||
>>>>>>> origin/New-inputsystem
|
||||
|
||||
void Player::Move(const PLAYER_MOVEMENT &movement)
|
||||
{
|
||||
|
@ -399,7 +343,6 @@ PLAYER_STATE Player::GetState() const
|
|||
|
||||
void Player::DamageLife(int damage)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
if(damage != 0)
|
||||
{
|
||||
this->playerStats.hp -= damage;
|
||||
|
@ -415,33 +358,7 @@ void Player::DamageLife(int damage)
|
|||
this->playerStats.hp = 0;
|
||||
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)
|
||||
|
|
|
@ -10,11 +10,7 @@
|
|||
#include "DynamicArray.h"
|
||||
|
||||
const float MAX_HP = 100.0f;
|
||||
<<<<<<< HEAD
|
||||
const float BASIC_SPEED = 30.0f;// * 0.2f;
|
||||
=======
|
||||
const float BASIC_SPEED = 30.0f;
|
||||
>>>>>>> origin/New-inputsystem
|
||||
const float BASIC_SPEED = 30.0f * 0.2f;
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
|
|
|
@ -102,11 +102,7 @@ namespace DanBias
|
|||
static void ObjectEnabled ( GameLogic::IObjectData* movedObject );
|
||||
static void ObjectDamaged ( GameLogic::IObjectData* movedObject, float hp );
|
||||
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* movedObject, GameLogic::IObjectData* killer, float seconds );
|
||||
>>>>>>> origin/New-inputsystem
|
||||
static void PickupEvent ( GameLogic::IObjectData* movedObject, int pickupEffectID );
|
||||
static void ActionEvent ( GameLogic::IObjectData* movedObject , int actionID );
|
||||
static void CollisionEvent ( GameLogic::IObjectData* Object , int collisionID );
|
||||
|
|
|
@ -162,11 +162,7 @@ using namespace DanBias;
|
|||
{
|
||||
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* movedObject, GameLogic::IObjectData* killer, float seconds )
|
||||
>>>>>>> origin/New-inputsystem
|
||||
{
|
||||
GameSession::gameSession->Send(Protocol_ObjectDie(victim->GetID(), killer->GetID(), seconds).GetProtocol());
|
||||
}
|
||||
|
@ -185,21 +181,7 @@ using namespace DanBias;
|
|||
// send action protocol
|
||||
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 *****************//
|
||||
//******************************************************************************************************************//
|
||||
|
|
|
@ -68,7 +68,7 @@ void API_Impl::SetGravity(float gravity)
|
|||
// Bullet physics
|
||||
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;
|
||||
|
||||
// Add collision shape
|
||||
|
|
|
@ -239,16 +239,6 @@ void SimpleRigidBody::SetUp(::Oyster::Math::Float3 up)
|
|||
btQuaternion newRotation;
|
||||
btTransform trans;
|
||||
trans = this->rigidBody->getWorldTransform();
|
||||
<<<<<<< HEAD
|
||||
|
||||
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)
|
||||
=======
|
||||
|
||||
btVector3 v1 = trans.getBasis().getColumn(1);
|
||||
btVector3 v2(up.x, up.y, up.z);
|
||||
|
@ -257,26 +247,17 @@ void SimpleRigidBody::SetUp(::Oyster::Math::Float3 up)
|
|||
btVector3 a = v1.cross(v2);
|
||||
|
||||
if (v1.dot(v2) < -0.999999)
|
||||
>>>>>>> origin/New-inputsystem
|
||||
{
|
||||
btVector3 xCrossPre = btVector3(1, 0 ,0).cross(v1);
|
||||
if(xCrossPre.length() < 0.000001)
|
||||
xCrossPre = btVector3(0, 1 ,0).cross(v1);
|
||||
xCrossPre.normalize();
|
||||
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)
|
||||
{
|
||||
q = btQuaternion(0, 0, 0, 1);
|
||||
}
|
||||
>>>>>>> origin/New-inputsystem
|
||||
else
|
||||
{
|
||||
q.setX(a.x());
|
||||
|
|
|
@ -29,11 +29,8 @@ namespace Oyster
|
|||
void SetRotation(Math::Quaternion quaternion);
|
||||
void SetRotation(Math::Float3 eulerAngles);
|
||||
void SetRotation(::Oyster::Math::Float4x4 rotation);
|
||||
<<<<<<< HEAD
|
||||
void AddRotationAroundY(::Oyster::Math::Float angle);
|
||||
=======
|
||||
|
||||
void AddRotationAroundY(Math::Float angle);
|
||||
>>>>>>> origin/New-inputsystem
|
||||
void SetAngularFactor(Math::Float factor);
|
||||
void SetMass(Math::Float mass);
|
||||
|
||||
|
@ -62,8 +59,6 @@ namespace Oyster
|
|||
void SetCustomTag( void *ref );
|
||||
void* GetCustomTag() const;
|
||||
|
||||
|
||||
|
||||
// Class specific
|
||||
void SetCollisionShape(btCollisionShape* shape);
|
||||
void SetMotionState(btDefaultMotionState* motionState);
|
||||
|
|
Loading…
Reference in New Issue