Jump to content
Sign in to follow this  
MadMax50

clamping vel in pyro sim

Recommended Posts

Hello,

Is there a way to make a pyro sim travel at a constant speed. I tried to clamp the vel but I dont think im doing it correctly.

In a gas field wrangle I am writing this:


v@vel.y=clamp(@vel.y, -.5, .5);
v@vel.x=clamp(@vel.x, -.5, .5);
v@vel.z=clamp(@vel.z, -.5, .5);

 

I think its working but I was wondering if there was a better way to achieve this

I will attach my hip file

Thank you

clamp_vel_pyro.hip

Share this post


Link to post
Share on other sites
// clamp speed
v@vel = normalize(v@vel)*min(length(v@vel),chf("max_vel"));

 

  • Like 1

Share this post


Link to post
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
Sign in to follow this  

×