Space Mapper Framework

Hello all,



I discussed this on here a while back, but now that I’m not so busy with work anymore I finally hadtime to do some work on it.

My space mapper framework version 0.1 is complete. It’s still very basic but at least it’s working well enough for me to feel comfortable to show it to the public.



I’ll first explain the basic design ideas behind it, not posting any code here, it’s on the svn if you want to look it up. (http://www.ractoc.com/mapperframework/svn/Framework/).



The reason why I started this framework is that most of the frameworks for mapmaking I found on the net were designed for the standard, landbased maps. There didn’t seem to be any frameworks for space based maps. And the ones I could find weren’t very flexible. So I decided to try my hand on setting up my own. Currently, it only enables you to put planets in space and to add the approach property to that planet, but since it’s an extendable framework, that shouldn’t be a problem.



The framework consists of 3 basic objects, BasicMapItem ,BasicMapItemProperty and BasicMapItemSpatial. These are all abstract classes and if you want to add an object, you would first need to extend these.



The BasicMapItem is the actual Map item. It contains the basic info of that object. In case of a planet, this could be the diameter, the texture and perhaps the rotaion speed to name but an example. (you could off course also use a Model to represent a planet, which is the way the test planet works).



Then you have the BasicMapItemProperty. Each map item can be given a list of properties. Properties define the behaviour of a map item which is not standard for that item, or which is used for more then one item. For instance approaching. You can imagine that most objects in space can be approached. Therefor, this functionality is a Property. This way, you can, at design time, apply it to the map items you want. You can think up all kinds of properties, and through this setup, you can have any combination of item / property you want.



Lastly there’s the MapItemSpatial. This is the class that handles the actual 3d model. This is where the actual model location is stored as well as some other things.



The configuration of this entire framework is, at the moment, Spring based. Each of the above classes is configured as a Spring bean, with a Spring ApplicationContext.xml being used as the overall map config file. An example of such a file is shown below:



<bean class="com.ractoc.flux.mapper.items.Planet" name="Earth">
   <property name="name" value="Earth"></property>
   <property name="description" value="This is the blue planet. On this planet, mankind first evolved before venturing out into space."></property>
   <property name="location">
      <bean class="com.jme.math.Vector3f">
         <property name="x" value="10" />
         <property name="y" value="10" />
         <property name="z" value="-20" />
      </bean>
   </property>
   <property name="mapItemSpatial">
      <bean class="com.ractoc.flux.mapper.spatials.Model">
         <property name="modelLocation" value="resources/models/planets/wereld.3ds" />
      </bean>
   </property>
   <property name="properties">
      <list value-type="com.ractoc.flux.mapper.BasicMapItemProperty">
         <bean class="com.ractoc.flux.mapper.properties.ApproachProperty"></bean>
      </list>
   </property>
</bean>



In this excerpt of the config file you can see how a planet is created using this setup.

Let me know what you think of this setup, and if things need to be added / changed. The SVN server is open to all with respect to viewin / DL code, uploading / adding y ou need a login for, which I need to add. But since this is an opensource project as off now, all applications will be considered by me asap.

There are some extra functionalities planned, like menu support for the properties, but I haven't even started on this yet so don't expect it in there any time soon.

Mark Schrijver.