Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Feb 21, 2019 8:19 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Aug 02, 2007 4:33 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
In my tests with planes i have a new need. I want to know the inclination that a plane has according the movement vector (not always necessary 100% forward).

The full idea is:
The plane can be though like a plane square. If that square is moving forward the collision with the air will be zero, cause they are (aprox) parallel each other.
But as much inclination have that square(the plane changes direction) more intense will be the friction with the air, cause the square and the air are going more and more perpendicular.
I want to get this value to add a force perpendicular to the plane with the function of brake the plane in the air according the air friction.

Maybe is not too well explained...
I want to know the angle between the vector of the movement and the orientation of the plane. "Just" that.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 8:51 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
You can ask an element its linear velocity, using something like "raydium_ode_element_linearvelocity_get()", then it's just a matter of math to substract this vector to the plane orientation vector ("raydium_ode_element_RelPointPos()" can do the trick, for example).

I may have missed your question, let me know if it's the case ;)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 9:22 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Ok, but maybe the problem are the maths(my algebra is a bit basic).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 9:46 am 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Even if it's in french, have a look to this page:

http://wiki.raydium.org/wiki/ModelPhys

this code get plane velocity and translate to local :
Code:
dReal *v = dBodyGetLinearVel(bodycorp);
        dBodyVectorFromWorld(bodycorp, v[0], v[1], v[2], localv);


it's direct hit to ode, but this code should work.

i'll send you entire source code in september ! sure !

Bye Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 2:47 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Yep. And this may help you a bit to make it a bit more using RayODE:
Code:
dReal *res;
dReal resl[3];
...
res=raydium_ode_element_linearvelocity_get_name("corps");
dBodyVectorFromWorld(raydium_ode_element[raydium_ode_element_find("corps")].body,res[0],res[1],res[2],resl);


We should probably wrap dBodyVectorFromWorld() in ode.c.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group