Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Fri Dec 14, 2018 1:11 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Wed Oct 08, 2008 10:36 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Situation:
You have a game with a builtin editor.
The editor needs collision off (to be able to move every object in the scene freely). So in the callback we return 0.
In the editor its needed to use a picking function.
Here comes the problem: As all collisions are returned as 0(deactivated), and raydium_ode_mouse_pick filters its entrance with those returned data, then the picking function can not work.
I see no bug here, just a conceptual problem.
Solutions?


Top
 Profile  
 
PostPosted: Thu Oct 09, 2008 6:58 am 
Offline

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

1) Small dirty hack: put return value as global var.

Define this var to 0 on normal operation and to 1 before mouse_pick.

2) An other way is to deactivate collision detection with some raydium functions. I not sure for this.

3) Last i can bypass user collide callback, but in this case we will have some problem with users that don't wan't certains object to be pciked.

4) Last: change collide callback to an other pick_collide before picking function, and restore it just after.

Don't forget to define nearcollide callback to if you don't need collide at all (it can speed up as it avoid broad phase collision detection i.e. collision between object and not element).

Have a nice day
Ouille


Top
 Profile  
 
PostPosted: Thu Oct 09, 2008 4:26 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I like option 4.
Even more, I think that would be the default. 2 different callbacks: one the real collisions and one for picking collisions. Surely those would be pointing to the same function, usually, but in certain cases, like this, could be usefull to have them apart.


Top
 Profile  
 
PostPosted: Mon Oct 13, 2008 7:45 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
I've read very quickly, but for me "raydium_ode_RayCallback" is doing exactly what you want.

Another simple option (for an editor like this) would be to stop the time: no collision between objects until you "enable" time again, but rays will work as usual.


Top
 Profile  
 
PostPosted: Mon Oct 13, 2008 8:55 pm 
Offline

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

Who commited mouse picking :(

Have a nice day.
Ouille.


Top
 Profile  
 
PostPosted: Mon Nov 24, 2008 2:39 am 
Offline

Joined: Sun May 06, 2007 1:33 am
Posts: 9
Hi all!! I have a similar problem, but can't find a solution.
I'm doing such an ingame editor, I want to move objects around dragging 3 arrow that apper around objects (one for each direction).
So I draw the arrow and use the collideCallback to make the arrows never collide. But now I can't click on the arrows to drag them around.
Arrow need to not collide with objects but need react to ray...how can this be done??
Stop ode timer is not a solution as I need to keep the world arould running...

Thank you very much
Dave


Top
 Profile  
 
PostPosted: Mon Nov 24, 2008 8:31 am 
Offline

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

As xfennec said:raydium_ode_RayCallback is specific for ray.
So you can disable collision in normal ode collide, and do whatever you need in RayCallback.

In raycallback you can define interaction between your arraw and ray.

Have a nice day.
Ouille.


Top
 Profile  
 
PostPosted: Mon Nov 24, 2008 2:55 pm 
Offline

Joined: Sun May 06, 2007 1:33 am
Posts: 9
Thanks for your fast replay :)

I'm trying to use the RayCallback, but without good result :(
I have defined my callback for rasy (it works, if put a ray in the scene the callback is triggered), but when I use mouse_pick no ray_callback is called.
Seems that the rayCallback is not called when you use mouse_pick...

I'm making something wrong?
If you need I can attach a simple test case

Thanks
Dave


Top
 Profile  
 
PostPosted: Mon Nov 24, 2008 4:45 pm 
Offline

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

Sorry ... raycallback is not used for mouse_pick :(

Corrected in the svn.

Use last revision from svn (809).

You'll have raydium_ode_PickCallback type signed char f(int,int,dContact*)

This function is specific for mouse_pick callback.

Hope this time it will be ok.

Have a nice day.
Ouille


Top
 Profile  
 
PostPosted: Mon Nov 24, 2008 11:27 pm 
Offline

Joined: Sun May 06, 2007 1:33 am
Posts: 9
Yes Thanks !!! :D
It works really well now, and is also much more flexible in this way.

Ouille, thank you very much for the fast fix

Dave


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] 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