CoolShank8
New member
- Joined
- Aug 14, 2020
- Messages
- 4
local function GetPositionAtTime(Time, Origin, IntitalVelocity, Acceleration)
local Force = Vector3.new((Acceleration.X * Time^2) / 2,(Acceleration.Y * Time^2) / 2, (Acceleration.Z * Time^2) / 2)
return Origin + (IntitalVelocity * Time) + Force
end
Basically I have this function someone wrote, I want to convert it into an recursive sequence meaning depending on it's last position and last velocity and time from previousframe. I don't understand how I would do this. I mean I know how to do it only when velocity is involved.
Position = CurrentPosition + (Currentvelocity * TimeFromPreviousFrame)
However when extra forces are involved im totally confused :\ Also please don't tell me the answer just give me an idea how to get started I want to learn how to do it, so next time I won't ask this question
local Force = Vector3.new((Acceleration.X * Time^2) / 2,(Acceleration.Y * Time^2) / 2, (Acceleration.Z * Time^2) / 2)
return Origin + (IntitalVelocity * Time) + Force
end
Basically I have this function someone wrote, I want to convert it into an recursive sequence meaning depending on it's last position and last velocity and time from previousframe. I don't understand how I would do this. I mean I know how to do it only when velocity is involved.
Position = CurrentPosition + (Currentvelocity * TimeFromPreviousFrame)
However when extra forces are involved im totally confused :\ Also please don't tell me the answer just give me an idea how to get started I want to learn how to do it, so next time I won't ask this question