internal override void Copy(PhysicsBodyState state) { base.Copy(state); var playerState = (PlayerState)state; Animation = playerState.Animation; Physics = playerState.Physics; ScopeAngle = playerState.ScopeAngle; IsGrounded = playerState.IsGrounded; IsClingedWall = playerState.IsClingedWall; InputJumpedStep = playerState.InputJumpedStep; JumpedStep = playerState.JumpedStep; LandedStep = playerState.LandedStep; HorizontalCorrectionStep = playerState.HorizontalCorrectionStep; HittedStep = playerState.HittedStep; LastFallingVelocityYFactor = playerState.LastFallingVelocityYFactor; LandingVelocityYFactor = playerState.LandingVelocityYFactor; IsDead = playerState.IsDead; }
internal static void Lerp(float progress, PhysicsBodyState from, PhysicsBodyState to, PhysicsBodyState progressState) { progressState.Position = Mathf.Lerp(progress, from.Position, to.Position); progressState.LinearVelocity = Mathf.Lerp(progress, from.LinearVelocity, to.LinearVelocity); }
internal virtual void Copy(PhysicsBodyState state) { BodyCache.Clone(state.BodyCache); Position = BodyCache.Position; LinearVelocity = BodyCache.LinearVelocity; }