|
| 02 May 2016 09:48 PM |
I'm trying to write a function that finds the velocity of an object at a specific point taking in the object's velocity and rotational velocity properties. I know how to find the magnitude of the rotational velocity when it is translated into normal velocity, but not the direction.
function velocity(o,p)
local v,rv,pos = o.Velocity, o.RotVelocity, o.Position
local d = (p-pos).magnitude
local V = v.magnitude local RV = rv.magnitude
local rot = math.pi * d * RV local dir = ????? -- this is where i need help
return v + (dir * rot)
end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 02 May 2016 11:09 PM |
velocity is usually constant. If we wanted to increase velocity we would simply increase the constant value. so if the constant value is 1 we increase it to 5. scaling velocity is more of a challenge, but if you are able to make it constant, then you just need key elements to increase the speed for a duration and then revert it back to the orginal speed. I recommend trying the 4th thing i mentioned which is to increase the speed for a duration |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 03 May 2016 12:15 AM |
function velocity(o,p)
local v,rv,pos = o.Velocity, o.RotVelocity, o.Position
return v + rv:Cross((p-pos))
end |
|
|
| Report Abuse |
|
|
|
| 03 May 2016 07:31 AM |
Thank you!
I'm a bit late because I went to sleep. Will test later. |
|
|
| Report Abuse |
|
|