Getting velocity of an object

Scripting questions, discussions, etc
3 posts Page 1 of 1
Duion
Posts: 760
Joined: Sun Feb 08, 2015 1:51 am
 
  by Duion » Sun Jan 15, 2017 1:54 am
So there is the getVelocity command which gets the velocity, only problem is, it returns the velocity for each axis x,y,z, to make it more complicated it can be positive and negative as well so you could get a result like +5.2, -2.4, 0.1 which means +5.2 into the positive x-axis and 2.4 towards the negative y-axis and 0.1 upwards.

How you get the objects speed now in meters per second like it is used in the datablock?
Do I really have to do complicated math to convert all of this values into one positive number or is there a better method?
damik
Posts: 26
Joined: Thu Jun 23, 2016 12:02 pm
by damik » Sun Jan 15, 2017 10:32 am
try
%vel = VectorDist( "0 0 0", %obj.getVelocity() );
Duion
Posts: 760
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Sun Jan 15, 2017 10:46 am
That seems to work, thanks.
3 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest