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  
  [Odejava] bug fixes and enhancements  (Read 903 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 »

Hi,

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 odejava.org.  I have tested CarExample on Windows XP, Linux (Fedora Core 1) and Mac OS X (10.3) with positive results in all cases.

Cheers,

Will.

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.

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 (23 views)
2014-08-19 09:29:53

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

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

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

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

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

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

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

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

BurntPizza (66 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!