defender ray fixes

This commit is contained in:
viktorljung
2016-03-13 16:42:07 +01:00
parent 17007a2a41
commit 3cee4e4248
2 changed files with 14 additions and 16 deletions
+10 -12
View File
@@ -3,11 +3,9 @@
<Components> <Components>
<c:Lifetime> <c:Lifetime>
<Lifetime>0.5</Lifetime> <Lifetime>0.079999998211860657</Lifetime>
</c:Lifetime> </c:Lifetime>
<c:Transform> <c:Transform/>
<Scale X="0" Y="1" Z="1"/>
</c:Transform>
</Components> </Components>
<Children> <Children>
@@ -16,14 +14,14 @@
<c:Sprite> <c:Sprite>
<Model>Models/Core/UnitQuad.mesh</Model> <Model>Models/Core/UnitQuad.mesh</Model>
<GlowMap></GlowMap> <GlowMap></GlowMap>
<DiffuseTexture>Textures/Effects/NewRay3.png</DiffuseTexture> <DiffuseTexture>Textures/Effects/NewRay5.png</DiffuseTexture>
<Color A="0.419607848" B="3.92156863" G="0.270588249" R="0"/> <Color A="1" B="2.35294127" G="1.17647064" R="0"/>
<KeepRatioX>true</KeepRatioX> <KeepRatio>true</KeepRatio>
</c:Sprite> </c:Sprite>
<c:Transform> <c:Transform>
<Position X="0" Y="0" Z="-0.5"/> <Position X="0" Y="0" Z="-0.5"/>
<Orientation X="0" Y="-1.57099998" Z="0"/> <Orientation X="0" Y="-1.57099998" Z="0"/>
<Scale X="1" Y="0.0710000023" Z="0"/> <Scale X="1" Y="0.0700000003" Z="0"/>
</c:Transform> </c:Transform>
</Components> </Components>
<Children/> <Children/>
@@ -33,14 +31,14 @@
<c:Sprite> <c:Sprite>
<Model>Models/Core/UnitQuad.mesh</Model> <Model>Models/Core/UnitQuad.mesh</Model>
<GlowMap></GlowMap> <GlowMap></GlowMap>
<DiffuseTexture>Textures/Effects/NewRay3.png</DiffuseTexture> <DiffuseTexture>Textures/Effects/NewRay5.png</DiffuseTexture>
<Color A="0.419607848" B="3.92156863" G="0.270588249" R="0"/> <Color A="1" B="2.35294127" G="1.17647064" R="0"/>
<KeepRatioX>true</KeepRatioX> <KeepRatio>true</KeepRatio>
</c:Sprite> </c:Sprite>
<c:Transform> <c:Transform>
<Position X="0" Y="0" Z="-0.5"/> <Position X="0" Y="0" Z="-0.5"/>
<Orientation X="0" Y="4.71218538" Z="3.14199996"/> <Orientation X="0" Y="4.71218538" Z="3.14199996"/>
<Scale X="1" Y="0.0710000023" Z="0"/> <Scale X="1" Y="0.0700000003" Z="0"/>
</c:Transform> </c:Transform>
</Components> </Components>
<Children/> <Children/>
@@ -393,7 +393,7 @@ void DefenderWeaponBehaviour::spawnTracers(ComponentWrapper cWeapon, WeaponInfo&
float yaw = std::atan2(lookVector.x, lookVector.z); float yaw = std::atan2(lookVector.x, lookVector.z);
glm::quat orientation = glm::quat(glm::vec3(pitch, yaw, 0)); glm::quat orientation = glm::quat(glm::vec3(pitch, yaw, 0));
rayOrientation = glm::eulerAngles(orientation); rayOrientation = glm::eulerAngles(orientation);
rayScale.z(glm::length(muzzleToHit)); rayScale.x(glm::length(muzzleToHit));
} }
} }
} }
@@ -449,8 +449,8 @@ void DefenderWeaponBehaviour::dealDamage(ComponentWrapper cWeapon, WeaponInfo& w
} }
// Temp hit decal // Temp hit decal
// EntityWrapper hit = ResourceManager::Load<EntityFile>("Schema/Entities/HitTest.xml")->MergeInto(m_World); EntityWrapper hit = ResourceManager::Load<EntityFile>("Schema/Entities/HitTest.xml")->MergeInto(m_World);
// hit["Transform"]["Position"] = pick.Position; (Field<glm::vec3>)hit["Transform"]["Position"] = pick.Position;
// Don't let us shoot ourselves in the foot somehow // Don't let us shoot ourselves in the foot somehow
if (victim == LocalPlayer) { if (victim == LocalPlayer) {
@@ -472,7 +472,7 @@ void DefenderWeaponBehaviour::dealDamage(ComponentWrapper cWeapon, WeaponInfo& w
} }
damageSum[victim] += pelletDamage; damageSum[victim] += pelletDamage;
// ((glm::vec3&)hit["Model"]["Color"]).b = 1.f; ((Field<glm::vec4>)hit["Model"]["Color"]).z(1.f);
} }
// Deal damage! // Deal damage!