Box2DX.Dynamics.Controllers.TensorDampingController.Step C# (CSharp) 메소드

Step() 공개 메소드

public Step ( TimeStep step ) : void
step TimeStep
리턴 void
        public override void Step(TimeStep step)
        {
            float timestep = step.Dt;
            if (timestep <= Settings.FLT_EPSILON)
                return;
            if (timestep > MaxTimestep && MaxTimestep > 0)
                timestep = MaxTimestep;
            for (ControllerEdge i = _bodyList; i != null; i = i.nextBody)
            {
                Body body = i.body;
                if (body.IsSleeping())
                    continue;

                Vector2 damping = body.GetWorldVector(T.Multiply(body.GetLocalVector(body.GetLinearVelocity())));
                body.SetLinearVelocity(body.GetLinearVelocity() + timestep*damping);
            }
        }
TensorDampingController