generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Need help with vector math

Previous Thread :: Next Thread 
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
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
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
02 May 2016 10:35 PM
Bump 1
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
02 May 2016 11:05 PM
Bump 2
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
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 is not online. 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
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
03 May 2016 07:31 AM
Thank you!

I'm a bit late because I went to sleep. Will test later.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image