Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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] Geom.removeFromSpace  (Read 1137 times)
0 Members and 1 Guest are viewing this topic.
Offline frdfsnlght

Senior Newbie




Trying to understand


« Posted 2004-05-26 01:36:18 »

Will/Jani,

I'm getting an exception from odejava.dll when trying to remove a Geom from a space:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x5E16D99
Function=dSpaceAdd+0x9
Library=C:\wip\lib\odejava.dll

Current Java thread:
        at org.odejava.ode.OdeJNI.dSpaceAdd(Native Method)
        at org.odejava.ode.Ode.dSpaceAdd(Ode.java:441)
        at org.odejava.Geom.removeFromSpace(Geom.java:357)
        at org.odejava.Space.remove(Space.java:155)
        at org.bennedum.tank.Universe.remove(Universe.java:214)
        at org.bennedum.tank.ProjectileManager.stop(ProjectileManager.java:110)
        at org.bennedum.tank.ProjectileManager.stepFrame(ProjectileManager.java:53)
        at org.bennedum.tank.Universe.stepFrame(Universe.java:283)
        at org.bennedum.tank.Universe$FrameBehavior.processStimulus(Universe.java:346)
        at javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:172)
        - locked <0x11a343f0> (a javax.media.j3d.BehaviorRetained)
        - locked <0x11a343f0> (a javax.media.j3d.BehaviorRetained)
        at javax.media.j3d.J3dThread.run(J3dThread.java:250)


I didn't include all the other garbage output, but I can if anyone thinks it's useful.

The code from Geom.java is:

1  
2  
3  
4  
5  
6  
7  
8  
      protected void removeFromSpace () {
            assert spaceId != Space.SPACEID_ZERO: "This geom is already not in any Space";
           
            Ode.dSpaceRemove(spaceId, geomId);
            spaceId = Space.SPACEID_ZERO;
            Ode.dSpaceAdd(spaceId, geomId);

      }


Is the SPACEID_ZERO defined by ODE or is it something peculiar to odejava? If it's specific to odejava, then I don't think you should be trying to add a geom to that space in ODE. But maybe I'm wrong?

I seem to recall that I had this problem once before, but I can't figure out what I did.

-Tab
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2004-05-26 07:37:15 »

the code does work - the zero space is defined in ODE.  I have tested it and it worked for me.

This is a good feature as it means you don't have to keep recreating Geom's.

The bug is a bug in Odejava/ODE on the native side.  Try increasing your heap size (-Xms128M -Xmx256M) if you have enough RAM.

Native bugs are a bitch as unlike with java you don't get a nice stack trace.  In this case we at least know that 'org.odejava.ode.OdeJNI.dSpaceAdd' is at fault.  Maybe Jani could take a look at it.

Will.

Offline frdfsnlght

Senior Newbie




Trying to understand


« Reply #2 - Posted 2004-05-26 12:33:16 »

I'll try to increase the mem, but I doubt it will help. I haven't changed my code, only updated and rebuilt odejava from cvs yesterday. I'll let you know...

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

Senior Newbie




Trying to understand


« Reply #3 - Posted 2004-05-26 14:34:26 »

Increasing memory didn't fix it  Sad

I've commented out the dSpaceAdd call and things work correctly. Are you sure adding a Geom to Space with a zero I is allowed in ODE? I'm not sure why it's even necessary after the dSpaceRemove call after reading the ODE docs.

-Tab

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #4 - Posted 2004-05-27 02:18:18 »

perhaps you are right.

The zero space is used when creating an object not initially in a space.  This is so you can create a geom and add it to space later which is important.  You can't do this with bodies and it is a bit of a pain.

But, it sounds like that line can be removed without affecting this feature.

I've made this change - lets see how it goes.

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.

Nickropheliac (16 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

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

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

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

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

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

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

BurntPizza (49 views)
2014-08-09 21:09:32
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!