From 932ef429c2e8e0e541a192c52e8bb899c7daf2bf Mon Sep 17 00:00:00 2001 From: lindaandersson Date: Wed, 19 Feb 2014 12:09:42 +0100 Subject: [PATCH] GameClient - removed hardcoding for lvl, use 2ofAll map for correct world. Init player gets wrong scale and isMyPlayer. Need to verify camera on client --- .../GameClient/GameClientState/GameState.cpp | 6 +--- .../GameClientState/NetLoadState.cpp | 19 ------------- Code/Game/GameLogic/Game_PlayerData.cpp | 2 +- Code/Game/GameLogic/Level.cpp | 28 +------------------ 4 files changed, 3 insertions(+), 52 deletions(-) diff --git a/Code/Game/GameClient/GameClientState/GameState.cpp b/Code/Game/GameClient/GameClientState/GameState.cpp index 5d756cf4..41518db6 100644 --- a/Code/Game/GameClient/GameClientState/GameState.cpp +++ b/Code/Game/GameClient/GameClientState/GameState.cpp @@ -93,9 +93,6 @@ bool GameState::Init( SharedStateContent &shared ) //tell server ready this->privData->nwClient->Send( Protocol_General_Status(Protocol_General_Status::States_ready) ); - // Debugg hack - this->InitiatePlayer( 0, "crate_generic.dan",Float3( 0,132, 10), Quaternion::identity, Float3(1), true ); - // end debug hack // DEGUG KEYS this->privData->key_Reload_Shaders = false; this->privData->key_Wireframe_Toggle = false; @@ -127,7 +124,6 @@ void GameState::InitiatePlayer( int id, const std::string &modelName, const floa RBData.rotation = ArrayToQuaternion( rotation ); RBData.scale = Float3( 1 ); // !RB DEBUG - if( isMyPlayer ) { if( this->privData->player.Init(modelData) ) @@ -483,7 +479,7 @@ const GameClientState::NetEvent & GameState::DataRecieved( const GameClientState // if is this player. Remember to change camera if( this->privData->myId == decoded.object_ID ) { - this->privData->camera.SetPosition( position ); + //this->privData->camera.SetPosition( position ); //this->privData->camera.SetRotation( rotation ); this->privData->player.setPos( position ); //this->privData->player.setRot( rotation ); diff --git a/Code/Game/GameClient/GameClientState/NetLoadState.cpp b/Code/Game/GameClient/GameClientState/NetLoadState.cpp index 1c4fbf65..b2475cc6 100644 --- a/Code/Game/GameClient/GameClientState/NetLoadState.cpp +++ b/Code/Game/GameClient/GameClientState/NetLoadState.cpp @@ -144,14 +144,6 @@ void NetLoadState::LoadGame( const ::std::string &fileName ) desc.scale = oh->scale; desc.visible = true; - // HACK: untill the world is right in lvl format - if( oh->specialTypeID == ObjectSpecialType_World) - { - desc.position = Float3(0,0,0); - desc.rotation = Quaternion::identity; - desc.scale = Float3(300,300,300); - } - C_StaticObj *staticObject = new C_StaticObj(); if( staticObject->Init( desc ) ) { @@ -248,16 +240,5 @@ void NetLoadState::LoadGame( const ::std::string &fileName ) } } - // DEBUG added a static light for testing - Graphics::Definitions::Pointlight pointLight; - pointLight.Color = Float3(1,1,0); - pointLight.Pos = Float3( 0,132, 10); - pointLight.Bright = 2; - pointLight.Radius = 50; - - C_Light *newLight = new C_Light( pointLight, objectID ); - - (*this->privData->lights)[objectID] = newLight; - this->privData->nextState = ClientState::ClientState_Game; } diff --git a/Code/Game/GameLogic/Game_PlayerData.cpp b/Code/Game/GameLogic/Game_PlayerData.cpp index ca0746e8..9ff82b2b 100644 --- a/Code/Game/GameLogic/Game_PlayerData.cpp +++ b/Code/Game/GameLogic/Game_PlayerData.cpp @@ -24,7 +24,7 @@ Game::PlayerData::PlayerData() } Game::PlayerData::PlayerData(int playerID,int teamID) { - Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(50,130,0); + Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(-50,180,0); Oyster::Math::Float3 size = Oyster::Math::Float3(0.25f,2.0f,0.5f); Oyster::Math::Float mass = 60; diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index a3a1c07f..b3a8b101 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -242,34 +242,8 @@ bool Level::InitiateLevel(std::wstring levelPath) ICustomBody* rigidBody_Static = NULL; - // HACK: untill the world is right in lvl format - if((ObjectSpecialType)staticObjData->specialTypeID == ObjectSpecialType_World) - { - Oyster::Math::Float3 rigidWorldPos; - Oyster::Math::Float4 rigidWorldRotation; - float rigidBodyMass; - float rigidBodyRadius; - - //offset the rigidPosition from modelspace to worldspace; - rigidWorldPos = Oyster::Math::Float3(0,0,0); - //scales the position so the collision geomentry is in the right place - - //offset the rigidRotation from modelspace to worldspace; - - rigidWorldRotation = Oyster::Math::Float4(0,0,0,1); - - //mass scaled - rigidBodyMass = 0; - - //Radius scaled - rigidBodyRadius = 150; - - //create the rigid body - rigidBody_Static = API::Instance().AddCollisionSphere( rigidBodyRadius , rigidWorldRotation , rigidWorldPos , rigidBodyMass, 1,1,1); - - } // collision shape - else if(staticObjData->boundingVolume.geoType == CollisionGeometryType_Sphere) + if(staticObjData->boundingVolume.geoType == CollisionGeometryType_Sphere) { rigidBody_Static = InitRigidBodySphere(staticObjData); }