public override void UpdateShape(VInt3 location, VInt3 forward) { VCollisionSphere.UpdatePosition(ref this.worldPos, ref this.localPos, ref location, ref forward); if (this.rotation != 0) { forward = forward.RotateY(this.rotation); } VFactor vFactor; VFactor vFactor2; IntMath.sincos(out vFactor, out vFactor2, (long)(314 * Mathf.Clamp(this.degree, 1, 360)), 36000L); long num = vFactor2.nom * vFactor.den; long num2 = vFactor2.den * vFactor.nom; long b = vFactor2.den * vFactor.den; this.rightDir.x = (int)IntMath.Divide((long)forward.x * num + (long)forward.z * num2, b); this.rightDir.z = (int)IntMath.Divide((long)(-(long)forward.x) * num2 + (long)forward.z * num, b); this.rightDir.y = 0; num2 = -num2; this.leftDir.x = (int)IntMath.Divide((long)forward.x * num + (long)forward.z * num2, b); this.leftDir.z = (int)IntMath.Divide((long)(-(long)forward.x) * num2 + (long)forward.z * num, b); this.leftDir.y = 0; this.rightDir.Normalize(); this.leftDir.Normalize(); this.dirty = false; }
public override void UpdateShape(VInt3 location, VInt3 forward) { VCollisionSphere.UpdatePosition(ref this.worldPos, ref this.localPos, ref location, ref forward); this.worldRadius = this.localRadius; this.dirty = false; }