How to receive linear velocity?

Posted By: Jason Bryant

How to receive linear velocity? - 06/23/03 02:09

I can't seem to get the linear velocity of my physics object. When I use phent_getvelocity, I can't seem to get only the linear velocity. It seems to be a combination of linear and angular velocity. I may just be using the command incorrectly, but there isn't an example of it being used in the manual. [Frown]

Would someone please post a simple example that shows how to get the linear velocity of an object using phent_getvelocity?

Thanks,
Jason
Posted By: Phantom88

Re: How to receive linear velocity? - 06/23/03 17:36

code:
phent_getvelocity(my, temp, nullvector);

Now Temp is the linear velocity.

~Phantom88~
Posted By: Jason Bryant

Re: How to receive linear velocity? - 06/24/03 00:19

code:
  
str_cpy(temp_str1,"L Vel: ");
draw_text(temp_str1,400,30,vector(150,75,75));
phent_getvelocity(ball,temp,vector(0,0,0));
temp2 = vec_dist(temp,vector(0,0,0));
str_for_num(temp_str1,temp2);
draw_text(temp_str1,450,30,vector(150,75,75));

The above code is what I'm using... is this correct? temp2 still appears to be affected by the angular velocity of the ball...

Jason
Posted By: James Snydstrup

Re: How to receive linear velocity? - 06/24/03 01:12

quote:
phent_getvelocity(ball,temp,vector(0,0,0));
According to the manual you should get linear velocity using the above command. However, I haven't had any luck getting the linear velocity from any physics object that rotates i.e wheels using the above line of code.
Posted By: Jason Bryant

Re: How to receive linear velocity? - 06/24/03 01:24

I had read these posts before: http://www.conitecserver.com/ubb/ultimatebb.php?ubb=get_topic;f=32;t=000011

but I had thought that I would still be able to obtain the linear velocity. The physics object I'm trying to get the information for is a rolling ball. I must be having the same problem as you then James. I wasn't sure if I was interpreting and using the commands correctly.

Thanks,
Jason
© 2024 lite-C Forums