Fixed erratic turret movement
This commit is contained in:
@@ -147,8 +147,8 @@ public class Turret extends Block{
|
|||||||
if(Float.isNaN(entity.rotation)){
|
if(Float.isNaN(entity.rotation)){
|
||||||
entity.rotation = 0;
|
entity.rotation = 0;
|
||||||
}
|
}
|
||||||
entity.rotation = Mathf.slerp(entity.rotation, targetRot,
|
entity.rotation = Mathf.slerpDelta(entity.rotation, targetRot,
|
||||||
rotatespeed*Timers.delta());
|
rotatespeed);
|
||||||
|
|
||||||
if(Angles.angleDist(entity.rotation, targetRot) < shootCone && entity.timer.get(timerReload, reload)){
|
if(Angles.angleDist(entity.rotation, targetRot) < shootCone && entity.timer.get(timerReload, reload)){
|
||||||
if(shootsound != null && entity.timer.get(timerSound, soundReload)) Effects.sound(shootsound, entity);
|
if(shootsound != null && entity.timer.get(timerSound, soundReload)) Effects.sound(shootsound, entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user