summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrodgersgb <[email protected]>2006-08-23 03:01:40 +0000
committerrodgersgb <[email protected]>2006-08-23 03:01:40 +0000
commit6076a49e47ff9b29cf87037c90fa7d13fbe5b6fb (patch)
tree9a4e69c926d5497cfaf029eb8bde904a3cf721a3
parent4d2cda4cb7c69e738aa84c450867bc70de730aa7 (diff)
Test commit.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@16 83d24430-9974-4f80-8418-2cc3294053b9
-rw-r--r--src/net/java/joglutils/ThreeDS/Face.java14
-rw-r--r--src/net/java/joglutils/ThreeDS/Loader3DS.java46
-rw-r--r--src/net/java/joglutils/ThreeDS/Material.java14
-rw-r--r--src/net/java/joglutils/ThreeDS/Model3DS.java32
-rw-r--r--src/net/java/joglutils/ThreeDS/Obj.java14
-rw-r--r--src/net/java/joglutils/ThreeDS/Vec3.java16
6 files changed, 68 insertions, 68 deletions
diff --git a/src/net/java/joglutils/ThreeDS/Face.java b/src/net/java/joglutils/ThreeDS/Face.java
index 2535d3f..0bc7e72 100644
--- a/src/net/java/joglutils/ThreeDS/Face.java
+++ b/src/net/java/joglutils/ThreeDS/Face.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Greg Rodgers All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* The names of Greg Rodgers, Sun Microsystems, Inc. or the names of
* contributors may not be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -23,12 +23,12 @@
* SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
- * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF GREG
* RODGERS OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
diff --git a/src/net/java/joglutils/ThreeDS/Loader3DS.java b/src/net/java/joglutils/ThreeDS/Loader3DS.java
index ff16918..12caf70 100644
--- a/src/net/java/joglutils/ThreeDS/Loader3DS.java
+++ b/src/net/java/joglutils/ThreeDS/Loader3DS.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Greg Rodgers All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* The names of Greg Rodgers, Sun Microsystems, Inc. or the names of
* contributors may not be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -23,12 +23,12 @@
* SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
- * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF GREG
* RODGERS OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -84,7 +84,7 @@ public class Loader3DS
currentChunk = new Chunk();
tempChunk = new Chunk();
}
-
+
// Verified
public boolean load(Model3DS model, String fileName)
{
@@ -117,12 +117,12 @@ public class Loader3DS
System.err.println("Error: File IO error in: Closing File");
return false;
}
-
+
loaded = true;
-
+
return loaded;
}
-
+
// Verified
void processNextChunk(Model3DS model, Chunk previousChunk)
{
@@ -187,7 +187,7 @@ public class Loader3DS
private void readChunkHeader(Chunk chunk)
{
byte buffer[] = new byte[2];
-
+
try {
chunk.id = swap(dataInputStream.readShort());
chunk.id &= 0x0000FFFF;
@@ -200,7 +200,7 @@ public class Loader3DS
return;
}
}
-
+
// Verified
private void processNextObjectChunk(Model3DS model, Obj object, Chunk previousChunk)
{
@@ -296,7 +296,7 @@ public class Loader3DS
}
currentChunk = previousChunk;
}
-
+
// Verified
private void readObjectMaterial(Model3DS model, Obj object, Chunk previousChunk)
{
@@ -445,14 +445,14 @@ public class Loader3DS
vVector2.z -= vPoly[1].z;
normals[i] = vVector1;
-
+
// Compute the cross product
normals[i].x = normals[i].y*vVector1.z - normals[i].z*vVector1.y;
normals[i].y = normals[i].z*vVector1.x - normals[i].x*vVector1.z;
normals[i].z = normals[i].x*vVector1.y - normals[i].y*vVector1.x;
-
+
tempNormals[i] = new Vec3(normals[i]);
-
+
// Normalize
float mag = (float)Math.sqrt(normals[i].x*normals[i].x + normals[i].y*normals[i].y + normals[i].z*normals[i].z);
normals[i].x /= mag;
@@ -477,17 +477,17 @@ public class Loader3DS
shared++;
}
}
-
+
// Divide the vector vSum by -shared
vSum.x /= -shared;
vSum.y /= -shared;
- vSum.z /= -shared;
-
+ vSum.z /= -shared;
+
object.normals[i] = new Vec3(vSum);
-
+
// Normalize
- float mag = (float)Math.sqrt(object.normals[i].x*object.normals[i].x +
- object.normals[i].y*object.normals[i].y +
+ float mag = (float)Math.sqrt(object.normals[i].x*object.normals[i].x +
+ object.normals[i].y*object.normals[i].y +
object.normals[i].z*object.normals[i].z);
object.normals[i].x /= mag;
object.normals[i].y /= mag;
diff --git a/src/net/java/joglutils/ThreeDS/Material.java b/src/net/java/joglutils/ThreeDS/Material.java
index 5f91ada..3b34945 100644
--- a/src/net/java/joglutils/ThreeDS/Material.java
+++ b/src/net/java/joglutils/ThreeDS/Material.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Greg Rodgers All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* The names of Greg Rodgers, Sun Microsystems, Inc. or the names of
* contributors may not be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -23,12 +23,12 @@
* SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
- * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF GREG
* RODGERS OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
diff --git a/src/net/java/joglutils/ThreeDS/Model3DS.java b/src/net/java/joglutils/ThreeDS/Model3DS.java
index 6ca44c2..79c0019 100644
--- a/src/net/java/joglutils/ThreeDS/Model3DS.java
+++ b/src/net/java/joglutils/ThreeDS/Model3DS.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Greg Rodgers All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* The names of Greg Rodgers, Sun Microsystems, Inc. or the names of
* contributors may not be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -23,12 +23,12 @@
* SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
- * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF GREG
* RODGERS OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
@@ -43,51 +43,51 @@ public class Model3DS
protected Loader3DS loader = new Loader3DS();
protected Vector<Material> materials = new Vector<Material>();
protected Vector<Obj> objects = new Vector<Obj>();
-
+
// Constructor
public Model3DS()
{
}
-
+
// Load the model
public boolean load(String file)
{
if (!loader.load(this, file))
return false;
-
+
return true;
}
-
+
// Add material
public void addMaterial(Material mat)
{
materials.add(mat);
}
-
+
// Add an object
public void addObject(Obj obj)
{
objects.add(obj);
}
-
+
// Get material
public Material getMaterial(int index)
{
return materials.get(index);
}
-
+
// Get an object
public Obj getObject(int index)
{
return objects.get(index);
}
-
+
// Get the number of objects
public int getNumberOfObjects()
{
return objects.size();
}
-
+
// Get the number of materials
public int getNumberOfMaterials()
{
diff --git a/src/net/java/joglutils/ThreeDS/Obj.java b/src/net/java/joglutils/ThreeDS/Obj.java
index 93de9f2..95b524f 100644
--- a/src/net/java/joglutils/ThreeDS/Obj.java
+++ b/src/net/java/joglutils/ThreeDS/Obj.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2006 Greg Rodgers All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* The names of Greg Rodgers, Sun Microsystems, Inc. or the names of
* contributors may not be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -23,12 +23,12 @@
* SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
- * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF GREG
* RODGERS OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
diff --git a/src/net/java/joglutils/ThreeDS/Vec3.java b/src/net/java/joglutils/ThreeDS/Vec3.java
index 509d850..e698b92 100644
--- a/src/net/java/joglutils/ThreeDS/Vec3.java
+++ b/src/net/java/joglutils/ThreeDS/Vec3.java
@@ -1,34 +1,34 @@
/*
* Copyright (c) 2006 Greg Rodgers All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* The names of Greg Rodgers, Sun Microsystems, Inc. or the names of
* contributors may not be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. GREG RODGERS,
* SUN MICROSYSTEMS, INC. ("SUN"), AND SUN'S LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
- * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL GREG
+ * RODGERS, SUN, OR SUN'S LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF GREG
* RODGERS OR SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.