Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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] Saving to XODE  (Read 1108 times)
0 Members and 1 Guest are viewing this topic.
Offline Vikstar

Senior Newbie

« Posted 2004-09-09 03:50:07 »

Is there a way to save the state of a world and space into the XODE DOM (so that it can be saved to an xml file)?
Offline William Denniss

JGO Coder

Projects: 2

Fire at will

« Reply #1 - Posted 2004-09-09 08:01:28 »

Not yet I'm afraid.

Although it's not too hard to add, just iterate though the ODE World & Space building the objects XODE counterparts and then write that out to disk.  The main problem is that you would need more constructors for the XODE objects so you can pass the data directly in.

How urgently do you need this feature?


Offline Vikstar

Senior Newbie

« Reply #2 - Posted 2004-09-09 10:13:01 »

I don't need the feature urgently, I thought that there may have been something obvious that I was missing in the documentation. Some of my framework is tightly coupled with ODE (bad software engineering on my part Embarrassed, or maybe just unavoidable :-/) so I might have to end up writing my own persistence for ode anyway.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder

Projects: 2

Fire at will

« Reply #3 - Posted 2004-09-09 21:44:22 »

One could simply iterate over the ODE scene and write out the XML however using the XODE* objects is probably better as you can easily tell the correct attributes from the instance variables.

If I were to code it, it would probably be a two step process like this:

public class SomeClass {
   public XODERoot generateXODETree(World world, Space space) {
     // iterates though the ODE scene creating XODE objects

public class XODERoot {

   public Document getXODEXML() {
     // recursivly builds the XODE structure into DOM structure and returns the results.



I may as well make them Serializable as well, that's not too hard at all as they are basically just struts already - a few variables would need to be marked 'transient' but that's about all.


Offline William Denniss

JGO Coder

Projects: 2

Fire at will

« Reply #4 - Posted 2004-09-10 12:15:06 »

I have paved the way for this support.

Firstly I fixed some problems with the loader which should have been fixed a long time ago.

Secondly I added some method stubs which one day will be used to create a XODETree from an ODE World and Space.  In fact I implemented everything except the code to extract properties from the Geoms and Joints.  This requires some changes to the Odejava core so the geometrical properties can be extracted (e.g. X,Y,Z lengths of a Box).

I don't have an ETA on this, it's on the back burner and will be worked on when I have the time (like I did today).  I definitely want this feature added in, partially because this parser is the official XODE reference implementation so I want it to be as complete as it can be and partially because it would be useful to have.

Also, XODE trees should now be serializable using Java Serialization I think.  I haven't tested it so there are probably bugs, but I went though and made the classes serializable (i.e. implemented the Serializable interface, added the transient modifier when appropriate, etc...).


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

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

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

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

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

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

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

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

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

NoxInc (27 views)
2015-07-22 22:16:53

NoxInc (18 views)
2015-07-22 22:13:39
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!