Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
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] bug fixes and enhancements  (Read 1024 times)
0 Members and 1 Guest are viewing this topic.
Offline William Denniss

JGO Coder

Projects: 2

Fire at will

« Posted 2004-07-17 04:25:13 »


I've fixed the problems associated with GeomPlane, and changed the code to prevent such problems arising in the future.

I believe they arose due to calls to "updatereferences" which gets the current position and rotation of objects.  I removed that method and moved the calls to ode which get this data into the relivent methods (e.g. getPosition).

This issue was an API one, due to internal calls to getPosition - however the public methods were also defined.  For GeomPlane they simply threw an exception which is better than nothing, but hardly ideal.  To get around this problem, I have created a new abstract class PlaceableGeom which inherits Geom.  All the position/rotation code was moved to that class - so only geometry which extend it (i.e. not GeomPlane) will work.  This also means you don't have to do checks for instances of GeomPlane before making such method calls and your code won't break in the future if more unplaceable objects are added to ODE.

I also moved the interface OdeTransformable from org.odejava.display to org.odejava and renamed it Placeable.  The naming makes more sense - and it really should have been in the org.odejava package to begin with (my bad).

The introduction of PlaceableGeom may break some existing code - if you do stuff like "Geom g = new GeomBox" then call a setPosition on that code.  All you need to do is change the "Geom" to "PlaceableGeom".  Sorry for the change - but we are exchanging a runtime error (or worse) for a logic error - which is a good thing (tm).

With these bugs fixed - the official examples run again, so I have updated the JWS on  I have tested CarExample on Windows XP, Linux (Fedora Core 1) and Mac OS X (10.3) with positive results in all cases.



Offline William Denniss

JGO Coder

Projects: 2

Fire at will

« Reply #1 - Posted 2004-08-02 01:15:54 »

As a non-placeable Geom can never have a Body, I have moved the setBody and getBody methods of Geom to PlaceableGeom.

These methods are generally only used by Body.  Several method signatures of Body dealing with Geoms were therefore needed to be changed to PlaceableGeom.

Like previous changes to PlaceableGeom, this may require you to change some method signatures or add an occasinal cast to PlaceableGeom but again - you trade a logic error (calling setBody on a GeomPlane for example) for a compiler error (as this will now be caught at compile time).

A new method was also added to PlaceableGeom "fixed()" it returns true if the PlaceableGeom doesn't have a Body (and is therefore static).  The org.odejava.display package now uses this to avoid unneeded updates on bound objects.


Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

SHC (37 views)
2015-08-01 03:58:20

Jesse (24 views)
2015-07-29 04:35:27

Riven (44 views)
2015-07-27 16:38:00

Riven (24 views)
2015-07-27 15:35:20

Riven (27 views)
2015-07-27 12:26:13

Riven (18 views)
2015-07-27 12:23:39

BurntPizza (39 views)
2015-07-25 00:14:37

BurntPizza (48 views)
2015-07-24 22:06:39

BurntPizza (33 views)
2015-07-24 06:06:53

NoxInc (40 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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‑
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!