Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
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 774 times)
0 Members and 1 Guest are viewing this topic.
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Posted 2004-07-17 06: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 03: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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (105 views)
2013-05-17 21:29:12

alaslipknot (114 views)
2013-05-16 21:24:48

gouessej (142 views)
2013-05-16 00:53:38

gouessej (138 views)
2013-05-16 00:17:58

theagentd (150 views)
2013-05-15 15:01:13

theagentd (135 views)
2013-05-15 15:00:54

StreetDoggy (178 views)
2013-05-14 15:56:26

kutucuk (201 views)
2013-05-12 17:10:36

kutucuk (202 views)
2013-05-12 15:36:09

UnluckyDevil (208 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.107 seconds with 20 queries.