Nez.Portable/ECS/Components/Physics/TiledMapMover.cs
/// <summary>
/// resets collision state and does sub-pixel movement calculations
/// </summary>
/// <param name="motion">Motion.</param>
resets collision state and does sub-pixel movement calculations
resets collision state and does sub - pixel movement calculations
public void reset(ref Vector2 motion)
            {
                if (motion.X == 0)
                    right = left = false;
                if (motion.Y == 0)
                    above = below = false;
                becameGroundedThisFrame = isGroundedOnOneWayPlatform = false;
                slopeAngle = 0f;
                _movementRemainderX.update(ref motion.X);
                _movementRemainderY.update(ref motion.Y);
                if (below && motion.Y == 0 && _movementRemainderY.remainder > 0)
                {
                    motion.Y = 1;
                    _movementRemainderY.reset();
                }
            }
public void reset ( ref Vector2 motion ) { if ( motion . X == 0 ) right = left = false ; if ( motion . Y == 0 ) above = below = false ; becameGroundedThisFrame = isGroundedOnOneWayPlatform = false ; slopeAngle = 0f ; _movementRemainderX . update ( ref motion . X ) ; _movementRemainderY . update ( ref motion . Y ) ; if ( below && motion . Y == 0 && _movementRemainderY . remainder > 0 ) { motion . Y = 1 ; _movementRemainderY . reset ( ) ; } }
resets collision state and does sub-pixel movement calculations
resets collision state and does sub - pixel movement calculations
// deal with subpixel movement, storing off any non-integar remainder for the next frame // due to subpixel movement we might end up with 0 gravity when we really want there to be at least 1 pixel so slopes can work
Vector2
ref
motion
None