Statistics: Posted by Franck83 — 02 Jul 2017, 20:47
EcoNoob wrote:That mod looks very interesting though, what are ya making?
Statistics: Posted by Franck83 — 02 Jul 2017, 13:17
That mod looks very interesting though, what are ya making?
Statistics: Posted by Franck83 — 02 Jul 2017, 13:16
EcoNoob wrote:
That mod looks very interesting though, what are ya making?
biass wrote:
Make a reverse move 1st
Statistics: Posted by JoonasTo — 02 Jul 2017, 12:28
Statistics: Posted by EcoNoob — 02 Jul 2017, 11:33
Statistics: Posted by biass — 02 Jul 2017, 10:19
math.floor(a * (180 / math.pi) + 0.5) + 180
Statistics: Posted by Franck83 — 02 Jul 2017, 10:11
Statistics: Posted by Franck83 — 02 Jul 2017, 09:57
Statistics: Posted by JoonasTo — 02 Jul 2017, 01:09
local oldprojectile = Projectile
Projectile = Class(oldprojectile) {
oldOnImpact = Projectile.OnImpact,
OnImpact = function(self, targetType, targetEntity)
if targetEntity and self then
local qx, qy, qz, qw = unpack(targetEntity:GetOrientation())
local a = math.atan2(2.0*(qx*qz + qw*qy), qw*qw + qx*qx - qz*qz - qy*qy)
local current_yaw = math.floor(a * (180 / math.pi) + 0.5) + 180
-- LOG('Target orientation : '..current_yaw)
qx, qy, qz, qw = unpack(self:GetOrientation())
a = math.atan2(2.0*(qx*qz + qw*qy), qw*qw + qx*qx - qz*qz - qy*qy)
current_yaw2 = math.floor(a * (180 / math.pi) + 0.5) + 180
-- LOG('Projectile orientation : '..current_yaw2)
LOG('Difference : '..math.abs(current_yaw2 - current_yaw))
end
Projectile.oldOnImpact(self, targetType, targetEntity)
end,
}
Statistics: Posted by Franck83 — 01 Jul 2017, 21:26