defender tracer fixed
This commit is contained in:
@@ -213,7 +213,6 @@ bool FirstPersonInputController<EventContext>::OnCommand(const Events::InputComm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EntityWrapper firstPersonModel = m_PlayerEntity.FirstChildByName("Hands");
|
EntityWrapper firstPersonModel = m_PlayerEntity.FirstChildByName("Hands");
|
||||||
if (firstPersonModel.Valid()) {
|
if (firstPersonModel.Valid()) {
|
||||||
if (val > 0) { // Walk/Run
|
if (val > 0) { // Walk/Run
|
||||||
|
|||||||
@@ -17,12 +17,10 @@
|
|||||||
<DiffuseTexture>Textures/Effects/NewRay7.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Effects/NewRay7.png</DiffuseTexture>
|
||||||
<Color A="1" B="2.35294127" G="1.17647064" R="0"/>
|
<Color A="1" B="2.35294127" G="1.17647064" R="0"/>
|
||||||
<KeepRatio>true</KeepRatio>
|
<KeepRatio>true</KeepRatio>
|
||||||
<Linear>true</Linear>
|
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<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.0700000003" Z="0"/>
|
<Scale X="1" Y="0.0700000003" Z="1"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
@@ -35,12 +33,10 @@
|
|||||||
<DiffuseTexture>Textures/Effects/NewRay7.png</DiffuseTexture>
|
<DiffuseTexture>Textures/Effects/NewRay7.png</DiffuseTexture>
|
||||||
<Color A="1" B="2.35294127" G="1.17647064" R="0"/>
|
<Color A="1" B="2.35294127" G="1.17647064" R="0"/>
|
||||||
<KeepRatio>true</KeepRatio>
|
<KeepRatio>true</KeepRatio>
|
||||||
<Linear>true</Linear>
|
|
||||||
</c:Sprite>
|
</c:Sprite>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<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.0700000003" Z="0"/>
|
<Scale X="1" Y="0.0700000003" Z="1"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children/>
|
<Children/>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
</c:BlendAdditive>
|
</c:BlendAdditive>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Characters/Defender/FirstPersonDefenderBlue.mesh</Resource>
|
<Resource>Models/Characters/Defender/FirstPersonDefenderBlue.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform/>
|
<c:Transform/>
|
||||||
</Components>
|
</Components>
|
||||||
@@ -244,6 +245,7 @@
|
|||||||
</c:BoneAttachment>
|
</c:BoneAttachment>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Weapons/Blue/DefenderWeaponBlue.mesh</Resource>
|
<Resource>Models/Weapons/Blue/DefenderWeaponBlue.mesh</Resource>
|
||||||
|
<Shadow>false</Shadow>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="0.120748043" Y="-0.228436321" Z="-0.151475549"/>
|
<Position X="0.120748043" Y="-0.228436321" Z="-0.151475549"/>
|
||||||
|
|||||||
@@ -395,9 +395,12 @@ void DefenderWeaponBehaviour::spawnTracers(ComponentWrapper cWeapon, WeaponInfo&
|
|||||||
glm::vec3 muzzlePosition = TransformSystem::AbsolutePosition(muzzle);
|
glm::vec3 muzzlePosition = TransformSystem::AbsolutePosition(muzzle);
|
||||||
glm::quat muzzleOrientation = TransformSystem::AbsoluteOrientation(muzzle);
|
glm::quat muzzleOrientation = TransformSystem::AbsoluteOrientation(muzzle);
|
||||||
|
|
||||||
rayOrigin = muzzlePosition;
|
|
||||||
|
|
||||||
glm::vec3 muzzleToHit = hitPosition - muzzlePosition;
|
glm::vec3 muzzleToHit = hitPosition - muzzlePosition;
|
||||||
|
|
||||||
|
rayOrigin = muzzlePosition + (muzzleToHit/2.f);
|
||||||
|
|
||||||
|
|
||||||
glm::vec3 lookVector = glm::normalize(-muzzleToHit);
|
glm::vec3 lookVector = glm::normalize(-muzzleToHit);
|
||||||
float pitch = std::asin(-lookVector.y);
|
float pitch = std::asin(-lookVector.y);
|
||||||
float yaw = std::atan2(lookVector.x, lookVector.z);
|
float yaw = std::atan2(lookVector.x, lookVector.z);
|
||||||
@@ -477,7 +480,12 @@ void DefenderWeaponBehaviour::dealDamage(ComponentWrapper cWeapon, WeaponInfo& w
|
|||||||
|
|
||||||
// Check for friendly fire
|
// Check for friendly fire
|
||||||
if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)wi.Player["Team"]["Team"]) {
|
if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)wi.Player["Team"]["Team"]) {
|
||||||
// TODO: Ammo sharing
|
// Give boost
|
||||||
|
Events::PlayerDamage ePlayerDamage;
|
||||||
|
ePlayerDamage.Inflictor = wi.Player;
|
||||||
|
ePlayerDamage.Victim = victim;
|
||||||
|
ePlayerDamage.Damage = 0;
|
||||||
|
m_EventBroker->Publish(ePlayerDamage);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +501,6 @@ void DefenderWeaponBehaviour::dealDamage(ComponentWrapper cWeapon, WeaponInfo& w
|
|||||||
ePlayerDamage.Victim = kv.first;
|
ePlayerDamage.Victim = kv.first;
|
||||||
ePlayerDamage.Damage = kv.second;
|
ePlayerDamage.Damage = kv.second;
|
||||||
m_EventBroker->Publish(ePlayerDamage);
|
m_EventBroker->Publish(ePlayerDamage);
|
||||||
LOG_DEBUG("Dealt %f damage to #%i", kv.second, kv.first.ID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user