Jump to content
Search Community

ThowProps PhysicsProps spinning planet endlessly?

Blaze test
Moderator Tag

Recommended Posts

Hi there,

 

I'm trying to set up a 3d planet which can be rotated by the user by dragging it left right horizontally. At first glance throwProps seems ideal for it, but I don't want the planet to stop rotating. If I understand right throwProps will always come to a full stop? But I need the planet to carry on rotating endlessly at a minimum speed if the user stops interacting. If the user drags it again into some direction, the planet should go faster then go back into it's endless rotation minimum speed.

 

I've looked into physicsProps, by setting the time to some very high value and the velocity to some set number, it rotates fine, but as soon as I set the acceleration it will just carry on going faster and faster, similar story with friction. Is there a way to specify a max ceiling speed and minimum speed for physicsProps?

 

I've also tried an initial sine in tween followed by a linear tween on a loop, which isn't very far from what I am trying to achieve, but there's an obvious little glitch in speed when the sine in tween meets the linear tween.

 

I wonder if I'm approaching this problem from the right angle and such a set up feasible with Greensocks? Which I bet it is... ; )

 

Any tips much appreciated!

Link to comment
Share on other sites

You're right about ThrowPropsPlugin - that's built to come to a complete stop. And there isn't a way to set a max/min velocity for PhysicsPropsPlugin. One idea would be for you to just create an ENTER_FRAME loop that runs your rotation logic at a speed that's set by some variable which you can tween. Maybe it starts at 100 and you can tween it to 500 and your function factors that into its calculations for the spin/rotation. That way, you're just tweening a simple property/variable and it eases nicely into your base speed. 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...