Compare commits

...

11 Commits

Author SHA1 Message Date
Jace 494746ad8b Merge remote-tracking branch 'origin/Recording' into Recording 2016-03-14 16:33:53 +01:00
Jace b886d9146b WIP STUFF 2016-03-14 08:33:33 +01:00
Jace 57715d5846 Merge branch 'master' into Recording 2016-03-14 06:13:23 +01:00
William Moberg fb3842ba5b Indentation. 2016-03-14 06:05:11 +01:00
William Moberg 6daaccb9ed Merge branch 'Recording' of github.com:teamfisk/TacticalZ into Recording
# Conflicts:
#	src/Engine/Editor/EditorSystem.cpp
2016-03-14 06:02:47 +01:00
William Moberg 0cd161184e Smoother movement for editor camera. 2016-03-14 06:00:12 +01:00
Jace 87b983ec6f Stuff 2016-03-14 05:56:09 +01:00
Jace 592f33653e Better shadows for recording 2016-03-14 04:44:53 +01:00
Jace c74a4e375e Better CP_Valhalla lighting 2016-03-14 04:24:40 +01:00
Jace 78a383b03c Merge branch 'master' into Recording 2016-03-14 04:04:20 +01:00
Jace 24de85b476 Editor no longer resets camera 2016-03-14 04:02:05 +01:00
10 changed files with 24443 additions and 14 deletions
+1
View File
@@ -43,6 +43,7 @@ private:
EditorGUI::WidgetSpace m_WidgetSpace = EditorGUI::WidgetSpace::Global;
EntityWrapper m_Widget = EntityWrapper::Invalid;
EntityWrapper m_CurrentSelection = EntityWrapper::Invalid;
glm::vec3 m_CamVelocity;
// Utility functions
EntityWrapper importEntity(EntityWrapper parent, boost::filesystem::path filePath);
+1 -1
View File
@@ -69,7 +69,7 @@ private:
std::array<glm::mat4, MAX_SPLITS> m_LightProjection;
std::array<glm::mat4, MAX_SPLITS> m_LightView;
GLfloat m_NearFarPlane[2] = { -34.f, 27.f };
GLfloat m_NearFarPlane[2] = { -128.f, 128.f };
GLuint m_ResolutionSizeWidth = 1024 * 2;
GLuint m_ResolutionSizeHeight = 1024 * 2;
+1 -1
View File
@@ -2,5 +2,5 @@
<Camera xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Camera.xsd">
<FOV>59</FOV> <!-- 90 horizontal FOV at 1080p -->
<NearClip>0.01</NearClip>
<FarClip>5000</FarClip>
<FarClip>300</FarClip>
</Camera>
+138
View File
@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Entity xmlns:c="components" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../Types/Entity.xsd">
<Components>
<c:SceneLight>
<AmbientColor A="1" B="0.392156869" G="0.392156869" R="0.392156869"/>
<Gamma>1</Gamma>
<Exposure>0.82000017166137695</Exposure>
</c:SceneLight>
<c:CapturePointGameMode>
<RespawnTime>0.32289272439493288</RespawnTime>
<MaxRespawnTime>0.5</MaxRespawnTime>
</c:CapturePointGameMode>
<c:Transform/>
</Components>
<Children>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<GlowIntensity>1.0199999809265137</GlowIntensity>
<Resource>Models/Props/Walls/SciFiWallTop.mesh</Resource>
<Color A="1" B="3.92156863" G="1" R="1"/>
<Shadow>false</Shadow>
</c:Model>
<c:Transform>
<Position X="0" Y="58.718792" Z="15.6310005"/>
<Orientation X="0" Y="0" Z="3.14199996"/>
<Scale X="0.279000014" Y="1" Z="0.279000014"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<GlowIntensity>1.5</GlowIntensity>
<Resource>Models/Props/Pillars/SciFiPillar2Blue.mesh</Resource>
<Shadow>false</Shadow>
</c:Model>
<c:Transform>
<Position X="-14.4384613" Y="-1.2316848" Z="0"/>
<Orientation X="0" Y="2.64800024" Z="0"/>
<Scale X="2" Y="3.60000014" Z="1.9000001"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Collidable/>
<c:Model>
<GlowIntensity>1.5</GlowIntensity>
<Resource>Models/Props/Pillars/SciFiPillar2Blue.mesh</Resource>
<Shadow>false</Shadow>
</c:Model>
<c:Transform>
<Position X="14.3019333" Y="-1.12725353" Z="0"/>
<Orientation X="0" Y="3.84800029" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Dir">
<Components>
<c:DirectionalLight>
<Color A="1" B="0.725490212" G="0.75686276" R="0.741176486"/>
<Intensity>1.0699999332427979</Intensity>
</c:DirectionalLight>
<c:Transform>
<Orientation X="3.68318534" Y="0" Z="0"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Cam">
<Components>
<c:Camera>
<FOV>47</FOV>
</c:Camera>
<c:Model>
<Resource>Models/Core/UnitSphere.mesh</Resource>
<Shadow>false</Shadow>
<NormalMap>false</NormalMap>
<DiffuseTexture>false</DiffuseTexture>
<SpecularMap>false</SpecularMap>
<GlowMap>false</GlowMap>
</c:Model>
<c:Transform>
<Position X="0.100000001" Y="-0.0670000017" Z="-32.8670006"/>
<Orientation X="0" Y="3.1400001" Z="0"/>
<Scale X="0.100000001" Y="0.100000001" Z="0.100000001"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity name="Spawn">
<Components>
<c:Team>
<Team>
<Blue/>
</Team>
</c:Team>
<c:PlayerSpawn>
<AssaultFile>Schema/Entities/PlayerAssaultBlue.xml</AssaultFile>
<DefenderFile>Schema/Entities/PlayerDefenderBlue.xml</DefenderFile>
<SniperFile></SniperFile>
</c:PlayerSpawn>
<c:Model>
<Resource>Models/Characters/Assault/AssaultBlue.mesh</Resource>
<Visible>false</Visible>
</c:Model>
<c:Spawner>
<EntityFile></EntityFile>
</c:Spawner>
<c:Transform>
<Position X="0.100000001" Y="2.8398931" Z="-29.0827847"/>
</c:Transform>
</Components>
<Children/>
</Entity>
<Entity>
<Components>
<c:Model>
<Resource>Models/Highgrounds/Hg21.mesh</Resource>
</c:Model>
<c:Transform>
<Position X="0" Y="-1.75605178" Z="-20.9220009"/>
<Scale X="0.407000005" Y="0.407000005" Z="0.407000005"/>
</c:Transform>
</Components>
<Children/>
</Entity>
</Children>
</Entity>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+51 -9
View File
@@ -8,6 +8,7 @@ EditorSystem::EditorSystem(SystemParams params, IRenderer* renderer, RenderFrame
: System(params)
, m_Renderer(renderer)
, m_RenderFrame(renderFrame)
, m_CamVelocity(0.f)
{
m_EditorWorld = new World();
m_EditorWorldSystemPipeline = new SystemPipeline(m_EditorWorld, m_EventBroker, IsClient, IsServer);
@@ -83,14 +84,55 @@ void EditorSystem::Update(double dt)
}
}
m_EditorWorldSystemPipeline->Update(actualDelta);
ComponentWrapper& cameraTransform = m_EditorCamera["Transform"];
Field<glm::vec3> ori = cameraTransform["Orientation"];
ori.x(m_EditorCameraInputController->Rotation().x);
ori.y(m_EditorCameraInputController->Rotation().y);
Field<glm::vec3> pos = cameraTransform["Position"];
pos += m_EditorCameraInputController->Movement() * glm::inverse(glm::quat(ori)) * (float)actualDelta;
}
ComponentWrapper& cameraTransform = m_EditorCamera["Transform"];
Field<glm::vec3> ori = cameraTransform["Orientation"];
glm::vec3 newOri;
newOri.x = glm::mix(ori.x(), m_EditorCameraInputController->Rotation().x, 0.05f);
newOri.y = glm::mix(ori.y(), m_EditorCameraInputController->Rotation().y, 0.05f);
//ori.x(m_EditorCameraInputController->Rotation().x);
//ori.y(m_EditorCameraInputController->Rotation().y);
ori.x(newOri.x);
ori.y(newOri.y);
Field<glm::vec3> pos = cameraTransform["Position"];
auto move = m_EditorCameraInputController->Movement();
const float decreaseAccelleration = 3.75f;
const float increaseAccelleration = 5.25f;
if (move.x == 0) {
m_CamVelocity.x -= m_CamVelocity.x * (float)actualDelta * decreaseAccelleration;
//m_CamVelocity.x -= glm::sign(m_CamVelocity.x) * (float)actualDelta * decreaseAccelleration;
if (glm::abs(m_CamVelocity.x) < 0.01f) {
m_CamVelocity.x = 0;
}
} else {
m_CamVelocity.x += glm::sign(move.x) * (float)actualDelta * increaseAccelleration;
m_CamVelocity.x = glm::max(m_CamVelocity.x, -glm::abs(move.x));
m_CamVelocity.x = glm::min(m_CamVelocity.x, glm::abs(move.x));
}
if (move.y == 0) {
m_CamVelocity.y -= m_CamVelocity.y * (float)actualDelta * decreaseAccelleration;
//m_CamVelocity.y -= glm::sign(m_CamVelocity.y) * (float)actualDelta * decreaseAccelleration;
if (glm::abs(m_CamVelocity.y) < 0.01f) {
m_CamVelocity.y = 0;
}
} else {
m_CamVelocity.y += glm::sign(move.y) * (float)actualDelta * increaseAccelleration;
m_CamVelocity.y = glm::max(m_CamVelocity.y, -glm::abs(move.y));
m_CamVelocity.y = glm::min(m_CamVelocity.y, glm::abs(move.y));
}
if (move.z == 0) {
m_CamVelocity.z -= m_CamVelocity.z * (float)actualDelta * decreaseAccelleration;
//m_CamVelocity.z -= glm::sign(m_CamVelocity.z) * (float)actualDelta * decreaseAccelleration;
if (glm::abs(m_CamVelocity.z) < 0.01f) {
m_CamVelocity.z = 0;
}
} else {
m_CamVelocity.z += glm::sign(move.z) * (float)actualDelta * increaseAccelleration;
m_CamVelocity.z = glm::max(m_CamVelocity.z, -glm::abs(move.z));
m_CamVelocity.z = glm::min(m_CamVelocity.z, glm::abs(move.z));
}
pos += m_CamVelocity * glm::inverse(glm::quat(ori)) * (float)actualDelta;
}
void EditorSystem::Enable()
@@ -117,11 +159,11 @@ void EditorSystem::Enable()
void EditorSystem::Disable()
{
m_EditorCameraInputController->Disable();
//m_EditorCameraInputController->Disable();
m_EventBroker->Publish(Events::LockMouse());
Events::SetCamera e;
e.CameraEntity = m_ActualCamera;
m_EventBroker->Publish(e);
//m_EventBroker->Publish(e);
m_Enabled = false;
}
+1 -1
View File
@@ -184,7 +184,7 @@ bool RenderSystem::isEntityVisible(EntityWrapper& entity)
}
// Hide things parented to local player if they have the HiddenFromLocalPlayer component
bool outOfBodyExperience = false; // ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
bool outOfBodyExperience = ResourceManager::Load<ConfigFile>("Config.ini")->Get<bool>("Debug.OutOfBodyExperience", false);
if (
(entity.HasComponent("HiddenForLocalPlayer") || entity.FirstParentWithComponent("HiddenForLocalPlayer").Valid())
&& (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer))
+1
View File
@@ -19,6 +19,7 @@ void Renderer::Initialize()
{
m_SSAO_Quality = m_Config->Get<int>("SSAO.Quality", 0);
m_GLOW_Quality = m_Config->Get<int>("GLOW.Quality", 0);
m_MSAA_Level = m_Config->Get<unsigned int>("MSAA.Level", 0);
InitializeWindow();
InitializeRenderPasses();
+2 -2
View File
@@ -21,7 +21,7 @@ void PlayerMovementSystem::Update(double dt)
{
updateMovementControllers(dt);
// Only do physics calculations on client and only for themselves.
if (IsClient) {
if (IsClient || true) {
if (LocalPlayer.Valid()){
updateVelocity(LocalPlayer, dt);
}
@@ -73,7 +73,7 @@ void PlayerMovementSystem::Update(double dt)
return;
}
for (auto cDash : *pool) {
if (cDash.EntityID != LocalPlayer.ID && (double)cDash["CoolDownMaxTimer"] - (double)cDash["CoolDownTimer"] < 0.5) {
if ((double)cDash["CoolDownMaxTimer"] - (double)cDash["CoolDownTimer"] < 0.5) {
// Spawn one afterimage for each player that Dashes.
EntityWrapper player(m_World, cDash.EntityID);
auto playerModel = player.FirstChildByName("PlayerModel");