diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp index 00fc2599..c5fb9d66 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp @@ -81,10 +81,11 @@ bool GameState::LoadModels(std::wstring mapFile) C_Object* obj; translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(0,0,0)); Oyster::Math3D::Float4x4 scale = Oyster::Math3D::Float4x4::identity; - scale.v[0].x = 8; - scale.v[1].y = 8; - scale.v[2].z = 8; - modelData.world = translate; //modelData.world * translate + scale.v[0].x = 0.2; + scale.v[1].y = 0.2; + scale.v[2].z = 0.2; + scale.v[3].w = 1; + modelData.world = translate ;//modelData.world * translate modelData.modelPath = L"world_earth.dan"; modelData.id = 0; @@ -94,7 +95,7 @@ bool GameState::LoadModels(std::wstring mapFile) // add box model modelData.world = Oyster::Math3D::Float4x4::identity; - translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(-5,175,0)); + translate = Oyster::Math3D::TranslationMatrix(Oyster::Math::Float3(-5,15,0)); modelData.world = modelData.world * translate; modelData.modelPath = L"box.dan"; modelData.id = 1; @@ -132,7 +133,7 @@ bool GameState::InitCamera(Oyster::Math::Float3 startPos) camera->LookAt(pos, dir, up); camera->SetLens(3.14f/2, 1024/768, 1, 1000); - privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/2,1024.0f/768.0f,.1f,1000); + privData->proj = Oyster::Math3D::ProjectionMatrix_Perspective(Oyster::Math::pi/4,1024.0f/768.0f,.1f,1000); //privData->proj = Oyster::Math3D::ProjectionMatrix_Orthographic(1024, 768, 1, 1000); Oyster::Graphics::API::SetProjection(privData->proj); camera->UpdateViewMatrix(); diff --git a/Code/Game/GameLogic/CollisionManager.cpp b/Code/Game/GameLogic/CollisionManager.cpp index 19f25dd3..76ca668a 100644 --- a/Code/Game/GameLogic/CollisionManager.cpp +++ b/Code/Game/GameLogic/CollisionManager.cpp @@ -81,8 +81,11 @@ using namespace GameLogic; void AttatchmentMassDriver::ForcePushAction(Oyster::Physics::ICustomBody *obj, void *args) { - Oyster::Math::Float3 pushForce = Oyster::Math::Float4(1,0,0) * (1); + Oyster::Math::Float3 pushForce = Oyster::Math::Float4(1,0,0) * (500); Oyster::Physics::ICustomBody::State state; + Object *realObj = (Object*)obj->GetCustomTag(); + if(realObj->GetType() == OBJECT_TYPE_PLAYER || realObj->GetType() == OBJECT_TYPE_WORLD) + return; state = obj->GetState(); state.ApplyLinearImpulse(pushForce); obj->SetState(state); diff --git a/Code/Game/GameLogic/Game_PlayerData.cpp b/Code/Game/GameLogic/Game_PlayerData.cpp index b3c6ef26..8dc29957 100644 --- a/Code/Game/GameLogic/Game_PlayerData.cpp +++ b/Code/Game/GameLogic/Game_PlayerData.cpp @@ -7,9 +7,9 @@ Game::PlayerData::PlayerData() { //set some stats that are appropriate to a player Oyster::Physics::API::SimpleBodyDescription sbDesc; - sbDesc.centerPosition = Oyster::Math::Float3(0,165,0); + sbDesc.centerPosition = Oyster::Math::Float3(0,350,0); sbDesc.size = Oyster::Math::Float3(4,7,4); - + sbDesc.mass = 10; //create rigid body Oyster::Physics::ICustomBody *rigidBody = Oyster::Physics::API::Instance().CreateRigidBody(sbDesc).Release(); diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index f631979d..8b2f3bf8 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -25,7 +25,7 @@ void Level::InitiateLevel(float radius) API::SphericalBodyDescription sbDesc; sbDesc.centerPosition = Oyster::Math::Float4(0,0,0,1); sbDesc.ignoreGravity = true; - sbDesc.radius = 150; + sbDesc.radius = 300; sbDesc.mass = 10e12f; ICustomBody* rigidBody = API::Instance().CreateRigidBody(sbDesc).Release(); @@ -39,7 +39,7 @@ void Level::InitiateLevel(float radius) rigidBody->SetCustomTag(levelObj); - // add box + // add box API::SimpleBodyDescription sbDesc_TestBox; sbDesc_TestBox.centerPosition = Oyster::Math::Float4(-5,15,0,0); sbDesc_TestBox.ignoreGravity = false; @@ -59,7 +59,7 @@ void Level::InitiateLevel(float radius) // add gravitation API::Gravity gravityWell; gravityWell.gravityType = API::Gravity::GravityType_Well; - gravityWell.well.mass = 10e16f; + gravityWell.well.mass = 1e15f; gravityWell.well.position = Oyster::Math::Float4(0,0,0,1); API::Instance().AddGravity(gravityWell); } diff --git a/Code/Game/GameLogic/Player.cpp b/Code/Game/GameLogic/Player.cpp index 45ae8f65..ea36b284 100644 --- a/Code/Game/GameLogic/Player.cpp +++ b/Code/Game/GameLogic/Player.cpp @@ -86,24 +86,24 @@ void Player::Move(const PLAYER_MOVEMENT &movement) void Player::MoveForward() { - setState.ApplyLinearImpulse(this->lookDir * (20 * this->gameInstance->GetFrameTime())); + setState.ApplyLinearImpulse(this->lookDir * (2000 * this->gameInstance->GetFrameTime())); } void Player::MoveBackwards() { - setState.ApplyLinearImpulse(-this->lookDir * 20 * this->gameInstance->GetFrameTime()); + setState.ApplyLinearImpulse(-this->lookDir * 2000 * this->gameInstance->GetFrameTime()); } void Player::MoveRight() { //Do cross product with forward vector and negative gravity vector Oyster::Math::Float3 r = (-rigidBody->GetGravityNormal()).Cross((Oyster::Math::Float3)this->lookDir); - setState.ApplyLinearImpulse(r * 20 * this->gameInstance->GetFrameTime()); + setState.ApplyLinearImpulse(r * 2000 * this->gameInstance->GetFrameTime()); } void Player::MoveLeft() { //Do cross product with forward vector and negative gravity vector Oyster::Math::Float3 r = -(-rigidBody->GetGravityNormal()).Cross((Oyster::Math::Float3)this->lookDir); //Still get zero - setState.ApplyLinearImpulse(-r * 20 * this->gameInstance->GetFrameTime()); + setState.ApplyLinearImpulse(-r * 2000 * this->gameInstance->GetFrameTime()); } void Player::UseWeapon(const WEAPON_FIRE &usage) @@ -123,7 +123,7 @@ void Player::Rotate(const Oyster::Math3D::Float3 lookDir) { this->lookDir = lookDir; - Oyster::Math::Float4 up(0,1,0,0);//-setState.GetGravityNormal(); + Oyster::Math::Float4 up = -setState.GetGravityNormal(); Oyster::Math::Float4 pos = setState.GetCenterPosition(); Oyster::Math::Float4x4 world = Oyster::Math3D::OrientationMatrix_LookAtDirection(lookDir, up.xyz, pos.xyz); // cant set rotation diff --git a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/LightPass.hlsl b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/LightPass.hlsl index 98b2887e..1efb94c6 100644 --- a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/LightPass.hlsl +++ b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/LightPass.hlsl @@ -27,7 +27,9 @@ void main( uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID ) Shaded.Specular += light.Specular; } - Diffuse[DTid.xy] = float4(Shaded.Diffuse * DiffuseGlow[DTid.xy].xyz,1); + //Diffuse[DTid.xy] = float4(Shaded.Diffuse * DiffuseGlow[DTid.xy].xyz,1); + Diffuse[DTid.xy] = float4(DiffuseGlow[DTid.xy].xyz,1); + Specular[DTid.xy] = float4(Shaded.Specular, 1); diff --git a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/PostPass.hlsl b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/PostPass.hlsl index 2aaf2051..3e03dfcd 100644 --- a/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/PostPass.hlsl +++ b/Code/OysterGraphics/Shader/HLSL/Deffered Shaders/PostPass.hlsl @@ -8,5 +8,7 @@ RWTexture2D Output; void main( uint3 DTid : SV_DispatchThreadID ) { Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy] + Diffuse[DTid.xy] * Ambient[DTid.xy/4].w;// + float4(Ambient[DTid.xy/4].xyz,1); GLOW + //Output[DTid.xy] = Diffuse[DTid.xy] + Diffuse[DTid.xy] * Ambient[DTid.xy/4].w;// + float4(Ambient[DTid.xy/4].xyz,1); GLOW + //Output[DTid.xy] = Diffuse[DTid.xy]; } \ No newline at end of file