velocity torus
5 posts • Page 1 of 1
velocity torus
how can I create a velocity torus which accelerates the object collide with the torus inside exactly the same as the original velocity and rotate the angle to the angle of the tangent line to the contact point?
- sunnyshi2005
- Posts: 7
- Joined: Wed Jun 14, 2017 3:33 am
Re: velocity torus
What is a velocity torus?
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: velocity torus
v = math.vec.len(vel);
ang = math.atan2(y,x)+-math.pi/2; (pick either + or - to determine the rotation direction)
vel = v*[math.cos(ang),math.sin(ang)]
ang = math.atan2(y,x)+-math.pi/2; (pick either + or - to determine the rotation direction)
vel = v*[math.cos(ang),math.sin(ang)]
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
Re: velocity torus
FRA32 - Could you please explain what that does in words so that math dummies like me could understand it?
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: velocity torus
Oof so many necro answers, but this forums dead anyways.
My script would take the velocity and the position, determine the angle the position had to a point, and set the velocity perpendiicular to that, causing the object to orbit around a point. I didn't really understand their question so I just gave them that answer hoping it would fit xP
My script would take the velocity and the position, determine the angle the position had to a point, and set the velocity perpendiicular to that, causing the object to orbit around a point. I didn't really understand their question so I just gave them that answer hoping it would fit xP
- FRA32
- Posts: 229
- Joined: Wed Dec 03, 2014 9:51 pm
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests