diff --git a/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs b/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs index 17b542d84f..1a6955e647 100644 --- a/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs +++ b/Source/CombatExtended/CombatExtended/Projectiles/ProjectileCE.cs @@ -1206,9 +1206,18 @@ public override void DrawAt(Vector3 drawLoc, bool flip = false) } else { + Quaternion shadowRotation = ExactRotation; + Quaternion projectileRotation = DrawRotation; + if (def.projectile.spinRate != 0f) + { + float num2 = GenTicks.TicksPerRealSecond / def.projectile.spinRate; + var spinRotation = Quaternion.AngleAxis(Find.TickManager.TicksGame % num2 / num2 * 360f, Vector3.up); + shadowRotation *= spinRotation; + projectileRotation *= spinRotation; + } //Projectile //Graphics.DrawMesh(MeshPool.plane10, DrawPos, DrawRotation, def.DrawMatSingle, 0); - Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), DrawPos, DrawRotation, def.DrawMatSingle, 0); + Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), DrawPos, projectileRotation, def.DrawMatSingle, 0); //Shadow if (castShadow) @@ -1221,7 +1230,7 @@ public override void DrawAt(Vector3 drawLoc, bool flip = false) //TODO : Vary ShadowMat plane //Graphics.DrawMesh(MeshPool.plane08, shadowPos, ExactRotation, ShadowMaterial, 0); - Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), shadowPos, ExactRotation, ShadowMaterial, 0); + Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), shadowPos, shadowRotation, ShadowMaterial, 0); } Comps_PostDraw();