* When loading models with SimpleTextured/WireColor/SolidColor materials * When loading Unshaded material with spelling error "SeperateTexCoord" instead of "SeparateTexCoord" * Also fixed issue with loading animated models git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7729 75d07b2b-3a1a-0410-a2c5-0572b91ccdca3.0
parent
4dffbc95f5
commit
951d9fe23a
@ -1,114 +1,114 @@ |
|||||||
annotation.processing.enabled=false |
annotation.processing.enabled=false |
||||||
annotation.processing.enabled.in.editor=false |
annotation.processing.enabled.in.editor=false |
||||||
annotation.processing.run.all.processors=true |
annotation.processing.run.all.processors=true |
||||||
ant.customtasks.libs=JWSAntTasks |
ant.customtasks.libs=JWSAntTasks |
||||||
application.homepage=http://www.jmonkeyengine.com/ |
application.homepage=http://www.jmonkeyengine.com/ |
||||||
application.title=jMonkeyEngine 3.0 |
application.title=jMonkeyEngine 3.0 |
||||||
application.vendor=jMonkeyEngine |
application.vendor=jMonkeyEngine |
||||||
build.classes.dir=${build.dir}/classes |
build.classes.dir=${build.dir}/classes |
||||||
build.classes.excludes=**/*.java,**/*.form |
build.classes.excludes=**/*.java,**/*.form |
||||||
# This directory is removed when the project is cleaned: |
# This directory is removed when the project is cleaned: |
||||||
build.dir=build |
build.dir=build |
||||||
build.generated.dir=${build.dir}/generated |
build.generated.dir=${build.dir}/generated |
||||||
build.generated.sources.dir=${build.dir}/generated-sources |
build.generated.sources.dir=${build.dir}/generated-sources |
||||||
# Only compile against the classpath explicitly listed here: |
# Only compile against the classpath explicitly listed here: |
||||||
build.sysclasspath=ignore |
build.sysclasspath=ignore |
||||||
build.test.classes.dir=${build.dir}/test/classes |
build.test.classes.dir=${build.dir}/test/classes |
||||||
build.test.results.dir=${build.dir}/test/results |
build.test.results.dir=${build.dir}/test/results |
||||||
# Uncomment to specify the preferred debugger connection transport: |
# Uncomment to specify the preferred debugger connection transport: |
||||||
#debug.transport=dt_socket |
#debug.transport=dt_socket |
||||||
debug.classpath=\ |
debug.classpath=\ |
||||||
${run.classpath} |
${run.classpath} |
||||||
debug.test.classpath=\ |
debug.test.classpath=\ |
||||||
${run.test.classpath} |
${run.test.classpath} |
||||||
# This directory is removed when the project is cleaned: |
# This directory is removed when the project is cleaned: |
||||||
dist.dir=dist |
dist.dir=dist |
||||||
dist.jar=${dist.dir}/jMonkeyEngine3.jar |
dist.jar=${dist.dir}/jMonkeyEngine3.jar |
||||||
dist.javadoc.dir=${dist.dir}/javadoc |
dist.javadoc.dir=${dist.dir}/javadoc |
||||||
endorsed.classpath= |
endorsed.classpath= |
||||||
excludes= |
excludes= |
||||||
file.reference.src-test-data=src/test-data |
file.reference.src-test-data=src/test-data |
||||||
includes=** |
includes=** |
||||||
jar.archive.disabled=${jnlp.enabled} |
jar.archive.disabled=${jnlp.enabled} |
||||||
jar.compress=true |
jar.compress=true |
||||||
jar.index=${jnlp.enabled} |
jar.index=${jnlp.enabled} |
||||||
javac.classpath=\ |
javac.classpath=\ |
||||||
${libs.jogg.classpath}:\ |
${libs.jogg.classpath}:\ |
||||||
${libs.jbullet.classpath}:\ |
${libs.jbullet.classpath}:\ |
||||||
${libs.bullet.classpath}:\ |
${libs.bullet.classpath}:\ |
||||||
${libs.lwjgl.classpath}:\ |
${libs.lwjgl.classpath}:\ |
||||||
${libs.jheora.classpath}:\ |
${libs.jheora.classpath}:\ |
||||||
${libs.niftygui1.3.classpath}:\ |
${libs.niftygui1.3.classpath}:\ |
||||||
${libs.jme3-test-data.classpath}:\ |
${libs.jme3-test-data.classpath}:\ |
||||||
${libs.noise.classpath} |
${libs.noise.classpath} |
||||||
# Space-separated list of extra javac options |
# Space-separated list of extra javac options |
||||||
javac.compilerargs= |
javac.compilerargs= |
||||||
javac.deprecation=false |
javac.deprecation=false |
||||||
javac.processorpath=\ |
javac.processorpath=\ |
||||||
${javac.classpath} |
${javac.classpath} |
||||||
javac.source=1.5 |
javac.source=1.5 |
||||||
javac.target=1.5 |
javac.target=1.5 |
||||||
javac.test.classpath=\ |
javac.test.classpath=\ |
||||||
${javac.classpath}:\ |
${javac.classpath}:\ |
||||||
${build.classes.dir}:\ |
${build.classes.dir}:\ |
||||||
${libs.junit_4.classpath} |
${libs.junit_4.classpath} |
||||||
javadoc.additionalparam= |
javadoc.additionalparam= |
||||||
javadoc.author=false |
javadoc.author=false |
||||||
javadoc.encoding=${source.encoding} |
javadoc.encoding=${source.encoding} |
||||||
javadoc.noindex=false |
javadoc.noindex=false |
||||||
javadoc.nonavbar=false |
javadoc.nonavbar=false |
||||||
javadoc.notree=false |
javadoc.notree=false |
||||||
javadoc.private=false |
javadoc.private=false |
||||||
javadoc.splitindex=true |
javadoc.splitindex=true |
||||||
javadoc.use=true |
javadoc.use=true |
||||||
javadoc.version=false |
javadoc.version=false |
||||||
javadoc.windowtitle=jMonkeyEngine3 |
javadoc.windowtitle=jMonkeyEngine3 |
||||||
jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api" |
jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api" |
||||||
jnlp.applet.class=jme3test.awt.AppHarness |
jnlp.applet.class=jme3test.awt.AppHarness |
||||||
jnlp.applet.height=300 |
jnlp.applet.height=300 |
||||||
jnlp.applet.width=300 |
jnlp.applet.width=300 |
||||||
jnlp.codebase.type=user |
jnlp.codebase.type=user |
||||||
jnlp.codebase.user=http://jmonkeyengine.com/javawebstart/ |
jnlp.codebase.user=http://jmonkeyengine.com/javawebstart/ |
||||||
jnlp.descriptor=application |
jnlp.descriptor=application |
||||||
jnlp.enabled=false |
jnlp.enabled=false |
||||||
jnlp.icon=/Users/normenhansen/Pictures/jme/icons/jme-logo48.png |
jnlp.icon=/Users/normenhansen/Pictures/jme/icons/jme-logo48.png |
||||||
jnlp.mixed.code=default |
jnlp.mixed.code=default |
||||||
jnlp.offline-allowed=true |
jnlp.offline-allowed=true |
||||||
jnlp.signed=true |
jnlp.signed=true |
||||||
jnlp.signing=generated |
jnlp.signing=generated |
||||||
jnlp.signing.alias= |
jnlp.signing.alias= |
||||||
jnlp.signing.keystore= |
jnlp.signing.keystore= |
||||||
main.class=jme3test.TestChooser |
main.class=jme3test.export.TestOgreConvert |
||||||
manifest.file=MANIFEST.MF |
manifest.file=MANIFEST.MF |
||||||
meta.inf.dir=${src.dir}/META-INF |
meta.inf.dir=${src.dir}/META-INF |
||||||
mkdist.disabled=false |
mkdist.disabled=false |
||||||
platform.active=default_platform |
platform.active=default_platform |
||||||
run.classpath=\ |
run.classpath=\ |
||||||
${javac.classpath}:\ |
${javac.classpath}:\ |
||||||
${build.classes.dir} |
${build.classes.dir} |
||||||
run.jvmargs=-Xms40m -Xmx40m -XX:MaxDirectMemorySize=256M |
run.jvmargs=-Xms30m -Xmx30m -XX:MaxDirectMemorySize=256M |
||||||
run.test.classpath=\ |
run.test.classpath=\ |
||||||
${javac.test.classpath}:\ |
${javac.test.classpath}:\ |
||||||
${build.test.classes.dir} |
${build.test.classes.dir} |
||||||
source.encoding=UTF-8 |
source.encoding=UTF-8 |
||||||
src.blender.dir=src/blender |
src.blender.dir=src/blender |
||||||
src.core-data.dir=src/core-data |
src.core-data.dir=src/core-data |
||||||
src.core-plugins.dir=src/core-plugins |
src.core-plugins.dir=src/core-plugins |
||||||
src.core.dir=src/core |
src.core.dir=src/core |
||||||
src.desktop-fx.dir=src/desktop-fx |
src.desktop-fx.dir=src/desktop-fx |
||||||
src.desktop.dir=src/desktop |
src.desktop.dir=src/desktop |
||||||
src.games.dir=src/games |
src.games.dir=src/games |
||||||
src.jbullet.dir=src/jbullet |
src.jbullet.dir=src/jbullet |
||||||
src.jheora.dir=src/jheora |
src.jheora.dir=src/jheora |
||||||
src.jogg.dir=src/jogg |
src.jogg.dir=src/jogg |
||||||
src.lwjgl-oal.dir=src/lwjgl-oal |
src.lwjgl-oal.dir=src/lwjgl-oal |
||||||
src.lwjgl-ogl.dir=src/lwjgl-ogl |
src.lwjgl-ogl.dir=src/lwjgl-ogl |
||||||
src.networking.dir=src\\networking |
src.networking.dir=src\\networking |
||||||
src.niftygui.dir=src/niftygui |
src.niftygui.dir=src/niftygui |
||||||
src.ogre.dir=src/ogre |
src.ogre.dir=src/ogre |
||||||
src.pack.dir=src/pack |
src.pack.dir=src/pack |
||||||
src.terrain.dir=src/terrain |
src.terrain.dir=src/terrain |
||||||
src.test.dir=src/test |
src.test.dir=src/test |
||||||
src.tools.dir=src/tools |
src.tools.dir=src/tools |
||||||
src.xml.dir=src/xml |
src.xml.dir=src/xml |
||||||
test.test.dir=test |
test.test.dir=test |
||||||
|
@ -0,0 +1,194 @@ |
|||||||
|
/* |
||||||
|
* Copyright (c) 2009-2010 jMonkeyEngine |
||||||
|
* All rights reserved. |
||||||
|
* |
||||||
|
* Redistribution and use in source and binary forms, with or without |
||||||
|
* modification, are permitted provided that the following conditions are |
||||||
|
* met: |
||||||
|
* |
||||||
|
* * Redistributions of source code must retain the above copyright |
||||||
|
* notice, this list of conditions and the following disclaimer. |
||||||
|
* |
||||||
|
* * Redistributions 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. |
||||||
|
* |
||||||
|
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors |
||||||
|
* may be used to endorse or promote products derived from this software |
||||||
|
* without specific prior written permission. |
||||||
|
* |
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
||||||
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
||||||
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
||||||
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||||
|
*/ |
||||||
|
|
||||||
|
// $Id: Box.java 4131 2009-03-19 20:15:28Z blaine.dev $
|
||||||
|
package com.jme3.scene.shape; |
||||||
|
|
||||||
|
import com.jme3.math.Vector3f; |
||||||
|
import com.jme3.scene.VertexBuffer.Type; |
||||||
|
import com.jme3.util.BufferUtils; |
||||||
|
import java.nio.FloatBuffer; |
||||||
|
|
||||||
|
/** |
||||||
|
* A box with solid (filled) faces. |
||||||
|
* |
||||||
|
* @author Mark Powell |
||||||
|
* @version $Revision: 4131 $, $Date: 2009-03-19 16:15:28 -0400 (Thu, 19 Mar 2009) $ |
||||||
|
*/ |
||||||
|
public class StripBox extends AbstractBox { |
||||||
|
|
||||||
|
private static final short[] GEOMETRY_INDICES_DATA = |
||||||
|
{ 1, 0, 4, |
||||||
|
5, |
||||||
|
7, |
||||||
|
0, |
||||||
|
3, |
||||||
|
1, |
||||||
|
2, |
||||||
|
4, |
||||||
|
6, |
||||||
|
7, |
||||||
|
2, |
||||||
|
3 }; |
||||||
|
|
||||||
|
private static final float[] GEOMETRY_TEXTURE_DATA = { |
||||||
|
1, 0, |
||||||
|
0, 0, |
||||||
|
0, 1, |
||||||
|
1, 1, |
||||||
|
|
||||||
|
1, 0, |
||||||
|
0, 0, |
||||||
|
1, 1, |
||||||
|
0, 1 |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* Creates a new box. |
||||||
|
* <p> |
||||||
|
* The box has a center of 0,0,0 and extends in the out from the center by |
||||||
|
* the given amount in <em>each</em> direction. So, for example, a box |
||||||
|
* with extent of 0.5 would be the unit cube. |
||||||
|
* |
||||||
|
* @param name the name of the box. |
||||||
|
* @param x the size of the box along the x axis, in both directions. |
||||||
|
* @param y the size of the box along the y axis, in both directions. |
||||||
|
* @param z the size of the box along the z axis, in both directions. |
||||||
|
*/ |
||||||
|
public StripBox(float x, float y, float z) { |
||||||
|
super(); |
||||||
|
updateGeometry(Vector3f.ZERO, x, y, z); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Creates a new box. |
||||||
|
* <p> |
||||||
|
* The box has the given center and extends in the out from the center by |
||||||
|
* the given amount in <em>each</em> direction. So, for example, a box |
||||||
|
* with extent of 0.5 would be the unit cube. |
||||||
|
* |
||||||
|
* @param name the name of the box. |
||||||
|
* @param center the center of the box. |
||||||
|
* @param x the size of the box along the x axis, in both directions. |
||||||
|
* @param y the size of the box along the y axis, in both directions. |
||||||
|
* @param z the size of the box along the z axis, in both directions. |
||||||
|
*/ |
||||||
|
public StripBox(Vector3f center, float x, float y, float z) { |
||||||
|
super(); |
||||||
|
updateGeometry(center, x, y, z); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Constructor instantiates a new <code>Box</code> object. |
||||||
|
* <p> |
||||||
|
* The minimum and maximum point are provided, these two points define the |
||||||
|
* shape and size of the box but not it’s orientation or position. You should |
||||||
|
* use the {@link #setLocalTranslation()} and {@link #setLocalRotation()} |
||||||
|
* methods to define those properties. |
||||||
|
* |
||||||
|
* @param name the name of the box. |
||||||
|
* @param min the minimum point that defines the box. |
||||||
|
* @param max the maximum point that defines the box. |
||||||
|
*/ |
||||||
|
public StripBox(Vector3f min, Vector3f max) { |
||||||
|
super(); |
||||||
|
updateGeometry(min, max); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Empty constructor for serialization only. Do not use. |
||||||
|
*/ |
||||||
|
public StripBox(){ |
||||||
|
super(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Creates a clone of this box. |
||||||
|
* <p> |
||||||
|
* The cloned box will have ‘_clone’ appended to it’s name, but all other |
||||||
|
* properties will be the same as this box. |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public StripBox clone() { |
||||||
|
return new StripBox(center.clone(), xExtent, yExtent, zExtent); |
||||||
|
} |
||||||
|
|
||||||
|
protected void duUpdateGeometryIndices() { |
||||||
|
if (getBuffer(Type.Index) == null){ |
||||||
|
setBuffer(Type.Index, 3, BufferUtils.createShortBuffer(GEOMETRY_INDICES_DATA)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected void duUpdateGeometryNormals() { |
||||||
|
if (getBuffer(Type.Normal) == null){ |
||||||
|
float[] normals = new float[8 * 3]; |
||||||
|
|
||||||
|
Vector3f[] vert = computeVertices(); |
||||||
|
Vector3f norm = new Vector3f(); |
||||||
|
|
||||||
|
for (int i = 0; i < 8; i++) { |
||||||
|
norm.set(vert[i]).normalizeLocal(); |
||||||
|
|
||||||
|
normals[i * 3 + 0] = norm.x; |
||||||
|
normals[i * 3 + 1] = norm.x; |
||||||
|
normals[i * 3 + 2] = norm.x; |
||||||
|
} |
||||||
|
|
||||||
|
setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(normals)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected void duUpdateGeometryTextures() { |
||||||
|
if (getBuffer(Type.TexCoord) == null){ |
||||||
|
setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(GEOMETRY_TEXTURE_DATA)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected void duUpdateGeometryVertices() { |
||||||
|
FloatBuffer fpb = BufferUtils.createVector3Buffer(8 * 3); |
||||||
|
Vector3f[] v = computeVertices(); |
||||||
|
fpb.put(new float[] { |
||||||
|
v[0].x, v[0].y, v[0].z, |
||||||
|
v[1].x, v[1].y, v[1].z, |
||||||
|
v[2].x, v[2].y, v[2].z, |
||||||
|
v[3].x, v[3].y, v[3].z, |
||||||
|
v[4].x, v[4].y, v[4].z, |
||||||
|
v[5].x, v[5].y, v[5].z, |
||||||
|
v[6].x, v[6].y, v[6].z, |
||||||
|
v[7].x, v[7].y, v[7].z, |
||||||
|
}); |
||||||
|
setBuffer(Type.Position, 3, fpb); |
||||||
|
setMode(Mode.TriangleStrip); |
||||||
|
updateBound(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue