GameClient - removed hardcoding for lvl, use 2ofAll map for correct world. Init player gets wrong scale and isMyPlayer. Need to verify camera on client

This commit is contained in:
lindaandersson 2014-02-19 12:09:42 +01:00
parent ad37095a80
commit 932ef429c2
4 changed files with 3 additions and 52 deletions

View File

@ -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 );

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
}