org.jagatoo.loaders.models.bsp
Class BSPPrototypeLoader

java.lang.Object
  extended by org.jagatoo.loaders.models.bsp.BSPPrototypeLoader

public class BSPPrototypeLoader
extends java.lang.Object

Loads the Quake 3 BSP file according to spec. It is not expected that it would be rendered from this data structure, but used to convert into a better format for rendering via Xith3D.


Field Summary
protected static java.lang.Boolean DEBUG
           
static boolean loadNormals
           
 
Constructor Summary
BSPPrototypeLoader()
           
 
Method Summary
static BSPScenePrototype load(java.io.InputStream in, java.lang.String filename, java.net.URL baseURL, GeometryFactory geomFactory, boolean convertZup2Yup, float worldScale, AppearanceFactory appFactory, NodeFactory nodeFactory, NamedObject sceneGroup, GroupType mainGroupType, SpecialItemsHandler siHandler)
          Loads the BSP scene prototype.
static BSPScenePrototype load(java.net.URL url, GeometryFactory geomFactory, boolean convertZup2Yup, float worldScale, AppearanceFactory appFactory, NodeFactory nodeFactory, NamedObject sceneGroup, GroupType mainGroupType, SpecialItemsHandler siHandler)
          Loads the BSP scene prototype.
protected static BSPBrush[] readBrushes(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPBrushSide[] readBrushSides(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPEdge[] readEdges(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
          Half-Life BSP only method, reads out Edge data from the bsp file.
protected static BSPEntitiesParser.BSPEntity[] readEntities(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPFace[] readFaces(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static int[] readLeafFaces(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPLeaf[] readLeafs(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static byte[] readLightmapData(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static AbstractTexture[] readLightmaps(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir, AppearanceFactory appFactory)
           
protected static int[] readMeshVertices(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPModel[] readModels(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPNode[] readNodes(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPPlane[] readPlanes(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir, float worldScale)
           
protected static int[] readSurfEdges(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPTexInfo[] readTexInfos(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
          Half-Life BSP only method, reads out texture structure data from the bsp file.
protected static AbstractTexture[][] readTextures(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir, WADFile[] wadFiles, BSPEntitiesParser.BSPEntity[] entities, AppearanceFactory appFactory)
           
protected static BSPVertex[] readVertices(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir)
           
protected static BSPVisData readVisData(org.jagatoo.loaders.models.bsp.BSPFile file, BSPDirectory bspDir, int leafCount)
           
protected static WADFile[] readWADFiles(org.jagatoo.loaders.models.bsp.BSPFile file, BSPEntitiesParser.BSPEntity[] entities)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loadNormals

public static boolean loadNormals

DEBUG

protected static final java.lang.Boolean DEBUG
Constructor Detail

BSPPrototypeLoader

public BSPPrototypeLoader()
Method Detail

readEntities

protected static BSPEntitiesParser.BSPEntity[] readEntities(org.jagatoo.loaders.models.bsp.BSPFile file,
                                                            BSPDirectory bspDir)
                                                     throws java.io.IOException
Throws:
java.io.IOException

readWADFiles

protected static WADFile[] readWADFiles(org.jagatoo.loaders.models.bsp.BSPFile file,
                                        BSPEntitiesParser.BSPEntity[] entities)
                                 throws java.io.IOException
Throws:
java.io.IOException

readTextures

protected static AbstractTexture[][] readTextures(org.jagatoo.loaders.models.bsp.BSPFile file,
                                                  BSPDirectory bspDir,
                                                  WADFile[] wadFiles,
                                                  BSPEntitiesParser.BSPEntity[] entities,
                                                  AppearanceFactory appFactory)
                                           throws java.io.IOException
Throws:
java.io.IOException

readLightmaps

protected static AbstractTexture[] readLightmaps(org.jagatoo.loaders.models.bsp.BSPFile file,
                                                 BSPDirectory bspDir,
                                                 AppearanceFactory appFactory)
                                          throws java.io.IOException
Throws:
java.io.IOException

readLightmapData

protected static byte[] readLightmapData(org.jagatoo.loaders.models.bsp.BSPFile file,
                                         BSPDirectory bspDir)
                                  throws java.io.IOException
Throws:
java.io.IOException

readTexInfos

protected static BSPTexInfo[] readTexInfos(org.jagatoo.loaders.models.bsp.BSPFile file,
                                           BSPDirectory bspDir)
                                    throws java.io.IOException
Half-Life BSP only method, reads out texture structure data from the bsp file.

Parameters:
file - HL BSP file, the texture info are read from
bspDir - HL BSP Lump Directory
Returns:
void add return value!
Throws:
java.io.IOException

readVertices

protected static BSPVertex[] readVertices(org.jagatoo.loaders.models.bsp.BSPFile file,
                                          BSPDirectory bspDir)
                                   throws java.io.IOException
Throws:
java.io.IOException

readMeshVertices

protected static int[] readMeshVertices(org.jagatoo.loaders.models.bsp.BSPFile file,
                                        BSPDirectory bspDir)
                                 throws java.io.IOException
Throws:
java.io.IOException

readEdges

protected static BSPEdge[] readEdges(org.jagatoo.loaders.models.bsp.BSPFile file,
                                     BSPDirectory bspDir)
                              throws java.io.IOException
Half-Life BSP only method, reads out Edge data from the bsp file.

Parameters:
file - HL BSP file, the edges are read from
bspDir - HL BSP Lump Directory
Returns:
BSPEdge[] array of edges ( which contains array of 2 vertex indices per edge )
Throws:
java.io.IOException

readSurfEdges

protected static int[] readSurfEdges(org.jagatoo.loaders.models.bsp.BSPFile file,
                                     BSPDirectory bspDir)
                              throws java.io.IOException
Throws:
java.io.IOException

readFaces

protected static BSPFace[] readFaces(org.jagatoo.loaders.models.bsp.BSPFile file,
                                     BSPDirectory bspDir)
                              throws java.io.IOException
Throws:
java.io.IOException

readVisData

protected static BSPVisData readVisData(org.jagatoo.loaders.models.bsp.BSPFile file,
                                        BSPDirectory bspDir,
                                        int leafCount)
                                 throws java.io.IOException
Throws:
java.io.IOException

readPlanes

protected static BSPPlane[] readPlanes(org.jagatoo.loaders.models.bsp.BSPFile file,
                                       BSPDirectory bspDir,
                                       float worldScale)
                                throws java.io.IOException
Throws:
java.io.IOException

readNodes

protected static BSPNode[] readNodes(org.jagatoo.loaders.models.bsp.BSPFile file,
                                     BSPDirectory bspDir)
                              throws java.io.IOException
Throws:
java.io.IOException

readLeafs

protected static BSPLeaf[] readLeafs(org.jagatoo.loaders.models.bsp.BSPFile file,
                                     BSPDirectory bspDir)
                              throws java.io.IOException
Throws:
java.io.IOException

readLeafFaces

protected static int[] readLeafFaces(org.jagatoo.loaders.models.bsp.BSPFile file,
                                     BSPDirectory bspDir)
                              throws java.io.IOException
Throws:
java.io.IOException

readBrushes

protected static BSPBrush[] readBrushes(org.jagatoo.loaders.models.bsp.BSPFile file,
                                        BSPDirectory bspDir)
                                 throws java.io.IOException
Throws:
java.io.IOException

readBrushSides

protected static BSPBrushSide[] readBrushSides(org.jagatoo.loaders.models.bsp.BSPFile file,
                                               BSPDirectory bspDir)
                                        throws java.io.IOException
Throws:
java.io.IOException

readModels

protected static BSPModel[] readModels(org.jagatoo.loaders.models.bsp.BSPFile file,
                                       BSPDirectory bspDir)
                                throws java.io.IOException
Throws:
java.io.IOException

load

public static BSPScenePrototype load(java.io.InputStream in,
                                     java.lang.String filename,
                                     java.net.URL baseURL,
                                     GeometryFactory geomFactory,
                                     boolean convertZup2Yup,
                                     float worldScale,
                                     AppearanceFactory appFactory,
                                     NodeFactory nodeFactory,
                                     NamedObject sceneGroup,
                                     GroupType mainGroupType,
                                     SpecialItemsHandler siHandler)
                              throws java.io.IOException,
                                     IncorrectFormatException,
                                     ParsingException
Loads the BSP scene prototype.

Throws:
java.io.IOException
IncorrectFormatException
ParsingException

load

public static BSPScenePrototype load(java.net.URL url,
                                     GeometryFactory geomFactory,
                                     boolean convertZup2Yup,
                                     float worldScale,
                                     AppearanceFactory appFactory,
                                     NodeFactory nodeFactory,
                                     NamedObject sceneGroup,
                                     GroupType mainGroupType,
                                     SpecialItemsHandler siHandler)
                              throws java.io.IOException,
                                     IncorrectFormatException,
                                     ParsingException
Loads the BSP scene prototype.

Throws:
java.io.IOException
IncorrectFormatException
ParsingException