public virtual void Draw(SpriteBatch spriteBatch, Camera cam) { if (simplePhysicsEnabled) { return; } Collider.UpdateDrawPosition(); if (Limbs == null) { DebugConsole.ThrowError("Failed to draw a ragdoll, limbs have been removed. Character: \"" + character.Name + "\", removed: " + character.Removed + "\n" + Environment.StackTrace); GameAnalyticsManager.AddErrorEventOnce("Ragdoll.Draw:LimbsRemoved", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, "Failed to draw a ragdoll, limbs have been removed. Character: \"" + character.Name + "\", removed: " + character.Removed + "\n" + Environment.StackTrace); return; } //foreach (Limb limb in Limbs) //{ // limb.Draw(spriteBatch, cam); //} for (int i = 0; i < limbs.Length; i++) { inversedLimbDrawOrder[i].Draw(spriteBatch, cam); } LimbJoints.ForEach(j => j.Draw(spriteBatch)); }
partial void UpdateProjSpecific(float deltaTime) { LimbJoints.ForEach(j => j.UpdateDeformations(deltaTime)); foreach (var deformation in SpriteDeformations) { if (deformation.DeformationParams.UseMovementSine) { if (this is AnimController animator) { //deformation.Phase = MathUtils.WrapAngleTwoPi(animator.WalkPos + MathHelper.Pi); deformation.Phase = MathUtils.WrapAngleTwoPi(animator.WalkPos * deformation.DeformationParams.Frequency + MathHelper.Pi * deformation.DeformationParams.SineOffset); } } else { deformation.Update(deltaTime); } } }
partial void UpdateProjSpecific(float deltaTime) { LimbJoints.ForEach(j => j.UpdateDeformations(deltaTime)); SpriteDeformations.ForEach(sd => sd.Update(deltaTime)); }