Show Posts
|
|
Pages: [1]
|
|
2
|
Game Development / Game Mechanics / [odejava] collision problems
|
on: 2005-03-31 09:00:57
|
I'm having a strange problem: I have a Body that has an attached GeomSphere. Prior to executing the following code, it can collide with any object without issues. After executing the following, which is supposed to swap out the GeomSphere with one of a different size, it can only collide with other Bodies. It can't, for example, collide with bodyless GeomBoxes. I've verified that the collisions are detected when I loop over the contact object. The problem is that no matter what flags I set on contact, there is no visible effect on the spheres. The sphere objects do start to rotate by some very tiny amount after the "collision," though. Also, I'm using the current cvs version of odejava. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| PlaceableGeom geo = (PlaceableGeom)this.sim_body.getGeom(); this.sim_body.removeGeom(geo); space.remove(geo); geo.delete(); geo=null;
geo = new GeomSphere((float)(this.bounds.getWidth() + Marble.border_width + Marble.stroke_width)/2);
this.sim_body.addGeom(geo); this.sim_geomIDs.add(geo.getNativeAddr()); space.addGeom(geo); |
|
|
|
|
|
3
|
Game Development / Game Mechanics / Re: Internal errors and native crashes..
|
on: 2005-03-09 00:39:45
|
I just tried that, and it seems to fix most of the problems. However, now I'm getting native exceptions (with much less frequency, though) in really strange places, like ntdll.dll. For example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9111de, pid=324, tid=4364 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode, sharing) # Problematic frame: # C [ntdll.dll+0x111de] #
--------------- T H R E A D ---------------
Current thread (0x02d62870): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=4364]
siginfo: ExceptionCode=0xc0000005, reading address 0x00000000
Registers: EAX=0x00000000, EBX=0x00030000, ECX=0x00a93df8, EDX=0x00030178 ESP=0x02f8ee70, EBP=0x02f8f090, ESI=0x00a93df0, EDI=0x00000000 EIP=0x7c9111de, EFLAGS=0x00010206
Top of Stack: (sp=0x02f8ee70) 0x02f8ee70: 02d7d6dc 00000008 00000000 00000008 0x02f8ee80: 00a694e4 00031468 00030000 02d7d6d8 0x02f8ee90: 02f8ee80 00000000 02f8f0c4 7c90ee18 0x02f8eea0: 7c910738 ffffffff 7c910732 7c9106ab 0x02f8eeb0: 7c9106eb 02d6292c 00000248 00000000 0x02f8eec0: 02f8ee9c 6d77a41d 02f8fb64 7379adb6 0x02f8eed0: 737613c0 ffffffff 73775be2 73775c9b 0x02f8eee0: 000cf068 73775cb2 737a09e8 02e10d18
Instructions: (pc=0x7c9111de) 0x7c9111ce: 39 89 bd 0c ff ff ff 8b 46 0c 89 85 68 ff ff ff 0x7c9111de: 8b 10 3b 57 04 0f 85 8c 31 02 00 3b d1 0f 85 84
Stack: [0x02f50000,0x02f90000), sp=0x02f8ee70, free space=251k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ntdll.dll+0x111de] C [MSVCRT.dll+0x1c3c9] C [MSVCRT.dll+0x1c3e7] C [MSVCRT.dll+0x1c42e] C [awt.dll+0x36627] C [awt.dll+0x35caf] C [awt.dll+0x3887b] J sun.awt.image.ImagingLib.transformBI(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;[DI)I J sun.awt.image.ImagingLib.filter(Ljava/awt/image/BufferedImageOp;Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage; J java.awt.image.AffineTransformOp.filter(Ljava/awt/image/BufferedImage;Ljava/awt/image/BufferedImage;)Ljava/awt/image/BufferedImage; J sun.java2d.pipe.DrawImage.renderImageXform(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;Ljava/awt/geom/AffineTransform;IIIIILjava/awt/Color;)V J sun.java2d.pipe.DrawImage.transformImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;Ljava/awt/geom/AffineTransform;IIIIILjava/awt/Color;)V J sun.java2d.pipe.DrawImage.transformImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IILjava/awt/geom/AffineTransform;I)V J sun.java2d.pipe.DrawImage.transformImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;Ljava/awt/geom/AffineTransform;Ljava/awt/image/ImageObserver;)Z J sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;Ljava/awt/geom/AffineTransform;Ljava/awt/image/ImageObserver;)Z J FaceMarble.paint(Ljava/awt/Graphics2D;Ljava/awt/geom/Rectangle2D;)V J DrawTest$MyPanel.paintComponent(Ljava/awt/Graphics;)V j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+260 j javax.swing.JComponent.paintWithOffscreenBuffer(Ljavax/swing/JComponent;Ljava/awt/Graphics;IIIILjava/awt/Image;)V+174 j javax.swing.JComponent.paintDoubleBuffered(Ljavax/swing/JComponent;Ljava/awt/Component;Ljava/awt/Graphics;IIII)Z+131 J javax.swing.JComponent._paintImmediately(IIII)V v ~RuntimeStub::alignment_frame_return Runtime1 stub j javax.swing.JComponent.paintImmediately(IIII)V+83 j javax.swing.RepaintManager.paintDirtyRegions()V+314 j javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()V+32 j java.awt.event.InvocationEvent.dispatch()V+47 j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26 j java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+200 j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26 j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 j java.awt.EventDispatchThread.run()V+9 v ~StubRoutines::call_stub V [jvm.dll+0x8176e] V [jvm.dll+0xd481d] V [jvm.dll+0x8163f] V [jvm.dll+0x8139c] V [jvm.dll+0x9c05c] V [jvm.dll+0xfeece] V [jvm.dll+0xfee9c] C [MSVCRT.dll+0x2a3b0] C [kernel32.dll+0xb50b] |
They don't specifically refer to odejava anywhere, but they don't happen without it, so I'm at a loss as to what the real problem is. Could I have miscompiled odejava?
|
|
|
|
|
4
|
Game Development / Game Mechanics / Internal errors and native crashes..
|
on: 2005-03-08 06:53:00
|
In order to simulate an expanding object, I am swapping out the geoms of a body fairly quickly. The effect looks good, but it's causing a variety of internal errors and crashes. This is how I'm trying to do it: 1 2 3 4 5 6 7 8
| PlaceableGeom geo = (PlaceableGeom)this.sim_body.getGeom(); space.remove(geo); this.sim_body.removeGeom(geo); geo.delete();
geo = new GeomSphere((float)(this.bounds.getWidth()+22)/2); this.sim_body.addGeom(geo); space.addBodyGeoms(this.sim_body); |
It causes the following "ODE Internal Error 2" message: Bad argument(s) (ode/src/collision_space.cpp:182) and when that doesn't happen, I get a message like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
| # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0317e6f1, pid=4356, tid=3724 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode, sharing) # Problematic frame: # C [odejava.dll+0x6e6f1] #
--------------- T H R E A D ---------------
Current thread (0x02d62850): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=3724]
siginfo: ExceptionCode=0xc0000005, writing address 0x00000004
Registers: EAX=0x031a13f0, EBX=0x031a0650, ECX=0x00000000, EDX=0x031b322c ESP=0x02f8f35c, EBP=0x02f8f37c, ESI=0xffffffff, EDI=0x47b3b693 EIP=0x0317e6f1, EFLAGS=0x00010246
Top of Stack: (sp=0x02f8f35c) 0x02f8f35c: 02d62850 00000040 26bee1f8 02d91038 0x02f8f36c: 00000050 031a1534 00000000 00000000 0x02f8f37c: 02f8f3a8 0317acc3 031a0650 26bee1f8 0x02f8f38c: 0317ac94 00000040 0317ac81 00000040 0x02f8f39c: 00000000 0313e6b9 00000040 02f8f3b8 0x02f8f3ac: 031119f2 00000040 031b3140 02f8f400 0x02f8f3bc: 03173909 031b3430 00000000 00ad826f 0x02f8f3cc: 02d6290c 02f8f408 031b3160 00000000
Instructions: (pc=0x0317e6f1) 0x0317e6e1: 04 eb 03 8b 5d 08 8b 4a 08 8b 7a 04 83 7d f8 00 0x0317e6f1: 89 79 04 8b 4a 04 8b 7a 08 89 79 08 0f 84 94 00
Stack: [0x02f50000,0x02f90000), sp=0x02f8f35c, free space=252k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [odejava.dll+0x6e6f1] C [odejava.dll+0x6acc3] C [odejava.dll+0x19f2] C [odejava.dll+0x63909] j org.odejava.ode.Ode.dGeomSetBody(Lorg/odejava/ode/SWIGTYPE_p_dGeomID;Lorg/odejava/ode/SWIGTYPE_p_dBodyID;)V+8 j org.odejava.PlaceableGeom.setBody(Lorg/odejava/Body;)V+111 j org.odejava.Body.removeGeom(Lorg/odejava/PlaceableGeom;)V+38 j Marble.updateSim(Lorg/odejava/World;Lorg/odejava/Space;Lorg/odejava/display/DisplayBin;)V+16 j Sim.marbleUpdated(LSimObject;)V+13 j MarbleStore.refresh(LSimObject;)V+34 j MarbleStore.simObjectChange(LSimObject;Ljava/util/List;Z)V+6 j Marble.fireChangeEvent(Z)V+34 j Marble.resize(DD)V+52 j FaceMarble.paint(Ljava/awt/Graphics2D;Ljava/awt/geom/Rectangle2D;)V+67 j DrawTest$MyPanel.paintComponent(Ljava/awt/Graphics;)V+91 j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+260 j javax.swing.JComponent.paintWithOffscreenBuffer(Ljavax/swing/JComponent;Ljava/awt/Graphics;IIIILjava/awt/Image;)V+174 j javax.swing.JComponent.paintDoubleBuffered(Ljavax/swing/JComponent;Ljava/awt/Component;Ljava/awt/Graphics;IIII)Z+131 j javax.swing.JComponent._paintImmediately(IIII)V+739 j javax.swing.JComponent.paintImmediately(IIII)V+83 j javax.swing.RepaintManager.paintDirtyRegions()V+314 j javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()V+32 j java.awt.event.InvocationEvent.dispatch()V+47 j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26 j java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+200 j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26 j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 j java.awt.EventDispatchThread.run()V+9 v ~StubRoutines::call_stub V [jvm.dll+0x8176e] V [jvm.dll+0xd481d] V [jvm.dll+0x8163f] V [jvm.dll+0x8139c] V [jvm.dll+0x9c05c] V [jvm.dll+0xfeece] V [jvm.dll+0xfee9c] C [MSVCRT.dll+0x2a3b0] C [kernel32.dll+0xb50b]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.odejava.ode.OdeJNI.dGeomSetBody(JJ)V+0 j org.odejava.ode.Ode.dGeomSetBody(Lorg/odejava/ode/SWIGTYPE_p_dGeomID;Lorg/odejava/ode/SWIGTYPE_p_dBodyID;)V+8 j org.odejava.PlaceableGeom.setBody(Lorg/odejava/Body;)V+111 j org.odejava.Body.removeGeom(Lorg/odejava/PlaceableGeom;)V+38 j Marble.updateSim(Lorg/odejava/World;Lorg/odejava/Space;Lorg/odejava/display/DisplayBin;)V+16 j Sim.marbleUpdated(LSimObject;)V+13 j MarbleStore.refresh(LSimObject;)V+34 j MarbleStore.simObjectChange(LSimObject;Ljava/util/List;Z)V+6 j Marble.fireChangeEvent(Z)V+34 j Marble.resize(DD)V+52 j FaceMarble.paint(Ljava/awt/Graphics2D;Ljava/awt/geom/Rectangle2D;)V+67 j DrawTest$MyPanel.paintComponent(Ljava/awt/Graphics;)V+91 j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+260 j javax.swing.JComponent.paintWithOffscreenBuffer(Ljavax/swing/JComponent;Ljava/awt/Graphics;IIIILjava/awt/Image;)V+174 j javax.swing.JComponent.paintDoubleBuffered(Ljavax/swing/JComponent;Ljava/awt/Component;Ljava/awt/Graphics;IIII)Z+131 j javax.swing.JComponent._paintImmediately(IIII)V+739 j javax.swing.JComponent.paintImmediately(IIII)V+83 j javax.swing.RepaintManager.paintDirtyRegions()V+314 j javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()V+32 j java.awt.event.InvocationEvent.dispatch()V+47 j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+26 j java.awt.EventDispatchThread.pumpOneEventForHierarchy(ILjava/awt/Component;)Z+200 j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+26 j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 j java.awt.EventDispatchThread.run()V+9 v ~StubRoutines::call_stub |
Any ideas? I've tried reordering statements and such to no avail.
|
|
|
|
|
5
|
Game Development / Game Mechanics / Re: rotating composite bodies
|
on: 2005-02-24 23:41:31
|
|
It seems to be fixed now. I had to manually set an inertial tensor and center of mass with setMassParameters. I also changed the ordering around a bit. Not sure why this was necessary though.
Thanks for the help though :P
|
|
|
|
|
6
|
Game Development / Game Mechanics / Re: rotating composite bodies
|
on: 2005-02-24 21:24:07
|
That doesn't seem to have any effect either. Here is the code that I'm using. Does it look right? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| this.sideWalls = new Body(world); this.sideWalls.setGravityMode(0);
this.groundGeomB = new GeomBox((float)this.bounds.getWidth(), 10f, 50f); this.groundGeomT = new GeomBox((float)this.bounds.getWidth(), 10f, 50f); this.groundGeomL = new GeomBox(10f, (float)this.bounds.getHeight(), 50f); this.groundGeomR = new GeomBox(10f, (float)this.bounds.getHeight(), 50f);
this.groundGeomBE = new GeomTransform("t1"); this.groundGeomTE = new GeomTransform("t2"); this.groundGeomLE = new GeomTransform("t3"); this.groundGeomRE = new GeomTransform("t4");
this.groundGeomBE.setEncapsulatedGeom(this.groundGeomB); this.groundGeomTE.setEncapsulatedGeom(this.groundGeomT); this.groundGeomLE.setEncapsulatedGeom(this.groundGeomL); this.groundGeomRE.setEncapsulatedGeom(this.groundGeomR);
this.sideWalls.addGeom(this.groundGeomBE); this.sideWalls.addGeom(this.groundGeomTE); this.sideWalls.addGeom(this.groundGeomLE); this.sideWalls.addGeom(this.groundGeomRE);
this.groundGeomB.setPosition(0f, (float)(-1 * this.bounds.getHeight()/2 - 5), 0f); this.groundGeomT.setPosition(0f, (float)(this.bounds.getHeight() + 5), 0f); this.groundGeomL.setPosition((float)(-1 * this.bounds.getWidth()/2 - 5), 0f, 0f); this.groundGeomR.setPosition((float)(this.bounds.getWidth()/2 + 5), 0f, 0f);
this.geomIDs.add(this.groundGeomBE.getNativeAddr()); this.geomIDs.add(this.groundGeomLE.getNativeAddr()); this.geomIDs.add(this.groundGeomRE.getNativeAddr()); this.geomIDs.add(this.groundGeomTE.getNativeAddr());
this.sideWalls.adjustMass(10f); this.sideWalls.setPosition((float)(this.bounds.getWidth()/2 + this.bounds.getX()), (float)(this.bounds.getHeight()/2 + this.bounds.getY()), 0f);
space.addBodyGeoms(this.sideWalls); this.sideWalls.setAngularVel(50, 0, 0); this.sideWalls.addRelTorque(5000,0,5000); |
|
|
|
|
|
7
|
Game Development / Game Mechanics / rotating composite bodies
|
on: 2005-02-24 20:59:10
|
|
Hi - How do you rotate composite bodies? I have one that is made up of a number of GeomTransforms, and I'm trying to rotate it around its Z-axis at a particular angular velocity, but I'm having no luck.
I've tried using the setAngularVel() method on the body and I've also tried using AMotors, but the body just doesn't rotate.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|