Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Odejava with custom collision detection  (Read 1398 times)
0 Members and 1 Guest are viewing this topic.
Offline Mithrandir

Senior Devvie




Cut from being on the bleeding edge too long


« Posted 2004-09-30 16:41:02 »

I'm trying to work out how to integrate a custom collision detection routine into the Java bindings to ODE. In the C-world, I would just make sure I have the right callback defined for my body geometry (dGeomMoved()).

In the low-level bindings, the code is back to front. It's making a JNI call to a method of the same name, rather than the other way around of having the native code make a callback to the Java code. ie

1  
2  
3  
  public static void dGeomMoved(SWIGTYPE_p_dGeomID arg0) {
    OdeJNI.dGeomMoved(SWIGTYPE_p_dGeomID.getCPtr(arg0));
  }


So, has anyone else managed to work around this issue and integrate custom collision detection with the basic physics engine? If so, how did you do it?

The site for 3D Graphics information http://www.j3d.org/
Aviatrix3D JOGL Scenegraph http://aviatrix3d.j3d.org/
Programming is essentially a markup language surrounding mathematical formulae and thus, should not be patentable.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2004-10-04 20:10:52 »

Jani knows more about the C side of Odejava, I have emailed him pointing to this question.  I'm sure there is a way to do it.

Will.

Offline Catharsis

JGO Coder


Medals: 21
Projects: 1
Exp: 18 years


TyphonRT rocks!


« Reply #2 - Posted 2004-10-04 20:14:16 »

Quote
So, has anyone else managed to work around this issue and integrate custom collision detection with the basic physics engine? If so, how did you do it?


I am interested in this as well for integration with Auriga3D. I however, will not be looking at this possibility until January most likely.  Basically I want to use the BSP collision mechanism in Auriga3D, but ODE for dynamics.

Please support my Kickstarter for next-gen video apps for Android:
http://kck.st/1xA3R61

Founder & Principal Architect; TyphonRT, Inc.
http://www.typhonrt.org/
http://www.egrsoftware.com/
https://plus.google.com/u/0/+MichaelLeahy/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mithrandir

Senior Devvie




Cut from being on the bleeding edge too long


« Reply #3 - Posted 2004-10-05 14:59:37 »

Thanks. From my other experience with ODE, and looking at a lot of example code using it, those callback functions are fairly critical to making it all work.

Found some more missing API calls too, but I'll start a bugzill entry about those.

The site for 3D Graphics information http://www.j3d.org/
Aviatrix3D JOGL Scenegraph http://aviatrix3d.j3d.org/
Programming is essentially a markup language surrounding mathematical formulae and thus, should not be patentable.
Offline Jani Laakso

Junior Devvie




Do it with Java!


« Reply #4 - Posted 2004-10-06 16:58:58 »

Quote
I'm trying to work out how to integrate a custom collision detection routine into the Java bindings to ODE. In the C-world, I would just make sure I have the right callback defined for my body geometry (dGeomMoved()).


Do you actually mean that you do not wan't to use ODE's internal collision detection and use e.g. Java side collision detection library (this means that you must know ODE very well)? ODE's own collision library is quite good and it works nicely with ODE itself so I suggest you use it.

Or do you mean that you would like to handle ODE's callbacks (e.g. nearCallback) on the Java side? Easiest way currently is that you do your callback routine on the C side, they are simple routines in any case. I might add support for Java side callbacks later but I dont know when.

I'd really wan't to clean up Odejava's C side and better up the API for Java side. Also I got nice optimizations (JNI directbuffers) still pending (didn't commit them half a year ago). Have to wait and see if I get spare time any time soon now.

Jani.
Offline Mithrandir

Senior Devvie




Cut from being on the bleeding edge too long


« Reply #5 - Posted 2004-10-06 22:55:58 »

Quote
Do you actually mean that you do not wan't to use ODE's internal collision detection and use e.g. Java side collision detection library (this means that you must know ODE very well)? ODE's own collision library is quite good and it works nicely with ODE itself so I suggest you use it.


That is correct. I've used ODE on a couple of other private projects as C code. OPCODE is quite poor when dealing with large numbers of collidable objects - particularly when I need to know exact collision points on complex geometry. I have some other pure-java libraries that I've already written that I want to take advantage of.

In addition, I'd like to also be able to integrate it with simpler collision detection from non-physical objects. Think about simple ray-casting style picking to perform the collision detection. In particular this is used for some underwater vehicle modelling that we have to do for a project here. Without getting into the details, we're doing sonar modelling that will generate our "collisions" that will then be fed back into the physics model used to model the vehicle. A similar application could be used to drive a land-based automous robot, for example (not that this is what we're currently doing, but probably more familiar to most people here as an agent). You want the object to obey the basic laws of physics about turning/toppling/grip etc, but they don't want to do something at the point they've already collided with another object, but some time beforehand.

The site for 3D Graphics information http://www.j3d.org/
Aviatrix3D JOGL Scenegraph http://aviatrix3d.j3d.org/
Programming is essentially a markup language surrounding mathematical formulae and thus, should not be patentable.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (113 views)
2014-11-26 15:22:04

toopeicgaming1999 (100 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!