Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / [dark dynamix] how to know the body velocity

Author
Message
Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 19th Jan 2013 12:58
Hi, what command I have to use to obtain the actual speed (velocity)of one body?

I was looking for DYN GET LINEAR VELOCITY command but I can't to understand if this is the right command.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 20th Jan 2013 10:32
Should be, perhaps give more information what you are trying to use it for...

I do not own DDYN yet, but I have DP

Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 20th Jan 2013 17:48
Hi MrValentine. In finish I just would to get the linear velocity of one actor.
The DYN GET LINEAR VELOCITY seems to do that but, from the manual:

Quote: "
DYN GET LINEAR VELOCITY (int objectID, int vector3ID)

Fetches the linear velocity of an actor and places the values in the given vector.

Parameters:
objectID - ID number of the object whose associated actor you wish to access.
vector3ID - ID number of the vector you wish to use to collect the data.


Returns:
None

"

You haven't DarkDynamix but maybe you can help me about.
From what I understand, this command let us collect the linear velocity data of a rigid body,not returning a value but filling a 3D vector...

Maybe we can use DYN UTIL ARRAY VEC3 GET command to pass the 3D vector to an array.. .From the manual:

Quote: "
DYN UTIL ARRAY VEC3 GET (unsigned int position, int outVec3ID)

This command will get the 3 float vector at the given array index.

Parameters:
position - Position in the array, starts at 0.
ourVec3ID - ID number of the dark basic vector to place the required data.


Returns:
None

"


What do you think about?
Matty H
16
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th Jan 2013 19:54
You use the dark basic commands to create a vector3, you then pass that vector ID to the command and it fills it with values.

You now have the velocity for the x, y and z components. For a scalar value for velocity you can do:

sqrt(x*x + y*y + z*z)

If you are just comparing the velocity then don't use the sqrt part since it is slow. Just compare the squared value.

Alduce
22
Years of Service
User Offline
Joined: 26th Oct 2002
Location: Rama spaceship
Posted: 21st Jan 2013 09:06
Thank you Matty H, today I will try something about!

Login to post a reply

Server time is: 2024-11-24 12:24:29
Your offset time is: 2024-11-24 12:24:29