I created a Loader that does the following:
* Chooses delegate Loader to instantiate based on filename extension.
*
* <p>
* Filename extension mapping is case insensitive.
* The following mappings are established by default:
* <table border="1">
* <tr><td>3ds</td><td>org.xith3d.loader3ds.Loader3DS </td></tr>
* <tr><td>md2</td><td>org.xith3d.loaders.md2.MD2Loader</td></tr>
* <tr><td>obj</td><td>org.xith3d.loaders.obj.OBJLoader</td></tr>
* </table>
* </p>
*
* <p>
* ExtLoader is extensible in that additional filename extensions and
* associated Loader classes can be added or replaced using the map()
* method.
* Mapped classes must implement interface com.xith3d.loaders.Loader
* and must provide a no-argument constructor method.
* </p>
The 3DS loading has not been tested yet because I do not have any 3DS models on hand but the MD2 and OBJ loading work fine. I used Loader3DS instead of TDSLoader for “.3ds” files because I just now discovered that Loader3DS already implemented interface Loader.
The source code for ExtLoader will be available for viewing here within 24 hours:
http://cvs.sourceforge.net/viewcvs.py/whoola/core/src/com/whoola/core/media/xith/
Does Xith want this class. If so, should I put it in package org.xith3d.loaders or org.xith3d.loaders.ext?