Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Mar 19, 2024 2:56 am

All times are UTC




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Sun Nov 18, 2007 10:22 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
One more post.

Looks like we will need an ODE function to copy objects. I already have asked in the ODE channel but they told me there is no such a function in ODE.


I have done a try but it crash:
Code:
int raydium_ode_object_clone(char *object)
{
    int cloneid;
    int id;
    id=raydium_ode_element_find(object);
    cloneid=raydium_ode_object_find("CLONE");
    cloneid=raydium_ode_object_create ("CLONE");
   
    raydium_log("Original Object ID: %d",id);
    raydium_log("Clone Object ID: %d",cloneid);
   
    dBodySetData (cloneid, dBodyGetData (id));
   
    raydium_log("Object Cloned");

}

Surely dBodySetData doesn't works as i want :)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 1:55 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Duplicating an ODE entity is a complex thing. You need to get type (sphere ? box ?), "mode" (static ? standard ?), geom data (size), body data (density, ERP/CFM, ...) and all RayODE things (tag, mesh, callbacks, ...). Each application will probably duplicate objects in a different way than other apps.

IMHO, Raydium can only provide something like raydium_ode_element_duplicate_simple(...), duplicating only main "characteristics" of an element.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 18, 2007 11:25 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Maybe we can focus the duplication in other way.

Perheps we can put all the weight of the duplication into raydium and forget ODE.
For example we can create an object log system. When an object is created we can register all the step we want into the log until we want.

objectID=raydium_ode_create.....
raydium_ode_log_record(objectid);
creation operations...
raydium_ode_log_stop(objectid);

Then, a raydium_ode_object_clone(objectid,newobject) could repeat all the steps previously recorded.

Sadly, a few raydium_ode_* functions would have to be modify to include the log support.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 2:40 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
It will be a nightmare to write ! 80% of RayODE functions must be updated :)
And it will be even more difficult to maintain the "..._clone()" function (requires a giant switch/case with all RayODE functions, for example).

I really think that RayODE can provide a "raydium_ode_element_duplicate_simple(...)" sort of function, it will probably be suitable 90% of the time.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 4:49 pm 
Offline

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

If i'm right: Object don't exist twice with portal, so we need to destroy and re-create object.

The main trouble, i think, is that ode is an iterative solver. So we can't do what we want.

In few week's i'll have more time to have a look to this portal and win32 sdk !

I think we need to backup object (body) parameter.
Destroy original object.
Create a new one, and restore paramters and accumulators, with position and rotation update adapted from the portal.

One question is does ode keep stable ?

Need to test further.
Have a nice day
Ouille.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 11:45 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Discarted the rewrite of ODE for the log system.

Ouille way could be a possible way, but i think it could be quite slow.

One more alternative way:

-When the body enters in the portal area then ODE will be applied as usual.
-We force an update of ODE (i'm not sure if ODE applies the changes inmediatelly).
-We move the body according the delta (pos and angle) between portals.
-We apply again ODE.
-We force and update of ODE.
-We accum the drawing of the body.(or some openGL suff like that)
-We move again the body to the -delta(pos and angle) between portals.
-We apply everything pending and we can send all to render the frame.
I think is an easy way to achieve the effect.
Maybe some collision should have to be deactiated during the second part of the process.
Copy and destruction of objects won't be necesary.

B


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 9:26 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Just to be sure we talk about the same thing : Is that the way portals should work when object are passing through ?
Image
... and once the object has left the portal, the "original" one should be destroyed. Portals are unidirectional ?

Is that ok ? If so, I think we can fake the thing in a easy way (very close to what vicente said just before):
- One (ode) box for the input portal with collision callback
- One (ode) box for the output, so we can request its position (allows moving portals)

When an element enters the input portal, we move it (1) to output portal (intertia and all properties are not canceled, so it's perfect) and still draw it a second time at the "old position", using the delta of (1) until the object left the output portal.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 1:15 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
According the videos it's bidirectional :?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 28, 2008 10:20 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I got the game this xmas, and portals are bidirectional.

I think my last approach is simple and (should) work.
So we apply ODE, move the object the inverse of the delta of the portals and then we re-apply ODE.

As my OpenGL skill are bad: can we accum or another tech to draw the 2 positions of the objets WITHOUT redraw all the scene?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 09, 2008 9:46 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Talking about rendering things many times : what about the rendering of what we see thru the portal ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 09, 2008 11:16 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
You mean draw just what is in the portal or you mean a tricked render?

If in a hall we create a portal in front of the other and we put the camera betwen them looking at one of them... How many times will the hall be shown?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 10, 2008 1:55 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
How the Portal game do for such cases ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 10, 2008 8:56 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
i'll check it as soon as possible


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 11, 2008 10:20 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
ok, the maximum of portals i have been able to see is 8.
In a corridor i put portals in front of each other and i can see 8.
The average is about 2-4 portals at the time in screen.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

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