public static float SquareAngleDistance(Angle2 a, Angle2 b) { float num = Mathf.DeltaAngle(a.x, b.x); float num2 = Mathf.DeltaAngle(a.y, b.y); return((num * num) + (num2 * num2)); }
private bool ExtractRecoil(out Angle2 offset) { offset = new Angle2(); if (this.recoilImpulses != null) { int count = this.recoilImpulses.Count; if (count > 0) { float deltaTime = Time.deltaTime; Recoil[] buffer = this.recoilImpulses.Buffer; for (int i = count - 1; i >= 0; i--) { if (buffer[i].Extract(ref offset, deltaTime)) { this.recoilImpulses.RemoveAt(i); while (--i >= 0) { if (buffer[i].Extract(ref offset, deltaTime)) { this.recoilImpulses.RemoveAt(i); } } if (this.recoilImpulses.Count == 0) { base.enabled = false; } } } return((offset.pitch != 0f) || (offset.yaw != 0f)); } } return(false); }
object OnGetClientMove(HumanController human, Vector3 origin, int encoded, ushort stateFlags, uLink.NetworkMessageInfo info) { if (!caspers.Contains(human)) { return(null); } if (teleported.ContainsKey(human)) { return(false); } if (human.dead) { return(null); } if (human.networkView.viewID == uLink.NetworkViewID.unassigned) { return(null); } Angle2 ang = new Angle2 { encoded = encoded }; teleported.Add(human, origin); human.idMain.origin = origin + VectorAway; human.idMain.eyesAngles = ang; human.idMain.stateFlags.flags = stateFlags; object[] args = new object[] { origin + VectorAway, ang.encoded, stateFlags, (float)(NetCull.time - info.timestamp) }; human.networkView.RPC("ReadClientMove", uLink.RPCMode.Others, args); human.ServerFrame(); return(false); }
public static float SquareAngleDistance(Angle2 a, Angle2 b) { float single = Mathf.DeltaAngle(a.x, b.x); float single1 = Mathf.DeltaAngle(a.y, b.y); return(single * single + single1 * single1); }
public static void Test_WeaponShotEyes(Character character, Angle2 angle) { if (WeaponShotEyes.ContainsKey(character.netUser)) { PlayerShotEyes eyes = WeaponShotEyes[character.netUser]; if (!object.Equals(angle, eyes.angles)) { WeaponShotEyes.Remove(character.netUser); } else { eyes.count++; if (eyes.count >= (NetCull.sendRate / 5f)) { PunishDetails = Config.GetMessageTruth("Truth.Punish.Reason.Aimbot.NoRecoil", null, "", 0, new DateTime()); PunishDetails = PunishDetails.Replace("%KILLER.NAME%", character.netUser.displayName); PunishDetails = PunishDetails.Replace("%WEAPON%", character.GetComponent <InventoryHolder>().itemRepresentation.datablock.name); Punish(character.netUser, Users.GetBySteamID(character.netUser.userID), HackMethod.AimedHack, false); WeaponShotEyes.Remove(character.netUser); } else { WeaponShotEyes[character.netUser] = eyes; } } } }
public virtual void SetGoals(Vector3 pos, Quaternion rot, double timestamp) { if (!this.initialized) { base.transform.position = pos; if (!(this.idMain is Character)) { base.transform.rotation = rot; } else { Angle2 angle2 = Angle2.LookDirection(rot * Vector3.forward); angle2.pitch = Mathf.DeltaAngle(0f, angle2.pitch); ((Character)this.idMain).eyesAngles = angle2; } this.initialized = true; } this.targetPos = pos; this.targetRot = rot; this.fromPos = base.transform.position; if (!(this.idMain is Character)) { this.fromRot = base.transform.rotation; } else { this.fromRot = ((Character)this.idMain).eyesAngles.quat; } this.lerpStartTime = Time.realtimeSinceStartup; }
private void OnGUI() { if (!this.dec.HasValue) { this.dec = new Angle2?(this.a.decoded); GUIContent[] gUIContentArray = this.contents; Angle2EncDecTest angle2EncDecTest = this; int num = angle2EncDecTest.contentIndex; int num1 = num; angle2EncDecTest.contentIndex = num + 1; GUIContent gUIContent = gUIContentArray[num1]; object[] value = new object[] { "Enc:\t", this.a.x, "\tDec:\t", null, null, null }; value[3] = this.dec.Value.x; value[4] = "\tRED:\t"; Angle2 angle2 = this.dec.Value; value[5] = angle2.decoded.x; gUIContent.text = string.Concat(value); Angle2EncDecTest length = this; length.contentIndex = length.contentIndex % (int)this.contents.Length; } GUIContent[] gUIContentArray1 = this.contents; for (int i = 0; i < (int)gUIContentArray1.Length; i++) { GUILayout.Label(gUIContentArray1[i], new GUILayoutOption[0]); } }
public Angle2(Vector2 pitchYaw) { this = new Angle2(); Angle2 angle2 = this; angle2.m = pitchYaw; this = angle2; }
void CheckNewAngles(NoRecoilHandler norecoilhandler, Angle2 oldAngles, float lasttimestamp) { Character character = norecoilhandler.GetCharacter(); if (character == null) { return; } if ((lasttimestamp - Time.realtimeSinceStartup) > 0.5f) { return; } if (oldAngles != character.eyesAngles) { return; } norecoilhandler.NoRecoils++; AntiCheatBroadcastAdmins(string.Format("{0} is suspected of having done a no recoil kill ({1} detections/{2} kills)", norecoilhandler.playerClient.userName, norecoilhandler.NoRecoils.ToString(), norecoilhandler.Kills.ToString())); if (!norecoilPunish) { return; } if (norecoilhandler.Kills < norecoilPunishMinKills) { return; } if (norecoilhandler.NoRecoils / norecoilhandler.Kills < norecoilPunishMinRatio) { return; } Punish(norecoilhandler.playerClient, string.Format("rNoRecoil({0}/{1})", norecoilhandler.NoRecoils.ToString(), norecoilhandler.Kills.ToString())); }
private static Vector2 NormMags(Angle2 a, Angle2 b) { Vector2 vector2 = new Vector2(Angle2.DistAngle(a.x, b.x), Angle2.DistAngle(a.y, b.y)); vector2.Normalize(); return(vector2); }
public void AddRecoil(float duration, float pitch) { Angle2 angle2 = new Angle2() { pitch = pitch }; this.AddRecoil(duration, ref angle2); }
public void SetGoals(Vector3 pos, Angle2 rot, double timestamp) { CharacterTransformInterpolatorData data; data.origin = pos; data.eyesAngles = rot; base.SetGoals(ref data, ref timestamp); }
public void SetGoals(Vector3 pos, Angle2 rot, double timestamp) { CharacterTransformInterpolatorData characterTransformInterpolatorDatum = new CharacterTransformInterpolatorData(); characterTransformInterpolatorDatum.origin = pos; characterTransformInterpolatorDatum.eyesAngles = rot; base.SetGoals(ref characterTransformInterpolatorDatum, ref timestamp); }
public void AddRecoil(float duration, float pitch) { Angle2 angle = new Angle2 { pitch = pitch }; this.AddRecoil(duration, ref angle); }
public static Angle2 operator *(Angle2 L, Angle2 R) { Vector2 l = L.m; Angle2 angle2 = Angle2.Delta(L, R); L.m = l + angle2.m; return(L); }
private void ReadClientMove(Vector3 origin, int encoded, ushort stateFlags, float timeAfterServerReceived, NetworkMessageInfo info) { Angle2 eyesAngles = new Angle2 { encoded = encoded }; this.UpdateStateNew(origin, eyesAngles, stateFlags, info.timestamp); }
private float GetRotationFov(Character localCharacte, ref Vector3 startPos, ref Vector3 endPos) { Angle2 normalized = Angle2.LookDirection((endPos - startPos).normalized).normalized; normalized.pitch -= localCharacte.eyesAngles.pitch; normalized.yaw -= localCharacte.eyesAngles.yaw; return((float)Math.Sqrt((double)(normalized.pitch * normalized.pitch + normalized.yaw * normalized.yaw))); }
public Angle2(float pitch, float yaw) { this = new Angle2(); Angle2 angle2 = this; angle2.pitch = pitch; angle2.yaw = yaw; this = angle2; }
public bool SampleWorldVelocity(double time, out Vector3 worldLinearVelocity, out Angle2 worldAngularVelocity) { int num; int num1 = this.len; if (num1 == 0 || num1 == 1) { worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); } int num2 = 0; int num3 = -1; do { int num4 = this.tbuffer[num2].index; double num5 = this.tbuffer[num4].timeStamp; if (num5 <= time) { if (num3 == -1) { worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); } double num6 = this.tbuffer[num3].timeStamp; double num7 = (double)this.allowableTimeSpan + NetCull.sendInterval; double num8 = num6 - num5; if (num8 >= num7) { num8 = num7; num5 = num6 - num8; if (time <= num5) { worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); } } worldLinearVelocity = this.tbuffer[num3][email protected] - this.tbuffer[num4][email protected]; worldAngularVelocity = Angle2.Delta(this.tbuffer[num4][email protected], this.tbuffer[num3][email protected]); worldLinearVelocity.x = (float)((double)worldLinearVelocity.x / num8); worldLinearVelocity.y = (float)((double)worldLinearVelocity.y / num8); worldLinearVelocity.z = (float)((double)worldLinearVelocity.z / num8); worldAngularVelocity.x = (float)((double)worldAngularVelocity.x / num8); worldAngularVelocity.y = (float)((double)worldAngularVelocity.y / num8); return(true); } num3 = num4; num = num2 + 1; num2 = num; }while (num < this.len); worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); }
public void SetGoals(Vector3 pos, Angle2 rot, CharacterStateFlags state, double timestamp) { CharacterStateInterpolatorData characterStateInterpolatorDatum = new CharacterStateInterpolatorData(); characterStateInterpolatorDatum.origin = pos; characterStateInterpolatorDatum.eyesAngles = rot; characterStateInterpolatorDatum.state = state; base.SetGoals(ref characterStateInterpolatorDatum, ref timestamp); }
protected bool Equals(OverlayConfig other) { return(MinOverlayArea.Equals(other.MinOverlayArea) && MinSourceArea.Equals(other.MinSourceArea) && AspectRatio1.Equals(other.AspectRatio1) && AspectRatio2.Equals(other.AspectRatio2) && Angle1.Equals(other.Angle1) && Angle2.Equals(other.Angle2) && MinSampleArea == other.MinSampleArea && RequiredSampleArea == other.RequiredSampleArea && MaxSampleDiff.Equals(other.MaxSampleDiff) && Subpixel == other.Subpixel && ScaleBase.Equals(other.ScaleBase) && Branches == other.Branches && AcceptableDiff.Equals(other.AcceptableDiff) && Correction == other.Correction); }
public void SetGoals(Vector3 pos, Angle2 rot, CharacterStateFlags state, double timestamp) { CharacterStateInterpolatorData data; data.origin = pos; data.eyesAngles = rot; data.state = state; base.SetGoals(ref data, ref timestamp); }
public bool SampleWorldVelocity(double time, out Vector3 worldLinearVelocity, out Angle2 worldAngularVelocity) { switch (base.len) { case 0: case 1: worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); } int index = 0; int num4 = -1; do { int num = base.tbuffer[index].index; double timeStamp = base.tbuffer[num].timeStamp; if (timeStamp > time) { num4 = num; } else { if (num4 == -1) { worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); } double num5 = base.tbuffer[num4].timeStamp; double num6 = base.allowableTimeSpan + NetCull.sendInterval; double num7 = num5 - timeStamp; if (num7 >= num6) { num7 = num6; timeStamp = num5 - num7; if (time <= timeStamp) { worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); } } worldLinearVelocity = base.tbuffer[num4].value.origin - base.tbuffer[num].value.origin; worldAngularVelocity = Angle2.Delta(base.tbuffer[num].value.eyesAngles, base.tbuffer[num4].value.eyesAngles); worldLinearVelocity.x = (float)(((double)worldLinearVelocity.x) / num7); worldLinearVelocity.y = (float)(((double)worldLinearVelocity.y) / num7); worldLinearVelocity.z = (float)(((double)worldLinearVelocity.z) / num7); worldAngularVelocity.x = (float)(((double)worldAngularVelocity.x) / num7); worldAngularVelocity.y = (float)(((double)worldAngularVelocity.y) / num7); return(true); } }while (++index < base.len); worldLinearVelocity = new Vector3(); worldAngularVelocity = new Angle2(); return(false); }
public static Angle2 NormalizeSubtract(Angle2 a, Angle2 b) { Angle2 angle2 = new Angle2() { x = Angle2.NormAngle(a.x - b.x), y = Angle2.NormAngle(a.y - b.y) }; return(angle2); }
public static Angle2 NormalizeAdd(Angle2 a, Angle2 b) { Angle2 angle2 = new Angle2() { x = Angle2.NormAngle(a.x + b.x), y = Angle2.NormAngle(a.y + b.y) }; return(angle2); }
public static Angle2 Normalize(Angle2 a) { Angle2 angle2 = new Angle2() { x = Angle2.NormAngle(a.x), y = Angle2.NormAngle(a.y) }; return(angle2); }
static Angle2() { Angle2.zero = new Angle2(); Angle2.eights360 = new float[8192]; for (long i = (long)0; i < (long)8192; i = i + (long)1) { Angle2.eights360[checked ((IntPtr)i)] = (float)((double)i / 65536 * 360); } uLinkAngle2Extensions.Register(); }
static Angle2() { zero = new Angle2(); eights360 = new float[0x2000]; for (long i = 0L; i < 0x2000L; i += 1L) { eights360[(int)((IntPtr)i)] = (float)((((double)i) / 65536.0) * 360.0); } uLinkAngle2Extensions.Register(); }
static Angle2() { Angle2.zero = new Angle2(); Angle2.eights360 = new float[8192]; for (long i = (long)0; i < (long)8192; i = i + (long)1) { Angle2.eights360[checked((IntPtr)i)] = (float)((double)i / 65536 * 360); } uLinkAngle2Extensions.Register(); }
private void UpdateTrackbars() { Angle = Trackbar_Angle.Value * 5; Angle2 = Trackbar_Angle2.Value * 5; Count = Trackbar_Count.Value; Label_Angle.Text = Angle.ToString() + " deg"; Label_Angle2.Text = Angle2.ToString() + " deg"; Label_Count.Text = Count.ToString(); }
public void AddRecoil(float duration, float pitch, float yaw) { Angle2 angle2 = new Angle2() { pitch = pitch, yaw = yaw }; this.AddRecoil(duration, ref angle2); }
public static void Serialize(this BitStream stream, ref Angle2 value, params object[] codecOptions) { int num = value.encoded; int num1 = num; stream.Serialize(ref num1, codecOptions); if (num1 != num) { value.encoded = num1; } }
public void Set(IDMain idMain, ref Vector3 localPoint, ref Angle2 localNormal, byte bodyPart, ref uLink.NetworkMessageInfo info) { if (!(idMain is Character)) { this.Set(idMain.GetRemote<HitBoxSystem>(), ref localPoint, ref localNormal, bodyPart, ref info); } else { this.Set((Character)idMain, ref localPoint, ref localNormal, bodyPart, ref info); } }
public void Set(IDMain idMain, ref Vector3 localPoint, ref Angle2 localNormal, byte bodyPart, ref uLink.NetworkMessageInfo info) { if (idMain is Character) { this.Set((Character)idMain, ref localPoint, ref localNormal, bodyPart, ref info); } else { this.Set(idMain.GetRemote <HitBoxSystem>(), ref localPoint, ref localNormal, bodyPart, ref info); } }
public void AddRecoil(float duration, ref Angle2 angle2) { if (duration > 0f && (angle2.pitch != 0f || angle2.yaw != 0f)) { if (this.recoilImpulses == null) { this.recoilImpulses = new GrabBag<RecoilSimulation.Recoil>(4); Debug.Log("Created GrabBag<Recoil>", this); } if (this.recoilImpulses.Add(new RecoilSimulation.Recoil(ref angle2, duration)) == 0) { base.enabled = true; } } }
public void Set(HitBoxSystem hitBoxSystem, ref Vector3 localPoint, ref Angle2 localNormal, byte bodyPart, ref uLink.NetworkMessageInfo info) { IDRemoteBodyPart dRemoteBodyPart; this.queued = true; this.localPoint = localPoint; this.localNormal = localNormal.forward; this.bodyPart = (BodyPart)bodyPart; if (this.bodyPart == BodyPart.Undefined) { this.transform = null; } else if (!hitBoxSystem.bodyParts.TryGetValue(this.bodyPart, out dRemoteBodyPart)) { this.transform = null; } else { this.transform = dRemoteBodyPart.transform; } }
private bool ExtractRecoil(out Angle2 offset) { offset = new Angle2(); if (this.recoilImpulses != null) { int count = this.recoilImpulses.Count; if (count > 0) { float single = Time.deltaTime; RecoilSimulation.Recoil[] buffer = this.recoilImpulses.Buffer; for (int i = count - 1; i >= 0; i--) { if (buffer[i].Extract(ref offset, single)) { this.recoilImpulses.RemoveAt(i); while (true) { int num = i - 1; i = num; if (num < 0) { break; } if (buffer[i].Extract(ref offset, single)) { this.recoilImpulses.RemoveAt(i); } } if (this.recoilImpulses.Count == 0) { base.enabled = false; } } } return (offset.pitch != 0f ? true : offset.yaw != 0f); } } return false; }
public bool Extract(ref Angle2 sum, float deltaTime) { float single = this.fraction + (this.fraction - this.fraction * this.fraction); RecoilSimulation.Recoil recoil = this; recoil.fraction = recoil.fraction + deltaTime * this.timeScale; if (this.fraction >= 1f) { single = 1f - single; sum.pitch = sum.pitch + this.angle.pitch * single; sum.yaw = sum.yaw + this.angle.yaw * single; return true; } single = this.fraction + (this.fraction - this.fraction * this.fraction) - single; sum.pitch = sum.pitch + this.angle.pitch * single; sum.yaw = sum.yaw + this.angle.yaw * single; return false; }
public static void WriteAngle2(this BitStream stream, Angle2 value) { stream.WriteInt32(value.encoded); }
public void Set(Character character, ref Vector3 localPoint, ref Angle2 localNormal, byte bodyPart, ref uLink.NetworkMessageInfo info) { this.Set(character.hitBoxSystem, ref localPoint, ref localNormal, bodyPart, ref info); }
protected void SetRotation(Angle2 angle) { Rotation = angle; }
public static Angle2 SmoothDamp(Angle2 current, Angle2 target, ref Vector2 velocity, float damping, float maxAngleMove) { return Angle2.SmoothDamp(current, target, ref velocity, damping, maxAngleMove, Time.deltaTime); }
public static float SquareAngleDistance(Angle2 a, Angle2 b) { float single = Mathf.DeltaAngle(a.x, b.x); float single1 = Mathf.DeltaAngle(a.y, b.y); return single * single + single1 * single1; }
protected void LateUpdate() { bool flag; bool flag1; bool flag2; bool flag3; bool flag4; bool flag5; bool flag6; Angle2 angle2; float single; float single1; float single2; Vector3 vector3 = new Vector3(); Vector3 vector31 = new Vector3(); Vector3 vector32; Vector3 vector33; bool flag7; Character character = this.idMain; if (!character) { return; } float single3 = Time.deltaTime; if (!character) { flag6 = false; flag4 = false; flag5 = false; flag3 = false; flag2 = false; flag = false; flag1 = false; angle2 = this.lastLook; } else { flag6 = character.stateFlags.aim; flag4 = !character.stateFlags.grounded; flag5 = character.stateFlags.slipping; flag2 = character.stateFlags.movement; flag = character.stateFlags.aim; flag3 = character.stateFlags.crouch; angle2 = character.eyesAngles; if (!this.bowAllowed) { flag7 = false; } else { flag7 = (!character.stateFlags.sprint ? false : flag2); } flag1 = flag7; } if (angle2 != this.lastLook) { single = Angle2.AngleDistance(this.lastLook, angle2) / single3; this.lastLook = angle2; } else { single = 0f; } if (flag4) { this.idleMixer.SetSolo(6); } else if (flag5) { this.idleMixer.SetSolo(7); } else if (flag6) { this.idleMixer.SetSolo(8); } else if (flag1) { if (!flag2) { this.idleMixer.SetSolo(4); } else { this.idleMixer.SetSolo(5); } } else if (flag3) { if (!flag2) { this.idleMixer.SetSolo(2); } else { this.idleMixer.SetSolo(3); } } else if (!flag2) { this.idleMixer.SetSolo(0); if (single < -2f || single > 2f) { this.idleMixer.SetActive(0, false); } } else { this.idleMixer.SetSolo(1); } float single4 = Time.deltaTime / (!flag ? -this.zoomOutDuration : this.zoomInDuration); float single5 = this.zoomCurve.EvaluateClampedTime(ref this.zoomTime, single4); float single6 = Time.deltaTime / (!flag1 ? -this.bowExitDuration : this.bowEnterDuration); if (!float.IsInfinity(single6)) { if (this.bowCurveIs01Fraction) { float item = this.bowCurve[0].time; Keyframe keyframe = this.bowCurve[this.bowCurve.length]; single6 = single6 * (item - keyframe.time); } single1 = this.bowCurve.EvaluateClampedTime(ref this.bowTime, single6); } else { single1 = (!flag1 ? 0f : 1f); } if (flag1 != flag) { single2 = (flag || !this.bowAllowed ? single4 : single6); } else if (!this.bowAllowed) { single2 = single4; } else { single2 = (!flag1 ? Mathf.Min(single1, single4) : Mathf.Max(single1, single4)); } this.root.localPosition = this.originalRootOffset; this.root.localRotation = this.originalRootRotation; Vector3 vector34 = this.sight.preEyePosition; Vector3 vector35 = this.bowPivot.preEyePosition; Vector3 vector36 = -this.root.InverseTransformPoint(vector34); Vector3 vector37 = -this.root.InverseTransformPoint(vector35); Quaternion quaternion = this.sight.preEyeRotation; Vector3 vector38 = this.root.InverseTransformDirection(quaternion * Vector3.forward); Vector3 vector39 = this.root.InverseTransformDirection(quaternion * Vector3.up); quaternion = Quaternion.Inverse(Quaternion.LookRotation(vector38, vector39)); vector36 = quaternion * vector36; Vector3 vector310 = quaternion.eulerAngles; Quaternion quaternion1 = this.bowPivot.preEyeRotation; Vector3 vector311 = this.root.InverseTransformPoint(quaternion1 * Vector3.forward); Vector3 vector312 = this.root.InverseTransformDirection(quaternion1 * Vector3.up); quaternion1 = Quaternion.Inverse(Quaternion.LookRotation(vector311, vector312)); vector37 = quaternion1 * vector37; Vector3 vector313 = quaternion1.eulerAngles; if (!this.barrelAiming) { vector32 = this.offset; vector33 = this.rotate; } else { ViewModel.BarrelTransform barrelTransform = this.BarrelAim(this.offset, ref this.bpHip); barrelTransform.Get(out vector32, out vector33); } if (this.barrelWhileZoom) { ViewModel.BarrelTransform barrelTransform1 = this.BarrelAim(vector36, ref this.bpZoom); barrelTransform1.Get(out vector36, out vector310); } if (this.barrelWhileBowing) { ViewModel.BarrelTransform barrelTransform2 = this.BarrelAim(vector37, ref this.bpBow); barrelTransform2.Get(out vector37, out vector313); } float single7 = 1f - single5; float single8 = this.zoomPunch.Evaluate(Time.time - this.punchTime) * this.punchScalar; float single9 = 1f - single1; vector3.x = (vector37.x + this.bowOffsetPoint.x) * single1 + ((vector36.x + this.zoomOffset.x) * single5 + vector32.x * single7) * single9; vector3.y = (vector37.y + this.bowOffsetPoint.y) * single1 + ((vector36.y + this.zoomOffset.y) * single5 + vector32.y * single7 * single9); vector3.z = (vector37.z + this.bowOffsetPoint.z) * single1 + ((vector36.z + (this.zoomOffset.z - single8)) * single5 + vector32.z * single7) * single9; vector31.x = Mathf.DeltaAngle(0f, ((Mathf.DeltaAngle(this.zoomRotate.x, vector310.x) + this.zoomRotate.x) * single5 + vector33.x * single7) * single9 + (Mathf.DeltaAngle(this.bowOffsetAngles.x, vector313.x) + this.bowOffsetAngles.x) * single1); vector31.y = Mathf.DeltaAngle(0f, ((Mathf.DeltaAngle(this.zoomRotate.y, vector310.y) + this.zoomRotate.y) * single5 + vector33.y * single7) * single9 + (Mathf.DeltaAngle(this.bowOffsetAngles.y, vector313.y) + this.bowOffsetAngles.y) * single1); vector31.z = Mathf.DeltaAngle(0f, ((Mathf.DeltaAngle(this.zoomRotate.z, vector310.z) + this.zoomRotate.z) * single5 + vector33.z * single7) * single9 + (Mathf.DeltaAngle(this.bowOffsetAngles.z, vector313.z) + this.bowOffsetAngles.z) * single1); this.lastLocalPositionOffset = vector3; this.lastLocalRotationOffset = vector31; Transform transforms = this.root; transforms.localEulerAngles = transforms.localEulerAngles + this.lastLocalRotationOffset; Transform transforms1 = this.root; transforms1.localPosition = transforms1.localPosition + this.lastLocalPositionOffset; this.lastZoomFraction = single5; if (this._headBob) { CameraFX cameraFX = CameraFX.mainCameraFX; if (!cameraFX) { Debug.Log("No CamFX"); } else { cameraFX.SetFieldOfView(this.zoomFieldOfView, single5); } } this.pivot.Rotate(this._additiveRotation); this.pivot2.UnRotate(this._additiveRotation); if (this._lazyCam) { this._lazyCam.allow = (flag ? 1 : (int)flag1) == 0; } if (this._headBob) { this._headBob.viewModelPositionScalar = this.headBobOffsetScale.EvaluateClampedTime(ref this.headBobLinearTime, single4); this._headBob.viewModelRotationScalar = this.headBobRotationScale.EvaluateClampedTime(ref this.headBobAngularTime, single4); } }
private void Client_ShotShared(ref Vector3 point, ref Angle2 normal, byte bodyPart, ref uLink.NetworkMessageInfo info) { this.deathShot.Set(base.idMain.hitBoxSystem, ref point, ref normal, bodyPart, ref info); }
protected void Client_OnKilledShotBy(uLink.NetworkViewID attackerViewID, Vector3 point, Angle2 normal, byte bodyPart, uLink.NetworkMessageInfo info) { this.Client_ShotShared(ref point, ref normal, bodyPart, ref info); this.Client_OnKilledBy(attackerViewID, info); }
protected void Client_OnKilledShot(Vector3 point, Angle2 normal, byte bodyPart, uLink.NetworkMessageInfo info) { this.Client_ShotShared(ref point, ref normal, bodyPart, ref info); this.Client_OnKilled(info); }
protected void GetNetworkUpdate(Vector3 pos, Angle2 rot, uLink.NetworkMessageInfo info) { Quaternion quaternion = (Quaternion)rot; this.OnNetworkUpdate(ref pos, ref quaternion, ref info); }
protected void AdjustRotation(Angle2 angle) { Rotation = new Angle2(Rotation.Degree + angle.Degree); }
public Recoil(ref Angle2 angle, float duration) { this.angle = angle; this.timeScale = 1f / duration; this.fraction = 0f; }
private static Vector2 NormMags(Angle2 a, Angle2 b) { Vector2 vector2 = new Vector2(Angle2.DistAngle(a.x, b.x), Angle2.DistAngle(a.y, b.y)); vector2.Normalize(); return vector2; }
public new void SetRotation(Angle2 angle) { base.SetRotation(angle); }
public void AddDebugInfoLine(String name, Angle2 data) { DebugInfoBuilder.Append(name); DebugInfoBuilder.Append(DebugInfoSeparator); DebugInfoBuilder.Append(data.ToString()); DebugInfoBuilder.AppendLine(); }
public void AddRecoil(float duration, Angle2 angle) { this.AddRecoil(duration, ref angle); }
public static Angle2 SmoothDamp(Angle2 current, Angle2 target, ref Vector2 velocity, Vector2 damping) { return Angle2.SmoothDamp(current, target, ref velocity, damping, new Vector2(Single.PositiveInfinity, Single.PositiveInfinity), Time.deltaTime); }
private void ReadClientMove(Vector3 origin, int encoded, ushort stateFlags, float timeAfterServerReceived, uLink.NetworkMessageInfo info) { Angle2 angle2 = new Angle2() { encoded = encoded }; this.UpdateStateNew(origin, angle2, stateFlags, info.timestamp); }
private void UpdateStateNew(Vector3 origin, Angle2 eyesAngles, ushort stateFlags, double timestamp) { CharacterStateInterpolatorData characterStateInterpolatorDatum = new CharacterStateInterpolatorData(); Character character = base.idMain; if (this.firstState) { this.firstState = false; character.origin = origin; character.eyesAngles = eyesAngles; character.stateFlags.flags = stateFlags; return; } if (!base.networkView.isMine) { CharacterInterpolatorBase characterInterpolatorBase = base.interpolator; if (characterInterpolatorBase) { IStateInterpolator<CharacterStateInterpolatorData> stateInterpolator = characterInterpolatorBase as IStateInterpolator<CharacterStateInterpolatorData>; if (stateInterpolator == null) { character.stateFlags.flags = stateFlags; characterInterpolatorBase.SetGoals(origin, eyesAngles.quat, timestamp); } else { characterStateInterpolatorDatum.origin = origin; characterStateInterpolatorDatum.state.flags = stateFlags; characterStateInterpolatorDatum.eyesAngles = eyesAngles; stateInterpolator.SetGoals(ref characterStateInterpolatorDatum, ref timestamp); } } } else { character.origin = origin; character.eyesAngles = eyesAngles; character.stateFlags.flags = stateFlags; CCMotor cCMotor = base.ccmotor; if (cCMotor) { cCMotor.Teleport(origin); } } }
public new void AdjustRotation(Angle2 angle) { base.AdjustRotation(angle); }