Skip to content

Commit

Permalink
Test commit.
Browse files Browse the repository at this point in the history
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@16 83d24430-9974-4f80-8418-2cc3294053b9
  • Loading branch information
rodgersgb committed Aug 23, 2006
1 parent 4d2cda4 commit 6076a49
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 68 deletions.
14 changes: 7 additions & 7 deletions src/net/java/joglutils/ThreeDS/Face.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
* 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.
Expand Down
46 changes: 23 additions & 23 deletions src/net/java/joglutils/ThreeDS/Loader3DS.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 ,
* 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.
Expand Down Expand Up @@ -84,7 +84,7 @@ public Loader3DS()
currentChunk = new Chunk();
tempChunk = new Chunk();
}

// Verified
public boolean load(Model3DS model, String fileName)
{
Expand Down Expand Up @@ -117,12 +117,12 @@ public boolean load(Model3DS model, String fileName)
System.err.println("Error: File IO error in: Closing File");
return false;
}

loaded = true;

return loaded;
}

// Verified
void processNextChunk(Model3DS model, Chunk previousChunk)
{
Expand Down Expand Up @@ -187,7 +187,7 @@ void processNextChunk(Model3DS model, Chunk previousChunk)
private void readChunkHeader(Chunk chunk)
{
byte buffer[] = new byte[2];

try {
chunk.id = swap(dataInputStream.readShort());
chunk.id &= 0x0000FFFF;
Expand All @@ -200,7 +200,7 @@ private void readChunkHeader(Chunk chunk)
return;
}
}

// Verified
private void processNextObjectChunk(Model3DS model, Obj object, Chunk previousChunk)
{
Expand Down Expand Up @@ -296,7 +296,7 @@ private void processNextMaterialChunk(Model3DS model, Material material, Chunk p
}
currentChunk = previousChunk;
}

// Verified
private void readObjectMaterial(Model3DS model, Obj object, Chunk previousChunk)
{
Expand Down Expand Up @@ -445,14 +445,14 @@ private void computeNormals(Model3DS model)
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;
Expand All @@ -477,17 +477,17 @@ private void computeNormals(Model3DS model)
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;
Expand Down
14 changes: 7 additions & 7 deletions src/net/java/joglutils/ThreeDS/Material.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
* 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.
Expand Down
32 changes: 16 additions & 16 deletions src/net/java/joglutils/ThreeDS/Model3DS.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
* 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.
Expand All @@ -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()
{
Expand Down
14 changes: 7 additions & 7 deletions src/net/java/joglutils/ThreeDS/Obj.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
* 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.
Expand Down

0 comments on commit 6076a49

Please sign in to comment.