Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Sat Oct 20, 2018 11:59 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Jul 29, 2008 5:08 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
has a very simple question but I think not comment on exchange
adhesion an object

S'est une question très simple mais je trouve pas comment on change l'adhérence d'un object


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 12:02 am 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
s'est bon j'ai trouver

raydium_ode_element_slip


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 31, 2008 8:34 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
ok :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 08, 2008 3:15 pm 
Offline

Joined: Tue Jul 22, 2008 1:59 pm
Posts: 7
How are you going to add adhesion? I would like to do that too. The tires should stick or slip more realistically.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 08, 2008 4:38 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
The function raydium_ode_element_slip() (http://wiki.raydium.org/wiki/RaydiumApiReference#543) can be used to add a certain material behaviour to an element.
Here the different slip type pre-defined in Raydium:
    #define RAYDIUM_ODE_SLIP_ICE 5.f
    #define RAYDIUM_ODE_SLIP_PLAYER 10.f
    #define RAYDIUM_ODE_SLIP_NORMAL 0.4f
    #define RAYDIUM_ODE_SLIP_DEFAULT RAYDIUM_ODE_SLIP_NORMAL
Also you can modify the ERP and CFM (more complex way) to get your custom behaviour with raydium_ode_element_material (http://wiki.raydium.org/wiki/RaydiumApiReference#541)

These are the raydium pre-defined values (from ode.h)
    #define RAYDIUM_ODE_MATERIAL_HARD 0.9,0.1
    #define RAYDIUM_ODE_MATERIAL_MEDIUM 0.5,0.5
    #define RAYDIUM_ODE_MATERIAL_SOFT 0.1,0.9
    #define RAYDIUM_ODE_MATERIAL_SOFT2 0.0,0.9
    #define RAYDIUM_ODE_MATERIAL_DEFAULT RAYDIUM_ODE_MATERIAL_HARD


So for example you can set an element like
raydium_ode_element_material(element,RAYDIUM_ODE_MATERIAL_SOFT);
or a bit more soft, but not as soft as soft2 with:
raydium_ode_element_material(element,0.05,0.9);

The best way is try-out


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 10, 2008 12:48 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
I have done a grip variable depending on
where is the wheel(coordinate the wheel
x*10 y*10) and you look at its coordinate on a picture
color picture determines adhesion)
I knew if was not very clear if you need
Precision said the month

moi j'ai fait une adhérence variable en fonction de
l'endroit ou se trouve les roue (cordonner de la roue en
x*10 y*10) et on regarde ses cordonner sur une image la
couleur de l'image détermine l'adhérence)
je sait pas si s'est très claire si vous avez besoin de
précision dit le mois


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 11, 2008 1:00 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
If i'm not wrong your are getting the postion of each wheel (X,Y coordinates) and checking those coordinates in the planar texture of "material" of the ground.
So you should get 4 values each frame, right?
Then you just have to apply those grips (in an scale from 0,absolute friction, to 10, no friction).
Example
Code:
void display()
{
... your code...
value=your_magic_function_to get_grip_in_wheel(0);
raydium_ode_element_slip(wheel0element,value);
... your code...
}

Not sure if you need more explanations...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 11, 2008 10:50 pm 
Offline

Joined: Tue Jul 22, 2008 1:52 pm
Posts: 82
I do not use the texture of the ground but another
texture (only the red channel by channel is blue
used for check point and the green is not
use for the moment)
http://cortexet.free.fr/CarRcWeapon/surface.png
it is loaded into a table and as you said it
I look at the coordinate of each wheel in this table
http://cortexet.free.fr/CarRcWeapon/friction.c
elem_roue took the wheel

to create the texture I made a texture that represents
map http://cortexet.free.fr/CarRcWeapon/tri_png.c
cut is not useful and a separate color
we arrive in gimp easily edit

http://cortexet.free.fr/CarRcWeapon/


je n'utilise pas la texture du ground mais une autre
texture (uniquement le canal rouge le canal bleu est
utiliser pour les check point et le vert n'est pas
utiliser pour le moment)
http://cortexet.free.fr/CarRcWeapon/surface.png
elle est charger dans un tableau et la comme tu la dit
je regarde les cordonner de chaque roue dans ce tableau
http://cortexet.free.fr/CarRcWeapon/friction.c
elem_roue s'est les roue

pour crée la texture je fait une texture qui représente
la map http://cortexet.free.fr/CarRcWeapon/tri_png.c je
coupe se qui n'est pas utile et en séparent les couleur
dans gimp on arrive facilement a l'éditer

http://cortexet.free.fr/CarRcWeapon/


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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