Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
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  
  GeomCyclinder  (Read 1607 times)
0 Members and 1 Guest are viewing this topic.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Posted 2004-08-30 17:11:45 »

Has the cylinder dissapeared from ode or something?

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #1 - Posted 2004-08-30 20:24:55 »

Hmmm.
I replaced the cylinder with a a tri mesh and my god. I am astonished by how slow the tri mesh is.
How do people do wheels now?

Could we overlap a box with a sphere and return collision true iff both the objects say they have been collided with?

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #2 - Posted 2004-08-30 21:33:03 »

The cylinder is a contrib module for ODE.  When I updated the binaries a while back I didn't add it back in (at that stage I was more concerned about getting it working on a mac).

I use spheres for wheels, I thought everyone did Smiley  Logically I agree that cylinders make more sense.

I have been communicating with a guy named Levent over email who has been trying to get this support back in.  I'll direct him to this thread.

Will.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2004-08-30 22:12:43 »

Since cylinder support was last added in there is a new cylinder contrib module, I think we should use it instead of the older one.

Here's what I did:  Checked out from CVS the ODE source.  In the ode folder (the one which has src as its sub folder), I run:
# patch -p1 < ../contrib/dCylinder2/dcylinder2.patch

That patches the code adding in the cylinder contrib module.

added:
1  
2  
3  
        ode/src/collision_cylinder_box.cpp \
        ode/src/collision_cylinder_sphere.cpp \
        ode/src/collision_cylinder_trimesh.cpp

to the Makefile.

So far everything is fine Smiley

Then I built and installed the new Ode version

I uncomment out the line in GeomCylinder.java, then try to create one in my scene.

The program crashes with:
"ODE INTERNAL ERROR 2: geom must be placeable in dGeomSetBody()"

Any thoughts?  Can you try the above steps and tell me what you get?

Will.

Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #4 - Posted 2004-08-31 14:26:52 »

Jeez, I dunno.
I have patched it all and got it running. I got the same error as you.
I have started probing the ode source to locate the problem. The thing is though as soon as I probe and area where it crashes it will stop crashing at that point and move somewhere else.
I can now create the cylinder but then when getPosition is called as part of updtaeReferences it will sometimes crash there and say the Geom is not placeable.
If I probe that I can sometimes get it to keep going until my code calls
setPosition.
At that point it always hangs when it tries to write into the array that represents the position of the geom.

I have not worked in C/C++ for a while. I had hoped not to with javaode :-). But my thoery at the moment is that its some kind of memory cleanup problem. The memory for the Cylinder is being tydied up for some reason. If I reference the memory it keeps it alive a bit longer, but ultimatly it will be tidied.
I thought perhaps it was something to do with how the JNI keeps pointers alive? So I loked more closely in the SWIG file stuff. Couldn't see anything that looked wrong but this is all new stuff to me.
I shall keep looking though


Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #5 - Posted 2004-08-31 15:48:31 »

My god. I have solved it. Da da da da da daa, hey!
The problem is in the Swig file: odejava.i
the dCreate for the cylinder
says the return type is a *
when it is not
(have a look at the other dCreate, you see how it idfferers subtly)
DOH!

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #6 - Posted 2004-08-31 16:44:57 »

Well now the cylinders do not collide with anything. Not at all. With themselves or tri meshes or spheres.
I could imagine a few missed collisions as bugs but not a single collision once is too rediculous, especially with all the extra extra cpp files with tons of code in them
So the quest for cylinders continues...

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #7 - Posted 2004-08-31 18:19:10 »

Right. Well the problem was that patch doesn't do all the work that is needed.
It seems to miss doing the header file prototypes
it takes bloody ages
this is the file with the info
ode/contrib/dCylinder2/cylinder_collider.txt
also you need to update the build file to compile the extra files that are added
I dunno what the best way of transfering my knowledge over it. I could cut an paste crappy instructions like the txt file does. But its really not very helpful.
Anyway ....
I have cylinders, they certainly do bounce into things, I am not sure if they are working quite right yet. It may be my graphics arn't alligned with the cylinder so I shall investigate.
Also it seems collisions are only defined for cylinders to sphers boxes and trimeshes. Though that may not be true if the functionality is hidden somewhere
What a bloody day! Bloody C.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #8 - Posted 2004-08-31 19:46:30 »

Xith draws its Cylinders aligned differently to ODE.
Heres some code that will fix that
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
private Shape3D createCylinderShape(GeometryCylinder geometryCylinder) {
        IndexedTriangleArray geom = (IndexedTriangleArray) CylinderGeometry.createCylinder(geometryCylinder.getRadius(), geometryCylinder.getRadius(), geometryCylinder.getLength(), 20);

        Matrix4f transform = GeomUtils.getMatrix(new Vector3f(), new Quat4f(0,1,0,1));

        Point3f temp = new Point3f();
        for(int i = 0; i < geom.getVertexCount(); i++){
            geom.getVertex(i, temp);
            transform.transform(temp);
            geom.setCoordinate(i, temp);
        }

        return new Shape3D(geom, backup.getDefaultSphereApp());

    }

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #9 - Posted 2004-09-01 10:54:16 »

Quote
Right. Well the problem was that patch doesn't do all the work that is needed.
It seems to miss doing the header file prototypes
it takes bloody ages
this is the file with the info
ode/contrib/dCylinder2/cylinder_collider.txt
also you need to update the build file to compile the extra files that are added
I dunno what the best way of transfering my knowledge over it. I could cut an paste crappy instructions like the txt file does. But its really not very helpful.
Anyway ....
I have cylinders, they certainly do bounce into things, I am not sure if they are working quite right yet. It may be my graphics arn't alligned with the cylinder so I shall investigate.
Also it seems collisions are only defined for cylinders to sphers boxes and trimeshes. Though that may not be true if the functionality is hidden somewhere
What a bloody day! Bloody C.


What a pain that the patch doesn't do everything - I thought it was bad not patching the Makefile but it sounds much worse.  Just how long does it take to fully patch the source?

I did see that .txt file but shuddered, manually applying patches is not something I enjoy.

I think we should petition the ODE mailing list for a better patch file.  Can you create a patch of the work you have done?

Congratulations on getting it working!  Using C/C++ really is a pain in the arse.

Will.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #10 - Posted 2004-09-05 14:47:50 »

I have sent an email to the ode mailing list about the patch. I have tried making one but its a bit confusing.
I have put up a tar of my compile directory at
http://users.aber.ac.uk/ttl0/compile.tar.bz2
That has ode configured to DEBUG
Has the geom cylinder support
The make-gcc.sh file copies the libodejava.so into the odejava/lib/linux directory.
It has the ode random seed thing added.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #11 - Posted 2004-09-06 11:14:08 »

I added my $0.02 on the mailing list as well.

I've committed in the "void dRandSetSeed (long seed);" addition to odejava.i so next time we recompile it will be included.

Will.

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.

atombrot (25 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!