Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Explore solutions for ensuring that an object stays within a resistance perimeter #115

Open
jverkoey opened this issue Apr 24, 2017 · 0 comments

Comments

@jverkoey
Copy link
Contributor

jverkoey commented Apr 24, 2017

There are two classes of problem with regards to resistance perimeters:

  1. Velocity. Tossing velocity beyond the perimeter should be affected accordingly. Tossing within the perimeter should have no effect on the velocity until the object moves beyond the perimeter.
  2. It should not be possible to move beyond the perimeter's maximum length.

Velocity

If we drag beyond a resistance perimeter and release in a direction moving away from the resistance perimeter then we should reduce the velocity accordingly. The current behavior allows you to toss an object while extended beyond the resistance perimeter with full velocity, resulting in the view noticeably extending past the resistance perimeter.

One option: Minimize the finalVelocity if we're beyond the resistance perimeter. This isn't perfect and doesn't solve the case where we're within the perimeter and toss quickly towards the perimeter.

Extending beyond the perimeter

We should never be able to move past the perimeter's maximum length. This is possible if we only apply resistance to the draggable part of a tossable interaction, for example.

One option: introduce an intermediary property in Tossable that we write both draggable and spring to, and then connect a rubber banded stream from that property to the output property. This may be the most promising solution.

@jverkoey jverkoey changed the title Draggable's finalVelocity should be affected by its resistance perimeter Explore solutions for ensuring that an object stays within a resistance perimeter Apr 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant