* Removed all deprecated classes, methods, and fields

* AudioNode now takes AudioRenderer in its constructor to allow audio.play() functionality

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7333 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 33dac750d7
commit 6196de22f7
  1. 2
      engine/build.xml
  2. 2312
      engine/nbproject/build-impl.xml
  3. 22
      engine/nbproject/genfiles.properties
  4. 131
      engine/nbproject/profiler-build-impl.xml
  5. 219
      engine/nbproject/project.properties
  6. 885
      engine/src/core/com/jme3/animation/AnimationPath.java
  7. 50
      engine/src/core/com/jme3/animation/AnimationPathListener.java
  8. 16
      engine/src/core/com/jme3/app/state/AbstractAppState.java
  9. 64
      engine/src/core/com/jme3/audio/AudioNode.java
  10. 16
      engine/src/core/com/jme3/cinematic/Cinematic.java
  11. 45
      engine/src/core/com/jme3/cinematic/MotionPath.java
  12. 2
      engine/src/core/com/jme3/cinematic/events/SoundTrack.java
  13. 10
      engine/src/core/com/jme3/collision/CollisionResult.java
  14. 7
      engine/src/core/com/jme3/collision/SweepSphere.java
  15. 26
      engine/src/core/com/jme3/collision/bih/BIHTree.java
  16. 32
      engine/src/core/com/jme3/effect/ParticleEmitter.java
  17. 14
      engine/src/core/com/jme3/font/BitmapText.java
  18. 46
      engine/src/core/com/jme3/input/ChaseCamera.java
  19. 13
      engine/src/core/com/jme3/input/KeyInput.java
  20. 8
      engine/src/core/com/jme3/material/Material.java
  21. 19
      engine/src/core/com/jme3/math/Matrix3f.java
  22. 8
      engine/src/core/com/jme3/math/Transform.java
  23. 23
      engine/src/core/com/jme3/post/FilterPostProcessor.java
  24. 2
      engine/src/core/com/jme3/renderer/RenderManager.java
  25. 20
      engine/src/core/com/jme3/scene/CameraNode.java
  26. 22
      engine/src/core/com/jme3/scene/Mesh.java
  27. 16
      engine/src/core/com/jme3/scene/Node.java
  28. 2
      engine/src/core/com/jme3/scene/Spatial.java
  29. 8
      engine/src/core/com/jme3/scene/control/LodControl.java
  30. 9
      engine/src/core/com/jme3/shader/UniformBinding.java
  31. 20
      engine/src/core/com/jme3/texture/Texture.java
  32. 8
      engine/src/core/com/jme3/util/SkyFactory.java
  33. 8
      engine/src/desktop-fx/com/jme3/post/filters/FadeFilter.java
  34. 68
      engine/src/jbullet/com/jme3/app/SimpleBulletApplication.java
  35. 35
      engine/src/jbullet/com/jme3/bullet/BulletAppState.java
  36. 17
      engine/src/jbullet/com/jme3/bullet/PhysicsSpace.java
  37. 10
      engine/src/jbullet/com/jme3/bullet/collision/PhysicsCollisionObject.java
  38. 2
      engine/src/jheora/com/jme3/video/TestVideoPlayer.java
  39. 8
      engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java
  40. 30
      engine/src/lwjgl-ogl/com/jme3/system/lwjgl/LwjglContext.java
  41. 2
      engine/src/niftygui/com/jme3/niftygui/SoundDeviceJme.java
  42. 2
      engine/src/niftygui/com/jme3/niftygui/SoundHandleJme.java
  43. 3
      engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java
  44. 10
      engine/src/test/jme3test/animation/TestCameraMotionPath.java
  45. 8
      engine/src/test/jme3test/animation/TestMotionPath.java
  46. 4
      engine/src/test/jme3test/audio/TestAmbient.java
  47. 2
      engine/src/test/jme3test/audio/TestDoppler.java
  48. 2
      engine/src/test/jme3test/audio/TestMusicPlayer.java
  49. 4
      engine/src/test/jme3test/audio/TestOgg.java
  50. 2
      engine/src/test/jme3test/audio/TestReverb.java
  51. 2
      engine/src/test/jme3test/audio/TestWav.java
  52. 173
      engine/src/test/jme3test/collision/SphereMotionAllowedListener.java
  53. 3
      engine/src/test/jme3test/effect/TestExplosionEffect.java
  54. 4
      engine/src/test/jme3test/effect/TestMovingParticle.java
  55. 4
      engine/src/test/jme3test/gui/TestBitmapFont.java
  56. 4
      engine/src/test/jme3test/helloworld/HelloAudio.java
  57. 14
      engine/src/test/jme3test/light/TestLightRadius.java
  58. 28
      engine/src/test/jme3test/post/TestMultiplesFilters.java
  59. 2
      engine/src/test/jme3test/water/TestPostWater.java
  60. 2
      engine/src/tools/jme3tools/optimize/GeometryBatchFactory.java

@ -3,7 +3,7 @@
<project name="jME3_ordered" default="default" basedir=".">
<description>Builds, tests, and runs the project jME3_ordered.</description>
<import file="nbproject/build-impl.xml"/>
<import file="nbproject/profiler-build-impl.xml"/>
<!-- <import file="nbproject/profiler-build-impl.xml"/> -->
<!--this target creates the assets jar file and modifies the classpath to include it-->

File diff suppressed because it is too large Load Diff

@ -1,11 +1,11 @@
build.xml.data.CRC32=52f8cb9e
build.xml.script.CRC32=34d4c2f2
build.xml.stylesheet.CRC32=958a1d3e
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=759acdca
nbproject/build-impl.xml.script.CRC32=10762282
nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
nbproject/profiler-build-impl.xml.data.CRC32=aff514c1
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1
build.xml.data.CRC32=52f8cb9e
build.xml.script.CRC32=34d4c2f2
build.xml.stylesheet.CRC32=958a1d3e
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=759acdca
nbproject/build-impl.xml.script.CRC32=53d4e0e0
nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.0.45
nbproject/profiler-build-impl.xml.data.CRC32=aff514c1
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1

@ -1,131 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- profiling
- applet profiling
-->
<project name="-profiler-impl" default="profile" basedir="..">
<target name="default" depends="profile" description="Build and profile the project."/>
<!--
======================
INITIALIZATION SECTION
======================
-->
<target name="profile-init" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check"/>
<target name="-profile-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-profile-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-profile-init-macrodef-profile">
<macrodef name="resolve">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${env.@{value}}"/>
</sequential>
</macrodef>
<macrodef name="profile">
<attribute name="classname" default="${main.class}"/>
<element name="customize" optional="true"/>
<sequential>
<property environment="env"/>
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
<java fork="true" classname="@{classname}" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}">
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
<arg line="${application.args}"/>
<classpath>
<path path="${run.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-profile-init-check" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile">
<fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
<fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
</target>
<!--
=================
PROFILING SECTION
=================
-->
<target name="profile" if="netbeans.home" depends="profile-init,compile" description="Profile a project in the IDE.">
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
</classpath>
</nbprofiledirect>
<profile/>
</target>
<target name="profile-single" if="netbeans.home" depends="profile-init,compile-single" description="Profile a selected class in the IDE.">
<fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
</classpath>
</nbprofiledirect>
<profile classname="${profile.class}"/>
</target>
<!--
=========================
APPLET PROFILING SECTION
=========================
-->
<target name="profile-applet" if="netbeans.home" depends="profile-init,compile-single">
<nbprofiledirect>
<classpath>
<path path="${run.classpath}"/>
</classpath>
</nbprofiledirect>
<profile classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</profile>
</target>
<!--
=========================
TESTS PROFILING SECTION
=========================
-->
<target name="profile-test-single" if="netbeans.home" depends="profile-init,compile-test-single">
<nbprofiledirect>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
</nbprofiledirect>
<junit showoutput="true" fork="true" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}" failureproperty="tests.failed" errorproperty="tests.failed">
<env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
<jvmarg value="${profiler.info.jvmargs.agent}"/>
<jvmarg line="${profiler.info.jvmargs}"/>
<test name="${profile.class}"/>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper type="glob" from="test-sys-prop.*" to="*"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
</junit>
</target>
</project>

@ -1,107 +1,112 @@
annotation.processing.enabled=false
annotation.processing.enabled.in.editor=false
annotation.processing.run.all.processors=true
ant.customtasks.libs=JWSAntTasks
application.homepage=http://www.jmonkeyengine.com/
application.title=jMonkeyEngine 3.0
application.vendor=jMonkeyEngine
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/jMonkeyEngine3.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.src-test-data=src/test-data
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${libs.jogg.classpath}:\
${libs.jbullet.classpath}:\
${libs.lwjgl.classpath}:\
${libs.jheora.classpath}:\
${libs.niftygui1.3.classpath}:\
${libs.jme3-test-data.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit_4.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=jMonkeyEngine3
jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
jnlp.applet.class=jme3test.awt.AppHarness
jnlp.applet.height=300
jnlp.applet.width=300
jnlp.codebase.type=user
jnlp.codebase.user=http://jmonkeyengine.com/javawebstart/
jnlp.descriptor=application
jnlp.enabled=false
jnlp.icon=/Users/normenhansen/Pictures/jme/icons/jme-logo48.png
jnlp.mixed.code=defaut
jnlp.offline-allowed=true
jnlp.signed=true
main.class=jme3test.TestChooser
manifest.file=MANIFEST.MF
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
run.jvmargs=-Xms40m -Xmx40m -XX:MaxDirectMemorySize=256M
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.core-data.dir=src/core-data
src.core-plugins.dir=src/core-plugins
src.core.dir=src/core
src.desktop-fx.dir=src/desktop-fx
src.desktop.dir=src/desktop
src.games.dir=src/games
src.jbullet.dir=src/jbullet
src.jheora.dir=src/jheora
src.jogg.dir=src/jogg
src.lwjgl-oal.dir=src/lwjgl-oal
src.lwjgl-ogl.dir=src/lwjgl-ogl
src.networking.dir=src\\networking
src.niftygui.dir=src/niftygui
src.ogre.dir=src/ogre
src.pack.dir=src/pack
src.terrain.dir=src/terrain
src.test.dir=src/test
src.tools.dir=src/tools
src.xml.dir=src/xml
test.test.dir=test
annotation.processing.enabled=false
annotation.processing.enabled.in.editor=false
annotation.processing.run.all.processors=true
ant.customtasks.libs=JWSAntTasks
application.homepage=http://www.jmonkeyengine.com/
application.title=jMonkeyEngine 3.0
application.vendor=jMonkeyEngine
assets.compress=false
assets.excludes=
assets.folder.name=
assets.jar.name=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/jMonkeyEngine3.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.src-test-data=src/test-data
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=true
jar.index=${jnlp.enabled}
javac.classpath=\
${libs.jogg.classpath}:\
${libs.jbullet.classpath}:\
${libs.lwjgl.classpath}:\
${libs.jheora.classpath}:\
${libs.niftygui1.3.classpath}:\
${libs.jme3-test-data.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit_4.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=jMonkeyEngine3
jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
jnlp.applet.class=jme3test.awt.AppHarness
jnlp.applet.height=300
jnlp.applet.width=300
jnlp.codebase.type=user
jnlp.codebase.user=http://jmonkeyengine.com/javawebstart/
jnlp.descriptor=application
jnlp.enabled=false
jnlp.icon=/Users/normenhansen/Pictures/jme/icons/jme-logo48.png
jnlp.mixed.code=defaut
jnlp.offline-allowed=true
jnlp.signed=true
main.class=jme3test.TestChooser
manifest.file=MANIFEST.MF
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
run.jvmargs=-Xms40m -Xmx40m -XX:MaxDirectMemorySize=256M
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.core-data.dir=src/core-data
src.core-plugins.dir=src/core-plugins
src.core.dir=src/core
src.desktop-fx.dir=src/desktop-fx
src.desktop.dir=src/desktop
src.games.dir=src/games
src.jbullet.dir=src/jbullet
src.jheora.dir=src/jheora
src.jogg.dir=src/jogg
src.lwjgl-oal.dir=src/lwjgl-oal
src.lwjgl-ogl.dir=src/lwjgl-ogl
src.networking.dir=src\\networking
src.niftygui.dir=src/niftygui
src.ogre.dir=src/ogre
src.pack.dir=src/pack
src.terrain.dir=src/terrain
src.test.dir=src/test
src.tools.dir=src/tools
src.xml.dir=src/xml
test.test.dir=test

@ -1,885 +0,0 @@
/*
* 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.
*/
package com.jme3.animation;
import com.jme3.asset.AssetManager;
import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.export.OutputCapsule;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.VertexBuffer;
import com.jme3.scene.control.AbstractControl;
import com.jme3.scene.control.Control;
import com.jme3.scene.shape.Box;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
*
*
* @deprecated use {@link MotionPath}
*/
@Deprecated
public class AnimationPath extends AbstractControl {
private boolean playing = false;
private int currentWayPoint;
private float currentValue;
private List<Vector3f> wayPoints = new ArrayList<Vector3f>();
private Node debugNode;
private AssetManager assetManager;
private List<AnimationPathListener> listeners;
private Vector3f curveDirection;
private Vector3f lookAt;
private Vector3f upVector;
private Quaternion rotation;
private float duration = 5f;
private List<Float> segmentsLength;
private float totalLength;
private List<Vector3f> CRcontrolPoints;
private float speed;
private float curveTension = 0.5f;
private boolean loop = false;
private boolean cycle = false;
@Override
protected void controlUpdate(float tpf) {
}
@Override
protected void controlRender(RenderManager rm, ViewPort vp) {
}
/**
* Enum for the different type of target direction behavior
*/
@Deprecated
public enum Direction {
/**
* the target stay in the starting direction
*/
None,
/**
* The target rotates with the direction of the path
*/
Path,
/**
* The target rotates with the direction of the path but with the additon of a rtotation
* you need to use the setRotation mathod when using this Direction
*/
PathAndRotation,
/**
* The target rotates with the given rotation
*/
Rotation,
/**
* The target looks at a point
* You need to use the setLookAt method when using this direction
*/
LookAt
}
private Direction directionType = Direction.None;
@Deprecated
public enum PathInterpolation {
/**
* Compute a linear path between the waypoints
*/
Linear,
/**
* Compute a Catmull-Rom spline path between the waypoints
* see http://www.mvps.org/directx/articles/catmull/
*/
CatmullRom
}
private PathInterpolation pathInterpolation = PathInterpolation.CatmullRom;
/**
* Create an animation Path for this target
* @param target
*/
@Deprecated
public AnimationPath(Spatial target) {
super();
this.spatial = target;
target.addControl(this);
}
/**
* don't use this contructor use AnimationPath(Spatial target)
*/
@Deprecated
public AnimationPath() {
super();
}
@Deprecated
public Control cloneForSpatial(Spatial spatial) {
AnimationPath path = new AnimationPath(spatial);
for (Iterator<Vector3f> it = wayPoints.iterator(); it.hasNext();) {
Vector3f vector3f = it.next();
path.addWayPoint(vector3f);
}
for (Iterator<AnimationPathListener> it = listeners.iterator(); it.hasNext();) {
AnimationPathListener animationPathListener = it.next();
path.addListener(animationPathListener);
}
return path;
}
@Override
public void setSpatial(Spatial spatial) {
this.spatial = spatial;
}
@Override
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
@Override
public boolean isEnabled() {
return enabled;
}
float eps = 0.0001f;
/**
* Cal each update, don't call this method, it's for internal use only
* @param tpf
*/
@Override
public void update(float tpf) {
if (enabled) {
if (playing) {
spatial.setLocalTranslation(interpolatePath(tpf));
computeTargetDirection();
if (currentValue >= 1.0f) {
currentValue = 0;
currentWayPoint++;
triggerWayPointReach(currentWayPoint);
}
if (currentWayPoint == wayPoints.size() - 1) {
if (loop) {
currentWayPoint = 0;
} else {
stop();
}
}
}
}
}
private Vector3f interpolatePath(float tpf) {
Vector3f temp = null;
float val;
switch (pathInterpolation) {
case CatmullRom:
val = tpf * speed;
currentValue += eps;
temp = FastMath.interpolateCatmullRom(currentValue, curveTension, CRcontrolPoints.get(currentWayPoint), CRcontrolPoints.get(currentWayPoint + 1), CRcontrolPoints.get(currentWayPoint + 2), CRcontrolPoints.get(currentWayPoint + 3));
float dist = temp.subtract(spatial.getLocalTranslation()).length();
while (dist < val) {
currentValue += eps;
temp = FastMath.interpolateCatmullRom(currentValue, curveTension, CRcontrolPoints.get(currentWayPoint), CRcontrolPoints.get(currentWayPoint + 1), CRcontrolPoints.get(currentWayPoint + 2), CRcontrolPoints.get(currentWayPoint + 3));
dist = temp.subtract(spatial.getLocalTranslation()).length();
}
if (directionType == Direction.Path || directionType == Direction.PathAndRotation) {
curveDirection = temp.subtract(spatial.getLocalTranslation()).normalizeLocal();
}
break;
case Linear:
val = duration * segmentsLength.get(currentWayPoint) / totalLength;
currentValue = Math.min(currentValue + tpf / val, 1.0f);
temp = FastMath.interpolateLinear(currentValue, wayPoints.get(currentWayPoint), wayPoints.get(currentWayPoint + 1));
curveDirection = wayPoints.get(currentWayPoint + 1).subtract(wayPoints.get(currentWayPoint)).normalizeLocal();
break;
default:
break;
}
return temp;
}
private void computeTargetDirection() {
switch (directionType) {
case Path:
Quaternion q = new Quaternion();
q.lookAt(curveDirection, Vector3f.UNIT_Y);
spatial.setLocalRotation(q);
break;
case LookAt:
if (lookAt != null) {
spatial.lookAt(lookAt, upVector);
}
break;
case PathAndRotation:
if (rotation != null) {
Quaternion q2 = new Quaternion();
q2.lookAt(curveDirection, Vector3f.UNIT_Y);
q2.multLocal(rotation);
spatial.setLocalRotation(q2);
}
break;
case Rotation:
if (rotation != null) {
spatial.setLocalRotation(rotation);
}
break;
case None:
break;
default:
break;
}
}
private void attachDebugNode(Node root) {
if (debugNode == null) {
debugNode = new Node("AnimationPathFor" + spatial.getName());
Material m = assetManager.loadMaterial("Common/Materials/RedColor.j3m");
for (Iterator<Vector3f> it = wayPoints.iterator(); it.hasNext();) {
Vector3f cp = it.next();
Geometry geo = new Geometry("box", new Box(cp, 0.3f, 0.3f, 0.3f));
geo.setMaterial(m);
debugNode.attachChild(geo);
}
switch (pathInterpolation) {
case CatmullRom:
debugNode.attachChild(CreateCatmullRomPath());
break;
case Linear:
debugNode.attachChild(CreateLinearPath());
break;
default:
debugNode.attachChild(CreateLinearPath());
break;
}
root.attachChild(debugNode);
}
}
private Geometry CreateLinearPath() {
Material mat = new Material(assetManager, "Common/MatDefs/Misc/WireColor.j3md");
mat.setColor("Color", ColorRGBA.Blue);
float[] array = new float[wayPoints.size() * 3];
short[] indices = new short[(wayPoints.size() - 1) * 2];
int i = 0;
int cpt = 0;
int k = 0;
int j = 0;
for (Iterator<Vector3f> it = wayPoints.iterator(); it.hasNext();) {
Vector3f vector3f = it.next();
array[i] = vector3f.x;
i++;
array[i] = vector3f.y;
i++;
array[i] = vector3f.z;
i++;
if (it.hasNext()) {
k = j;
indices[cpt] = (short) k;
cpt++;
k++;
indices[cpt] = (short) k;
cpt++;
j++;
}
}
Mesh lineMesh = new Mesh();
lineMesh.setMode(Mesh.Mode.Lines);
lineMesh.setBuffer(VertexBuffer.Type.Position, 3, array);
lineMesh.setBuffer(VertexBuffer.Type.Index, (wayPoints.size() - 1) * 2, indices);
lineMesh.updateBound();
lineMesh.updateCounts();
Geometry lineGeometry = new Geometry("line", lineMesh);
lineGeometry.setMaterial(mat);
return lineGeometry;
}
private Geometry CreateCatmullRomPath() {
Material mat = new Material(assetManager, "Common/MatDefs/Misc/WireColor.j3md");
mat.setColor("Color", ColorRGBA.Blue);
int nbSubSegments = 10;
float[] array = new float[(((wayPoints.size() - 1) * nbSubSegments) + 1) * 3];
short[] indices = new short[((wayPoints.size() - 1) * nbSubSegments) * 2];
int i = 0;
int cptCP = 0;
for (Iterator<Vector3f> it = wayPoints.iterator(); it.hasNext();) {
Vector3f vector3f = it.next();
array[i] = vector3f.x;
i++;
array[i] = vector3f.y;
i++;
array[i] = vector3f.z;
i++;
if (it.hasNext()) {
for (int j = 1; j < nbSubSegments; j++) {
Vector3f temp = FastMath.interpolateCatmullRom((float) j / nbSubSegments, curveTension, CRcontrolPoints.get(cptCP),
CRcontrolPoints.get(cptCP + 1), CRcontrolPoints.get(cptCP + 2), CRcontrolPoints.get(cptCP + 3));
array[i] = temp.x;
i++;
array[i] = temp.y;
i++;
array[i] = temp.z;
i++;
}
}
cptCP++;
}
i = 0;
int k = 0;
for (int j = 0; j < ((wayPoints.size() - 1) * nbSubSegments); j++) {
k = j;
indices[i] = (short) k;
i++;
k++;
indices[i] = (short) k;
i++;
}
Mesh lineMesh = new Mesh();
lineMesh.setMode(Mesh.Mode.Lines);
lineMesh.setBuffer(VertexBuffer.Type.Position, 3, array);
lineMesh.setBuffer(VertexBuffer.Type.Index, ((wayPoints.size() - 1) * nbSubSegments) * 2, indices);
lineMesh.updateBound();
lineMesh.updateCounts();
Geometry lineGeometry = new Geometry("line", lineMesh);
lineGeometry.setMaterial(mat);
return lineGeometry;
}
private void initCatmullRomWayPoints(List<Vector3f> list) {
if (CRcontrolPoints == null) {
CRcontrolPoints = new ArrayList<Vector3f>();
} else {
CRcontrolPoints.clear();
}
int nb = list.size() - 1;
if (cycle) {
CRcontrolPoints.add(list.get(list.size() - 2));
} else {
CRcontrolPoints.add(list.get(0).subtract(list.get(1).subtract(list.get(0))));
}
for (Iterator<Vector3f> it = list.iterator(); it.hasNext();) {
Vector3f vector3f = it.next();
CRcontrolPoints.add(vector3f);
}
if (cycle) {
CRcontrolPoints.add(list.get(1));
} else {
CRcontrolPoints.add(list.get(nb).add(list.get(nb).subtract(list.get(nb - 1))));
}
}
@Override
public void render(RenderManager rm, ViewPort vp) {
//nothing to render
}
@Override
public void write(JmeExporter ex) throws IOException {
super.write(ex);
OutputCapsule oc = ex.getCapsule(this);
oc.writeSavableArrayList((ArrayList) wayPoints, "wayPoints", null);
oc.write(lookAt, "lookAt", Vector3f.ZERO);
oc.write(upVector, "upVector", Vector3f.UNIT_Y);
oc.write(rotation, "rotation", Quaternion.IDENTITY);
oc.write(duration, "duration", 5f);
oc.write(directionType, "directionType", Direction.None);
oc.write(pathInterpolation, "pathInterpolation", PathInterpolation.CatmullRom);
float list[]=new float[segmentsLength.size()];
for (int i=0;i<segmentsLength.size();i++) {
list[i]=segmentsLength.get(i);
}
oc.write(list, "segmentsLength", null);
oc.write(totalLength, "totalLength", 0);
oc.writeSavableArrayList((ArrayList) CRcontrolPoints, "CRControlPoints", null);
oc.write(speed, "speed", 0);
oc.write(curveTension, "curveTension", 0.5f);
oc.write(cycle, "cycle", false);
oc.write(loop, "loop", false);
}
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule in = im.getCapsule(this);
wayPoints = (ArrayList<Vector3f>) in.readSavableArrayList("wayPoints", null);
lookAt = (Vector3f) in.readSavable("lookAt", Vector3f.ZERO);
upVector = (Vector3f) in.readSavable("upVector", Vector3f.UNIT_Y);
rotation = (Quaternion) in.readSavable("rotation", Quaternion.IDENTITY);
duration = in.readFloat("duration", 5f);
float list[]=in.readFloatArray("segmentsLength", null);
if (list!=null){
segmentsLength=new ArrayList<Float>();
for (int i=0;i<list.length;i++) {
segmentsLength.add(new Float(list[i]));
}
}
directionType=in.readEnum("directionType",Direction.class, Direction.None);
pathInterpolation= in.readEnum("pathInterpolation", PathInterpolation.class,PathInterpolation.CatmullRom);
totalLength = in.readFloat("totalLength", 0);
CRcontrolPoints = (ArrayList<Vector3f>) in.readSavableArrayList("CRControlPoints", null);
speed = in.readFloat("speed", 0);
curveTension = in.readFloat("curveTension", 0.5f);
cycle = in.readBoolean("cycle", false);
loop = in.readBoolean("loop", false);
}
/**
* plays the animation
*/
@Deprecated
public void play() {
playing = true;
}
/**
* pauses the animation
*/
@Deprecated
public void pause() {
playing = false;
}
/**
* stops the animation, next time play() is called the animation will start from the begining.
*/
@Deprecated
public void stop() {
playing = false;
currentWayPoint = 0;
}
/**
* Addsa waypoint to the path
* @param wayPoint a position in world space
*/
@Deprecated
public void addWayPoint(Vector3f wayPoint) {
if (wayPoints.size() > 2 && this.cycle) {
wayPoints.remove(wayPoints.size() - 1);
}
wayPoints.add(wayPoint);
if (wayPoints.size() >= 2 && this.cycle) {
wayPoints.add(wayPoints.get(0));
}
if (wayPoints.size() > 1) {
computeTotalLentgh();
}
}
private void computeTotalLentgh() {
totalLength = 0;
float l = 0;
if (segmentsLength == null) {
segmentsLength = new ArrayList<Float>();
} else {
segmentsLength.clear();
}
if (pathInterpolation == PathInterpolation.Linear) {
if (wayPoints.size() > 1) {
for (int i = 0; i < wayPoints.size() - 1; i++) {
l = wayPoints.get(i + 1).subtract(wayPoints.get(i)).length();
segmentsLength.add(l);
totalLength += l;
}
}
} else {
initCatmullRomWayPoints(wayPoints);
computeCatmulLength();
}
}
private void computeCatmulLength() {
float l = 0;
if (wayPoints.size() > 1) {
for (int i = 0; i < wayPoints.size() - 1; i++) {
l = getCatmullRomP1toP2Length(CRcontrolPoints.get(i),
CRcontrolPoints.get(i + 1), CRcontrolPoints.get(i + 2), CRcontrolPoints.get(i + 3), 0, 1);
segmentsLength.add(l);
totalLength += l;
}
}
speed = totalLength / duration;
}
/**
* retruns the length of the path in world units
* @return the length
*/
@Deprecated
public float getLength() {
return totalLength;
}
//Compute lenght of p1 to p2 arc segment
//TODO extract to FastMath class
private float getCatmullRomP1toP2Length(Vector3f p0, Vector3f p1, Vector3f p2, Vector3f p3, float startRange, float endRange) {
float epsilon = 0.001f;
float middleValue = (startRange + endRange) * 0.5f;
Vector3f start = p1;
if (startRange != 0) {
start = FastMath.interpolateCatmullRom(startRange, curveTension, p0, p1, p2, p3);
}
Vector3f end = p2;
if (endRange != 1) {
end = FastMath.interpolateCatmullRom(endRange, curveTension, p0, p1, p2, p3);
}
Vector3f middle = FastMath.interpolateCatmullRom(middleValue, curveTension, p0, p1, p2, p3);
float l = end.subtract(start).length();
float l1 = middle.subtract(start).length();
float l2 = end.subtract(middle).length();
float len = l1 + l2;
if (l + epsilon < len) {
l1 = getCatmullRomP1toP2Length(p0, p1, p2, p3, startRange, middleValue);
l2 = getCatmullRomP1toP2Length(p0, p1, p2, p3, middleValue, endRange);
}
l = l1 + l2;
return l;
}
/**
* returns the waypoint at the given index
* @param i the index
* @return returns the waypoint position
*/
@Deprecated
public Vector3f getWayPoint(int i) {
return wayPoints.get(i);
}
/**
* remove the waypoint from the path
* @param wayPoint the waypoint to remove
*/
@Deprecated
public void removeWayPoint(Vector3f wayPoint) {
wayPoints.remove(wayPoint);
if (wayPoints.size() > 1) {
computeTotalLentgh();
}
}
/**
* remove the waypoint at the given index from the path
* @param i the index of the waypoint to remove
*/
@Deprecated
public void removeWayPoint(int i) {
removeWayPoint(wayPoints.get(i));
}
/**
* returns an iterator on the waypoints collection
* @return
*/
@Deprecated
public Iterator<Vector3f> iterator() {
return wayPoints.iterator();
}
/**
* return the type of path interpolation for this path
* @return the path interpolation
*/
@Deprecated
public PathInterpolation getPathInterpolation() {
return pathInterpolation;
}
/**
* sets the path interpolation for this path
* @param pathInterpolation
*/
@Deprecated
public void setPathInterpolation(PathInterpolation pathInterpolation) {
this.pathInterpolation = pathInterpolation;
computeTotalLentgh();
if (debugNode != null) {
Node parent = debugNode.getParent();
debugNode.removeFromParent();
debugNode.detachAllChildren();
debugNode = null;
attachDebugNode(parent);
}
}
/**
* disable the display of the path and the waypoints
*/
@Deprecated
public void disableDebugShape() {
debugNode.detachAllChildren();
debugNode = null;
assetManager = null;
}
/**
* enable the display of the path and the waypoints
* @param manager the assetManager
* @param rootNode the node where the debug shapes must be attached
*/
@Deprecated
public void enableDebugShape(AssetManager manager, Node rootNode) {
assetManager = manager;
computeTotalLentgh();
attachDebugNode(rootNode);
}
/**
* Adds an animation pathListener to the path
* @param listener the AnimationPathListener to attach
*/
@Deprecated
public void addListener(AnimationPathListener listener) {
if (listeners == null) {
listeners = new ArrayList<AnimationPathListener>();
}
listeners.add(listener);
}
/**
* remove the given listener
* @param listener the listener to remove
*/
@Deprecated
public void removeListener(AnimationPathListener listener) {
if (listeners != null) {
listeners.remove(listener);
}
}
/**
* return the number of waypoints of this path
* @return
*/
@Deprecated
public int getNbWayPoints() {
return wayPoints.size();
}
private void triggerWayPointReach(int wayPointIndex) {
for (Iterator<AnimationPathListener> it = listeners.iterator(); it.hasNext();) {
AnimationPathListener listener = it.next();
listener.onWayPointReach(this, wayPointIndex);
}
}
/**
* returns the direction type of the target
* @return the direction type
*/
@Deprecated
public Direction getDirectionType() {
return directionType;
}
/**
* Sets the direction type of the target
* On each update the direction given to the target can have different behavior
* See the Direction Enum for explanations
* @param directionType the direction type
*/
@Deprecated
public void setDirectionType(Direction directionType) {
this.directionType = directionType;
}
/**
* Set the lookAt for the target
* This can be used only if direction Type is Direction.LookAt
* @param lookAt the position to look at
* @param upVector the up vector
*/
@Deprecated
public void setLookAt(Vector3f lookAt, Vector3f upVector) {
this.lookAt = lookAt;
this.upVector = upVector;
}
/**
* returns the rotation of the target
* @return the rotation quaternion
*/
@Deprecated
public Quaternion getRotation() {
return rotation;
}
/**
* sets the rotation of the target
* This can be used only if direction Type is Direction.PathAndRotation or Direction.Rotation
* With PathAndRotation the target will face the direction of the path multiplied by the given Quaternion.
* With Rotation the rotation of the target will be set with the given Quaternion.
* @param rotation the rotation quaternion
*/
@Deprecated
public void setRotation(Quaternion rotation) {
this.rotation = rotation;
}
@Deprecated
public float getDuration() {
return duration;
}
/**
* Sets the duration of the animation
* @param duration
*/
@Deprecated
public void setDuration(float duration) {
this.duration = duration;
speed = totalLength / duration;
}
@Deprecated
public float getCurveTension() {
return curveTension;
}
/**
* sets the tension of the curve (only for catmull rom) 0.0 will give a linear curve, 1.0 a round curve
* @param curveTension
*/
@Deprecated
public void setCurveTension(float curveTension) {
this.curveTension = curveTension;
computeTotalLentgh();
if (debugNode != null) {
Node parent = debugNode.getParent();
debugNode.removeFromParent();
debugNode.detachAllChildren();
debugNode = null;
attachDebugNode(parent);
}
}
/**
* Sets the path to be a cycle
* @param cycle
*/
@Deprecated
public void setCycle(boolean cycle) {
if (wayPoints.size() >= 2) {
if (this.cycle && !cycle) {
wayPoints.remove(wayPoints.size() - 1);
}
if (!this.cycle && cycle) {
wayPoints.add(wayPoints.get(0));
System.out.println("adding first wp");
}
this.cycle = cycle;
computeTotalLentgh();
if (debugNode != null) {
Node parent = debugNode.getParent();
debugNode.removeFromParent();
debugNode.detachAllChildren();
debugNode = null;
attachDebugNode(parent);
}
} else {
this.cycle = cycle;
}
}
@Deprecated
public boolean isCycle() {
return cycle;
}
/**
* returs true is the animation loops
* @return
*/
@Deprecated
public boolean isLoop() {
return loop;
}
/**
* Loops the animation
* @param loop
*/
@Deprecated
public void setLoop(boolean loop) {
this.loop = loop;
}
@Override
public String toString() {
return "AnimationPath{" + "playing=" + playing + "currentWayPoint=" + currentWayPoint + "currentValue=" + currentValue + "wayPoints=" + wayPoints + "debugNode=" + debugNode + "assetManager=" + assetManager + "listeners=" + listeners + "curveDirection=" + curveDirection + "lookAt=" + lookAt + "upVector=" + upVector + "rotation=" + rotation + "duration=" + duration + "segmentsLength=" + segmentsLength + "totalLength=" + totalLength + "CRcontrolPoints=" + CRcontrolPoints + "speed=" + speed + "curveTension=" + curveTension + "loop=" + loop + "cycle=" + cycle + "directionType=" + directionType + "pathInterpolation=" + pathInterpolation + "eps=" + eps + '}';
}
}

@ -1,50 +0,0 @@
/*
* 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.
*/
package com.jme3.animation;
/**
*
* @author Nehon
* @deprecated use {@link MotionPathListener}
*/
@Deprecated
public interface AnimationPathListener {
/**
* Triggers every time the target reach a waypoint on the path
* @param path the animation path on wich the even has been triggered
* @param wayPointIndex the index of the way point reached
*/
public void onWayPointReach(AnimationPath path,int wayPointIndex);
}

@ -59,22 +59,6 @@ public class AbstractAppState implements AppState {
return initialized;
}
/**
* Use setEnabled() instead
*/
@Deprecated
public void setActive(boolean active) {
setEnabled(active);
}
/**
* Use isEnabled() instead
*/
@Deprecated
public boolean isActive() {
return isEnabled();
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

@ -47,7 +47,7 @@ import java.io.IOException;
*/
public class AudioNode extends Node {
protected AudioRenderer renderer;
protected final AudioRenderer renderer;
protected boolean loop = false;
protected float volume = 1;
@ -75,30 +75,32 @@ public class AudioNode extends Node {
Stopped,
}
public AudioNode() {
public AudioNode(AudioRenderer audioRenderer) {
this.renderer = audioRenderer;
}
public AudioNode(AudioData ad, AudioKey key) {
this();
public AudioNode(AudioRenderer audioRenderer, AudioData ad, AudioKey key) {
this(audioRenderer);
setAudioData(ad, key);
}
public AudioNode(AssetManager manager, String name, boolean stream) {
this();
public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, String name, boolean stream) {
this(audioRenderer);
this.key = new AudioKey(name, stream);
this.data = (AudioData) manager.loadAsset(key);
this.data = (AudioData) assetManager.loadAsset(key);
}
public AudioNode(AssetManager manager, String name) {
this(manager, name, false);
public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, String name) {
this(audioRenderer, assetManager, name, false);
}
public void setChannel(AudioRenderer renderer, int channel) {
public void setChannel(int channel) {
if (status != Status.Stopped) {
throw new IllegalStateException("Can only set source id when stopped");
}
this.renderer = renderer;
this.channel = channel;
}
@ -116,7 +118,7 @@ public class AudioNode extends Node {
}
this.dryFilter = dryFilter;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.DryFilter);
}
@ -147,7 +149,7 @@ public class AudioNode extends Node {
public void setLooping(boolean loop) {
this.loop = loop;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.Looping);
}
@ -161,7 +163,7 @@ public class AudioNode extends Node {
}
this.pitch = pitch;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.Pitch);
}
@ -175,7 +177,7 @@ public class AudioNode extends Node {
}
this.volume = volume;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.Volume);
}
@ -197,7 +199,7 @@ public class AudioNode extends Node {
public void setVelocity(Vector3f velocity) {
this.velocity.set(velocity);
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.Velocity);
}
@ -207,7 +209,7 @@ public class AudioNode extends Node {
public void setReverbEnabled(boolean reverbEnabled) {
this.reverbEnabled = reverbEnabled;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.ReverbEnabled);
}
@ -221,7 +223,7 @@ public class AudioNode extends Node {
}
this.reverbFilter = reverbFilter;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.ReverbFilter);
}
@ -235,7 +237,7 @@ public class AudioNode extends Node {
}
this.maxDistance = maxDistance;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.MaxDistance);
}
@ -249,7 +251,7 @@ public class AudioNode extends Node {
}
this.refDistance = refDistance;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.RefDistance);
}
@ -259,7 +261,7 @@ public class AudioNode extends Node {
public void setDirectional(boolean directional) {
this.directional = directional;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.IsDirectional);
}
@ -269,7 +271,7 @@ public class AudioNode extends Node {
public void setDirection(Vector3f direction) {
this.direction = direction;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.Direction);
}
@ -279,7 +281,7 @@ public class AudioNode extends Node {
public void setInnerAngle(float innerAngle) {
this.innerAngle = innerAngle;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.InnerAngle);
}
@ -289,7 +291,7 @@ public class AudioNode extends Node {
public void setOuterAngle(float outerAngle) {
this.outerAngle = outerAngle;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.OuterAngle);
}
@ -299,7 +301,7 @@ public class AudioNode extends Node {
public void setPositional(boolean inHeadspace) {
this.positional = inHeadspace;
if (renderer != null)
if (channel >= 0)
renderer.updateSourceParam(this, AudioParam.IsPositional);
}
@ -316,15 +318,6 @@ public class AudioNode extends Node {
renderer.updateSourceParam(this, AudioParam.Position);
}
@Deprecated
public boolean isUpdateNeeded(){
return true;
}
@Deprecated
public void clearUpdateNeeded(){
}
// @Override
// public AudioNode clone(){
// try{
@ -334,6 +327,7 @@ public class AudioNode extends Node {
// }
// }
@Override
public void write(JmeExporter ex) throws IOException {
super.write(ex);
OutputCapsule oc = ex.getCapsule(this);
@ -356,6 +350,7 @@ public class AudioNode extends Node {
oc.write(outerAngle, "outer_angle", 360);
}
@Override
public void read(JmeImporter im) throws IOException {
super.read(im);
InputCapsule ic = im.getCapsule(this);
@ -379,6 +374,7 @@ public class AudioNode extends Node {
data = im.getAssetManager().loadAudio(key);
}
@Override
public String toString() {
String ret = getClass().getSimpleName()
+ "[status=" + status;

@ -198,22 +198,6 @@ public class Cinematic extends AbstractCinematicEvent implements Savable, AppSta
return initialized;
}
/**
* Use setEnabled() instead
*/
@Deprecated
public void setActive(boolean active) {
setEnabled(active);
}
/**
* Use isEnabled() instead
*/
@Deprecated
public boolean isActive() {
return isEnabled();
}
public void setEnabled(boolean enabled) {
if (enabled) {
play();

@ -70,24 +70,6 @@ public class MotionPath implements Savable {
private Vector3f temp = new Vector3f();
private Vector3f tmpVector = new Vector3f();
/**
*
* @deprecated replaced by com.jme3.scene.shape.Spline.SplineType
*/
@Deprecated
public enum PathInterpolation {
/**
* Compute a linear path between the waypoints
*/
Linear,
/**
* Compute a Catmull-Rom spline path between the waypoints
* see http://www.mvps.org/directx/articles/catmull/
*/
CatmullRom
}
/**
* Create a motion Path
*/
@ -248,33 +230,6 @@ public class MotionPath implements Savable {
return spline.getControlPoints().iterator();
}
/**
* @deprecated use getPathSplineType
* return the type of path interpolation for this path
* @return the path interpolation
*/
@Deprecated
public PathInterpolation getPathInterpolation() {
if (spline.getType() == SplineType.CatmullRom) {
return PathInterpolation.CatmullRom;
}
return PathInterpolation.Linear;
}
/**
* @deprecated use setPathSplineType instead
* sets the path interpolation for this path
* @param pathInterpolation
*/
@Deprecated
public void setPathInterpolation(PathInterpolation pathInterpolation) {
if (pathInterpolation == PathInterpolation.CatmullRom) {
setPathSplineType(SplineType.CatmullRom);
} else {
setPathSplineType(SplineType.Linear);
}
}
/**
* return the type of spline used for the path interpolation for this path
* @return the path interpolation spline type

@ -110,7 +110,7 @@ public class SoundTrack extends AbstractCinematicEvent {
@Override
public void initEvent(Application app, Cinematic cinematic) {
audioRenderer = app.getAudioRenderer();
audioNode = new AudioNode(app.getAssetManager(), path, stream);
audioNode = new AudioNode(audioRenderer, app.getAssetManager(), path, stream);
setLoopMode(loopMode);
}

@ -107,16 +107,6 @@ public class CollisionResult implements Comparable<CollisionResult> {
return contactPoint;
}
/**
*
* @return
* @deprecated Use getContactPoint() instead, its already in world space.
*/
@Deprecated
public Vector3f getWorldContactPoint() {
return contactPoint;
}
public Vector3f getContactNormal() {
return contactNormal;
}

@ -39,15 +39,12 @@ import com.jme3.math.Triangle;
import com.jme3.math.Vector3f;
/**
* Sweep sphere implements a collidable moving sphere.
* Usually used to simulate simple physics for character entities in games.
* The sweep sphere can be used to check collision against
* a triangle or another sweep sphere.
* No longer public ..
*
* @author Kirill Vainer
*/
@Deprecated
public class SweepSphere implements Collidable {
class SweepSphere implements Collidable {
private Vector3f velocity = new Vector3f();
private Vector3f center = new Vector3f();

@ -40,7 +40,6 @@ import com.jme3.bounding.BoundingBox;
import com.jme3.bounding.BoundingVolume;
import com.jme3.collision.Collidable;
import com.jme3.collision.CollisionResults;
import com.jme3.collision.SweepSphere;
import com.jme3.collision.UnsupportedCollisionException;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
@ -422,26 +421,6 @@ public class BIHTree implements CollisionData {
return 0;
}
private int collideWithSweepSphere(SweepSphere ss,
Matrix4f worldMatrix,
BoundingVolume worldBound,
CollisionResults results){
Vector3f min = new Vector3f(ss.getCenter());
min.subtractLocal(ss.getDimension());
Vector3f max = new Vector3f(ss.getCenter());
max.addLocal(ss.getVelocity()).addLocal(ss.getDimension());
BoundingBox bbox = new BoundingBox();
bbox.setMinMax(min, max);
if (worldBound.intersectsBoundingBox(bbox)){
return root.intersectWhere(ss, bbox, worldMatrix, this, results);
}
return 0;
}
private int collideWithBoundingVolume(BoundingVolume bv,
Matrix4f worldMatrix,
CollisionResults results){
@ -466,10 +445,7 @@ public class BIHTree implements CollisionData {
BoundingVolume worldBound,
CollisionResults results){
if (other instanceof SweepSphere){
SweepSphere ss = (SweepSphere) other;
return collideWithSweepSphere(ss, worldMatrix, worldBound, results);
}else if (other instanceof Ray){
if (other instanceof Ray){
Ray ray = (Ray) other;
return collideWithRay(ray, worldMatrix, worldBound, results);
}else if (other instanceof BoundingVolume){

@ -406,22 +406,6 @@ public class ParticleEmitter extends Geometry implements Control {
this.startSize = startSize;
}
/**
* @deprecated Use {@link ParticleEmitter#getInitialVelocity() }
*/
@Deprecated
public Vector3f getStartVel() {
return startVel;
}
/**
* @deprecated Use {@link ParticleEmitter#setInitialVelocity(com.jme3.math.Vector3f) }
*/
@Deprecated
public void setStartVel(Vector3f startVel) {
this.startVel.set(startVel);
}
public Vector3f getInitialVelocity(){
return startVel;
}
@ -440,22 +424,6 @@ public class ParticleEmitter extends Geometry implements Control {
this.startVel.set(initialVelocity);
}
/**
* @deprecated Use {@link ParticleEmitter#getVelocityVariation() }
*/
@Deprecated
public float getVariation() {
return variation;
}
/**
* @deprecated Use {@link ParticleEmitter#setVelocityVariation() }
*/
@Deprecated
public void setVariation(float variation) {
this.variation = variation;
}
public float getVelocityVariation() {
return variation;
}

@ -202,20 +202,6 @@ public class BitmapText extends Node {
return block.getLineCount();
}
@Deprecated
public boolean isWordWrap() {
return block.getLineWrapMode() == LineWrapMode.Word;
}
@Deprecated
public void setWordWrap(boolean wrap) {
if (wrap) {
setLineWrapMode(LineWrapMode.Word);
} else {
setLineWrapMode(LineWrapMode.Character);
}
}
public LineWrapMode getLineWrapMode() {
return block.getLineWrapMode();
}

@ -579,42 +579,6 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
minDistance = ic.readFloat("minDistance", 1);
}
/**
*
* @deprecated use getMaxVerticalRotation()
*/
@Deprecated
public float getMaxHeight() {
return getMaxVerticalRotation();
}
/**
*
* @deprecated use setMaxVerticalRotation()
*/
@Deprecated
public void setMaxHeight(float maxHeight) {
setMaxVerticalRotation(maxHeight);
}
/**
*
* @deprecated use getMinVerticalRotation()
*/
@Deprecated
public float getMinHeight() {
return getMinVerticalRotation();
}
/**
*
* @deprecated use setMinVerticalRotation()
*/
@Deprecated
public void setMinHeight(float minHeight) {
setMinVerticalRotation(minHeight);
}
/**
* returns the maximal vertical rotation angle of the camera around the target
* @return
@ -868,16 +832,6 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
return initialUpVec;
}
/**
*
* @param invertYaxis
* @deprecated use setInvertVerticalAxis
*/
@Deprecated
public void setInvertYaxis(boolean invertYaxis) {
setInvertVerticalAxis(invertYaxis);
}
/**
* invert the vertical axis movement of the mouse
* @param invertYaxis

@ -520,19 +520,8 @@ public interface KeyInput extends Input {
*/
public static final int KEY_DELETE = 0xD3;
public static final int KEY_LMETA = 0xDB; /* Left Windows/Option key */
/**
* The left windows key, mapped to KEY_LMETA
*
* @Deprecated Use KEY_LMETA instead
*/
public static final int KEY_LWIN = KEY_LMETA; /* Left Windows key */
public static final int KEY_RMETA = 0xDC; /* Right Windows/Option key */
/**
* The right windows key, mapped to KEY_RMETA
*
* @Deprecated Use KEY_RMETA instead
*/
public static final int KEY_RWIN = KEY_RMETA; /* Right Windows key */
public static final int KEY_APPS = 0xDD;
/**
* power key.

@ -373,13 +373,7 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
// }
}
/**
*
* @param name
* @deprecated use clearParam instead
*/
@Deprecated
public void clearTextureParam(String name) {
private void clearTextureParam(String name) {
name = checkSetParam(null, name);
MatParamTexture val = getTextureParam(name);

@ -1000,25 +1000,6 @@ public final class Matrix3f implements Savable, Cloneable {
return this;
}
/**
* <code>add</code> adds the values of a parameter matrix to this matrix.
*
* @param mat
* the matrix to add to this.
*/
@Deprecated
public void add(Matrix3f mat) {
m00 += mat.m00;
m01 += mat.m01;
m02 += mat.m02;
m10 += mat.m10;
m11 += mat.m11;
m12 += mat.m12;
m20 += mat.m20;
m21 += mat.m21;
m22 += mat.m22;
}
/**
* <code>transpose</code> <b>locally</b> transposes this Matrix.
* This is inconsistent with general value vs local semantics, but is

@ -48,14 +48,6 @@ import java.io.IOException;
*/
public final class Transform implements Savable, Cloneable {
/**
*
* @deprecated To follow with the standard for constants,
* which should be all upper case. Use {@link Transform#IDENTITY} instead.
*/
@Deprecated
public static final Transform Identity = new Transform();
public static final Transform IDENTITY = new Transform();
private Quaternion rot = new Quaternion();

@ -242,20 +242,6 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
}
}
/**
* Enable or disable a filter
* @param filter the filter
* @param enabled true to enable
* @deprecated use filter.setEnabled(boolean enabled) instead
*/
@Deprecated
public void setFilterEnabled(Filter filter, boolean enabled) {
if (filters.contains(filter)) {
filter.enabled = enabled;
updateLastFilterIndex();
}
}
protected void setFilterState(Filter filter, boolean enabled) {
if (filters.contains(filter)) {
filter.enabled = enabled;
@ -274,15 +260,6 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
}
/**
* return tru if the filter is enabled
* @param filter
* @return
*/
public boolean isFilterEnabled(Filter filter) {
return filter.isEnabled();
}
public void cleanup() {
if (viewPort != null) {
viewPort.setOutputFrameBuffer(outputBuffer);

@ -362,8 +362,6 @@ public class RenderManager {
case FrameRate:
u.setValue(VarType.Float, timer.getFrameRate());
break;
case AmbientLightColor:
break;
}
}

@ -51,26 +51,6 @@ public class CameraNode extends Node {
public CameraNode() {
}
/**
*
* @param camera
* @deprecated Use the constructors that take a name
*/
@Deprecated
public CameraNode(Camera camera) {
this("defCamNodeName", camera);
}
/**
*
* @param control
* @deprecated Use the constructors that take a name
*/
@Deprecated
public CameraNode(CameraControl control) {
this("defCamNodeName", control);
}
public CameraNode(String name, Camera camera) {
this(name, new CameraControl(camera));
}

@ -453,28 +453,6 @@ public class Mesh implements Savable, Cloneable {
return vertCount;
}
/**
*
* @param count
* @deprecated Use {@link Mesh#updateCounts() } to update the counts after
* updating the buffers.
*/
@Deprecated
public void setTriangleCount(int count){
throw new UnsupportedOperationException("Deprecated");
}
/**
*
* @param count
* @deprecated Use {@link Mesh#updateCounts() } to update the counts after
* updating the buffers.
*/
@Deprecated
public void setVertexCount(int count){
throw new UnsupportedOperationException("Deprecated");
}
public void getTriangle(int index, Vector3f v1, Vector3f v2, Vector3f v3){
VertexBuffer pb = getBuffer(Type.Position);
VertexBuffer ib = getBuffer(Type.Index);

@ -475,22 +475,6 @@ public class Node extends Spatial implements Savable {
return children;
}
/**
* Dead code
*
* @param geometry
* @param index1
* @param index2
* @deprecated Dead code
*/
@Deprecated
public void childChange(Geometry geometry, int index1, int index2) {
//just pass to parent
if(parent != null) {
parent.childChange(geometry, index1, index2);
}
}
@Override
public void setMaterial(Material mat){
for (int i = 0; i < children.size(); i++){

@ -1220,7 +1220,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable {
capsule.write(cullHint, "cull_mode", CullHint.Inherit);
capsule.write(queueBucket, "queue", RenderQueue.Bucket.Inherit);
capsule.write(shadowMode, "shadow_mode", ShadowMode.Inherit);
capsule.write(localTransform, "transform", Transform.Identity);
capsule.write(localTransform, "transform", Transform.IDENTITY);
capsule.write(localLights, "lights", null);
capsule.writeSavableArrayList(controls, "controlsList", null);
capsule.writeStringSavableMap(userData, "user_data", null);

@ -67,14 +67,8 @@ public class LodControl extends AbstractControl implements Cloneable {
private int[] numTris;
/**
*
* @param geom
* @deprecated Use {@link LodControl#LodControl() }
* Serialization only. Do not use.
*/
@Deprecated
public LodControl(Geometry geom){
}
public LodControl(){
}

@ -161,13 +161,4 @@ public enum UniformBinding {
* Type: float
*/
FrameRate,
/**
* AmbientLightColor.
* The sum of all the colors in the LightList with type
* {@link AmbientLight}.
* Type: vec4
*/
@Deprecated
AmbientLightColor;
}

@ -407,26 +407,6 @@ public abstract class Texture implements Asset, Savable, Cloneable {
public AssetKey getKey(){
return this.key;
}
/**
*
* @param key
* @deprecated Use {@link Texture#setKey(com.jme3.asset.AssetKey) }
*/
@Deprecated
public void setTextureKey(TextureKey key){
this.key = key;
}
/**
*
* @return
* @deprecated Use {@link Texture#getKey() }
*/
@Deprecated
public TextureKey getTextureKey(){
return key;
}
/**
* <code>getImage</code> returns the image data that makes up this

@ -22,11 +22,17 @@ public class SkyFactory {
sky.setCullHint(Spatial.CullHint.Never);
Material skyMat = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");
skyMat.setTexture("Texture", texture);
skyMat.setVector3("NormalScale", normalScale);
if (sphereMap){
skyMat.setBoolean("SphereMap", sphereMap);
}else if (!(texture instanceof TextureCubeMap)){
// make sure its a cubemap
Image img = texture.getImage();
texture = new TextureCubeMap();
texture.setImage(img);
}
skyMat.setTexture("Texture", texture);
sky.setMaterial(skyMat);
return sky;

@ -88,12 +88,12 @@ public class FadeFilter extends Filter {
if (direction > 0 && value > 1) {
value = 1;
playing = false;
processor.setFilterEnabled(this, false);
setEnabled(false);
}
if (direction < 0 && value < 0) {
value = 0;
playing = false;
processor.setFilterEnabled(this, false);
setEnabled(false);
}
}
}
@ -107,13 +107,13 @@ public class FadeFilter extends Filter {
}
public void fadeIn() {
processor.setFilterEnabled(this, true);
setEnabled(true);
direction = 1;
playing = true;
}
public void fadeOut() {
processor.setFilterEnabled(this, true);
setEnabled(true);
direction = -1;
playing = true;

@ -1,68 +0,0 @@
/*
* 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.
*/
package com.jme3.app;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.PhysicsSpace;
import com.jme3.bullet.PhysicsTickListener;
/**
*
* @author normenhansen
* @deprecated in favor of using BulletAppState:<br/>
* <code>stateManager.attach(new BulletAppState());</code>
*/
@Deprecated
public abstract class SimpleBulletApplication extends SimpleApplication implements PhysicsTickListener{
BulletAppState bulletAppState;
@Override
public void initialize() {
bulletAppState=new BulletAppState();
bulletAppState.startPhysics();
super.initialize();
stateManager.attach(bulletAppState);
getPhysicsSpace().addTickListener(this);
}
public void simplePhysicsUpdate(float tpf){
}
public void physicsTick(PhysicsSpace space, float f) {
simplePhysicsUpdate(f);
}
public PhysicsSpace getPhysicsSpace(){
return bulletAppState.getPhysicsSpace();
}
}

@ -128,9 +128,9 @@ public class BulletAppState implements AppState, PhysicsTickListener {
//start physics thread(pool)
if (threadingType == ThreadingType.PARALLEL) {
startPhysicsOnExecutor();
} else if (threadingType == ThreadingType.DETACHED) {
startPhysicsOnExecutor();
executor.submit(detachedPhysicsUpdate);
// } else if (threadingType == ThreadingType.DETACHED) {
// startPhysicsOnExecutor();
// executor.submit(detachedPhysicsUpdate);
} else {
pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType);
}
@ -148,22 +148,6 @@ public class BulletAppState implements AppState, PhysicsTickListener {
public boolean isInitialized() {
return initialized;
}
/**
* Use setEnabled() instead
*/
@Deprecated
public void setActive(boolean active) {
setEnabled(active);
}
/**
* Use isEnabled() instead
*/
@Deprecated
public boolean isActive() {
return isEnabled();
}
public void setEnabled(boolean enabled) {
this.active = enabled;
@ -189,9 +173,9 @@ public class BulletAppState implements AppState, PhysicsTickListener {
if (!active) {
return;
}
if (threadingType != ThreadingType.DETACHED) {
// if (threadingType != ThreadingType.DETACHED) {
pSpace.distributeEvents();
}
// }
this.tpf = tpf;
}
@ -290,14 +274,5 @@ public class BulletAppState implements AppState, PhysicsTickListener {
* Multiple BulletAppStates will execute in parallel in this mode.
*/
PARALLEL,
/**
* Detached threaded mode; each physics space executes independently on another thread,
* only location and rotation is transferred thread safe,
* <b>all</b> other physics operations including adding and removing of objects to the physics space
* have to be done from the physics thread. (Creation of objects is safe on any thread except for vehicle)
* @deprecated since native bullet will be parallelized at the time physics is moved to native
*/
@Deprecated
DETACHED
}
}

@ -765,23 +765,6 @@ public class PhysicsSpace {
this.broadphaseType = broadphaseType;
}
/**
* Sets the deterministic mode of this physics space.
* If the physicsSpace is deterministic, low fps values will
* be compensated by stepping the physics space multiple times per frame.
* If not, low fps values will make the physics inaccurate. Default is false.
* @param deterministic
* @deprecated in favor of PhysicsSpace.setMaxSubSteps
*/
@Deprecated
public void setDeterministic(boolean deterministic) {
if (!deterministic) {
maxSubSteps = 1;
} else {
maxSubSteps = 4;
}
}
/**
* Sets the maximum amount of extra steps that will be used to step the physics
* when the fps is below the physics fps. Doing this maintains determinism in physics.

@ -163,10 +163,8 @@ public abstract class PhysicsCollisionObject implements Savable {
* Creates a visual debug shape of the current collision shape of this physics object<br/>
* <b>Does not work with detached physics, please switch to PARALLEL or SEQUENTIAL for debugging</b>
* @param manager AssetManager to load the default wireframe material for the debug shape
* @deprecated in favor of PhysicsSpace.enableDebug(AssetManager manager);
*/
@Deprecated
public Spatial attachDebugShape(AssetManager manager) {
protected Spatial attachDebugShape(AssetManager manager) {
debugMaterialBlue = new Material(manager, "Common/MatDefs/Misc/WireColor.j3md");
debugMaterialBlue.setColor("Color", ColorRGBA.Blue);
// debugMaterialBlue.getAdditionalRenderState().setDepthTest(false);
@ -185,11 +183,7 @@ public abstract class PhysicsCollisionObject implements Savable {
return attachDebugShape();
}
/**
* @deprecated in favor of PhysicsSpace.enableDebug(AssetManager manager);
*/
@Deprecated
public Spatial attachDebugShape(Material material) {
protected Spatial attachDebugShape(Material material) {
debugMaterialBlue = material;
debugMaterialGreen = material;
debugMaterialRed = material;

@ -127,7 +127,7 @@ public class TestVideoPlayer extends SimpleApplication {
public void simpleUpdate(float tpf){
if (source == null){
if (decoder.getAudioStream() != null){
source = new AudioNode(decoder.getAudioStream(), null);
source = new AudioNode(audioRenderer, decoder.getAudioStream(), null);
source.setPositional(false);
source.setReverbEnabled(false);
audioRenderer.playSource(source);

@ -740,7 +740,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
if (stopped){
// became inactive
src.setStatus(Status.Stopped);
src.setChannel(null, -1);
src.setChannel(-1);
clearChannel(i);
freeChannel(i);
}
@ -754,7 +754,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
if (stopped){
if (boundSource){
src.setStatus(Status.Stopped);
src.setChannel(null, -1);
src.setChannel(-1);
}
clearChannel(i);
freeChannel(i);
@ -853,7 +853,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
return;
}
clearChannel(index);
src.setChannel(this, index);
src.setChannel(index);
AudioData data = src.getAudioData();
if (data.isUpdateNeeded())
@ -908,7 +908,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
assert chan != -1; // if it's not stopped, must have id
src.setStatus(Status.Stopped);
src.setChannel(null, -1);
src.setChannel(-1);
clearChannel(chan);
freeChannel(chan);
}

@ -41,6 +41,7 @@ import com.jme3.renderer.lwjgl.LwjglRenderer;
import com.jme3.system.AppSettings;
import com.jme3.system.SystemListener;
import com.jme3.system.JmeContext;
import com.jme3.system.NullRenderer;
import com.jme3.system.Timer;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
@ -116,6 +117,12 @@ public abstract class LwjglContext implements JmeContext {
protected void initContextFirstTime(){
assert renderable.get();
if (GLContext.getCapabilities().OpenGL20){
renderer = new LwjglRenderer();
}else{
renderer = new LwjglGL1Renderer();
}
// Init renderer
if (renderer instanceof LwjglRenderer){
((LwjglRenderer)renderer).initialize();
@ -148,22 +155,25 @@ public abstract class LwjglContext implements JmeContext {
public void internalCreate(){
timer = new LwjglTimer();
if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL2)
|| settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)){
renderer = new LwjglRenderer();
}else if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL1)){
renderer = new LwjglGL1Renderer();
}else{
throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer());
}
// if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL2)
// || settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)){
// renderer = new LwjglRenderer();
// }else if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL1)){
// renderer = new LwjglGL1Renderer();
// }else{
// throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer());
// }
synchronized (createdLock){
created.set(true);
createdLock.notifyAll();
}
if (renderable.get())
if (renderable.get()){
initContextFirstTime();
else
}else{
assert getType() == Type.Canvas;
}
}
public void create(){

@ -50,7 +50,7 @@ public class SoundDeviceJme implements SoundDevice {
}
public SoundHandle loadSound(SoundSystem soundSystem, String filename) {
AudioNode an = new AudioNode(assetManager, filename, false);
AudioNode an = new AudioNode(ar, assetManager, filename, false);
an.setPositional(false);
return new SoundHandleJme(ar, an);
}

@ -78,7 +78,7 @@ public class SoundHandleJme implements SoundHandle {
ar.stopSource(node);
}
node = new AudioNode(am, fileName, true);
node = new AudioNode(ar, am, fileName, true);
node.setPositional(false);
node.setVolume(volume);
ar.playSource(node);

@ -35,11 +35,8 @@ package com.jme3.terrain.geomipmap;
import com.jme3.bounding.BoundingBox;
import com.jme3.bounding.BoundingSphere;
import com.jme3.bounding.BoundingVolume;
import com.jme3.bounding.Intersection;
import com.jme3.collision.Collidable;
import com.jme3.collision.CollisionResult;
import com.jme3.collision.CollisionResults;
import com.jme3.collision.SweepSphere;
import com.jme3.collision.UnsupportedCollisionException;
import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;

@ -44,6 +44,7 @@ import com.jme3.input.controls.KeyTrigger;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Spline.SplineType;
import com.jme3.math.Vector3f;
import com.jme3.scene.CameraNode;
import com.jme3.scene.Geometry;
@ -70,10 +71,9 @@ public class TestCameraMotionPath extends SimpleApplication {
public void simpleInitApp() {
createScene();
cam.setLocation(new Vector3f(8.4399185f, 11.189463f, 14.267577f));
camNode = new CameraNode(cam);
camNode = new CameraNode("Motion cam", cam);
camNode.setControlDir(ControlDirection.SpatialToCamera);
camNode.getControl(0).setEnabled(false);
camNode.setName("Motion cam");
path = new MotionPath();
path.setCycle(true);
path.addWayPoint(new Vector3f(20, 3, 0));
@ -180,10 +180,10 @@ public class TestCameraMotionPath extends SimpleApplication {
}
if (name.equals("SwitchPathInterpolation") && keyPressed) {
if (path.getPathInterpolation() == MotionPath.PathInterpolation.CatmullRom) {
path.setPathInterpolation(MotionPath.PathInterpolation.Linear);
if (path.getPathSplineType() == SplineType.CatmullRom){
path.setPathSplineType(SplineType.Linear);
} else {
path.setPathInterpolation(MotionPath.PathInterpolation.CatmullRom);
path.setPathSplineType(SplineType.CatmullRom);
}
}

@ -45,11 +45,11 @@ import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
import com.jme3.math.Quaternion;
import com.jme3.math.Spline.SplineType;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Line;
public class TestMotionPath extends SimpleApplication {
@ -170,10 +170,10 @@ public class TestMotionPath extends SimpleApplication {
}
if (name.equals("SwitchPathInterpolation") && keyPressed) {
if (path.getPathInterpolation() == MotionPath.PathInterpolation.CatmullRom) {
path.setPathInterpolation(MotionPath.PathInterpolation.Linear);
if (path.getPathSplineType() == SplineType.CatmullRom){
path.setPathSplineType(SplineType.Linear);
} else {
path.setPathInterpolation(MotionPath.PathInterpolation.CatmullRom);
path.setPathSplineType(SplineType.CatmullRom);
}
}

@ -51,10 +51,10 @@ public class TestAmbient extends AudioApp {
@Override
public void initAudioApp(){
waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", false);
waves = new AudioNode(audioRenderer, assetManager, "Sound/Environment/Ocean Waves.ogg", false);
waves.setPositional(true);
nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", true);
nature = new AudioNode(audioRenderer, assetManager, "Sound/Environment/Nature.ogg", true);
// river = new AudioSource(manager, "sounds/river.ogg");
// float[] eax = new float[]

@ -52,7 +52,7 @@ public class TestDoppler extends AudioApp {
@Override
public void initAudioApp(){
ufo = new AudioNode(assetManager, "Sound/Effects/Beep.ogg", false);
ufo = new AudioNode(audioRenderer, assetManager, "Sound/Effects/Beep.ogg", false);
ufo.setPositional(true);
ufo.setLooping(true);
audioRenderer.playSource(ufo);

@ -197,7 +197,7 @@ public class TestMusicPlayer extends javax.swing.JFrame {
ex.printStackTrace();
}
musicSource = new AudioNode(musicData, key);
musicSource = new AudioNode(ar, musicData, key);
musicLength = musicData.getDuration();
updateTime();
}

@ -47,7 +47,7 @@ public class TestOgg extends AudioApp {
@Override
public void initAudioApp(){
System.out.println("Playing without filter");
src = new AudioNode(assetManager, "Sound/Effects/Foot steps.ogg", true);
src = new AudioNode(audioRenderer, assetManager, "Sound/Effects/Foot steps.ogg", true);
audioRenderer.playSource(src);
}
@ -57,7 +57,7 @@ public class TestOgg extends AudioApp {
audioRenderer.deleteAudioData(src.getAudioData());
System.out.println("Playing with low pass filter");
src = new AudioNode(assetManager, "Sound/Effects/Foot steps.ogg", true);
src = new AudioNode(audioRenderer, assetManager, "Sound/Effects/Foot steps.ogg", true);
src.setDryFilter(new LowPassFilter(1f, .1f));
src.setVolume(3);
audioRenderer.playSource(src);

@ -51,7 +51,7 @@ public class TestReverb extends AudioApp {
@Override
public void initAudioApp(){
src = new AudioNode(assetManager, "Sound/Effects/Bang.wav");
src = new AudioNode(audioRenderer, assetManager, "Sound/Effects/Bang.wav");
float[] eax = new float[]
{15, 38.0f, 0.300f, -1000, -3300, 0, 1.49f, 0.54f, 1.00f, -2560, 0.162f, 0.00f,0.00f,0.00f, -229, 0.088f, 0.00f,0.00f,0.00f, 0.125f, 1.000f, 0.250f, 0.000f, -5.0f, 5000.0f, 250.0f, 0.00f, 0x3f }

@ -63,7 +63,7 @@ public class TestWav extends AudioApp {
@Override
public void initAudioApp(){
src = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false);
src = new AudioNode(audioRenderer, assetManager, "Sound/Effects/Gun.wav", false);
src.setLooping(false);
}

@ -1,173 +0,0 @@
/*
* 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.
*/
package jme3test.collision;
import com.jme3.collision.CollisionResult;
import com.jme3.collision.CollisionResults;
import com.jme3.collision.MotionAllowedListener;
import com.jme3.collision.SweepSphere;
import com.jme3.math.Plane;
import com.jme3.math.Ray;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;
public class SphereMotionAllowedListener implements MotionAllowedListener {
private Ray ray = new Ray();
private SweepSphere ss = new SweepSphere();
private CollisionResults results = new CollisionResults();
private Spatial scene;
private Vector3f dimension = new Vector3f();
private Vector3f newPos = new Vector3f();
private Vector3f newVel = new Vector3f();
private float charHeight;
private float footHeight;
private float footStart;
private float sphHeight;
private float sphCenter;
final float unitsPerMeter = 100.0f;
final float unitScale = unitsPerMeter / 100.0f;
final float veryCloseDist = 0.005f * unitScale;
private int depth = 0;
public SphereMotionAllowedListener(Spatial scene, Vector3f dimension){
if (scene == null || dimension == null)
throw new NullPointerException();
this.scene = scene;
charHeight = dimension.getY();
footHeight = charHeight / 3f;
footStart = -(charHeight / 2f) + footHeight;
sphHeight = charHeight - footHeight;
sphCenter = (charHeight / 2f) - (sphHeight / 2f);
this.dimension.set(dimension);
this.dimension.setY(sphHeight);
}
private void collideWithWorld(){
if (depth > 3){
// System.out.println("DEPTH LIMIT REACHED!!");
return;
}
if (newVel.length() < veryCloseDist)
return;
Vector3f destination = newPos.add(0, sphCenter, 0).add(newVel);
ss.setCenter(newPos.add(0, sphCenter, 0));
ss.setVelocity(newVel);
ss.setDimension(dimension);
results.clear();
scene.collideWith(ss, results);
if (results.size() == 0){
newPos.addLocal(newVel);
return;
}
for (int i = 0; i < results.size(); i++){
CollisionResult collision = results.getCollision(i);
// *** collision occured ***
// Vector3f destination = newPos.add(newVel);
Vector3f contactPoint = collision.getContactPoint().clone();
float dist = collision.getDistance();
if (dist >= veryCloseDist){
// P += ||V|| * dist
Vector3f tmp = new Vector3f(newVel);
tmp.normalizeLocal().multLocal(dist - veryCloseDist);
newPos.addLocal(tmp);
tmp.normalizeLocal();
tmp.multLocal(veryCloseDist);
contactPoint.subtractLocal(tmp);
}
// Vector3f normal = newPos.subtract(contactPoint).normalizeLocal();
Vector3f normal = collision.getContactNormal();
Plane p = new Plane();
p.setOriginNormal(contactPoint, normal);
Vector3f destinationOnPlane = p.getClosestPoint(destination);
newVel.set(destinationOnPlane).subtractLocal(contactPoint);
// normal.multLocal(normal.dot(destination) - veryCloseDist);
//// normal.multLocal(p.pseudoDistance(destination));
// Vector3f newDest = destination.add(normal);
// newVel.set(newDest).subtractLocal(contactPoint);
// recurse:
if (newVel.length() < veryCloseDist){
return;
}
}
depth = depth + 1;
collideWithWorld();
}
public void checkMotionAllowed(Vector3f position, Vector3f velocity) {
if (velocity.getX() == 0 && velocity.getZ() == 0)
return;
depth = 0;
newPos.set(position);
newVel.set(velocity);
velocity.setY(0);
// newPos.addLocal(velocity);
collideWithWorld();
ray.setOrigin(newPos.add(0, footStart, 0));
ray.setDirection(new Vector3f(0, -1, 0));
// ray.setLimit(footHeight);
results.clear();
scene.collideWith(ray, results);
CollisionResult result = results.getClosestCollision();
if (result != null){
newPos.y = result.getContactPoint().getY() + charHeight / 2f;
}
position.set(newPos);
}
}

@ -245,9 +245,8 @@ public class TestExplosionEffect extends SimpleApplication {
}
@Override
public void simpleUpdate(float tpf){
public void simpleUpdate(float tpf){
time += tpf / speed;
// speed = 0.02f;
if (time > 1f && state == 0){
flash.emitAllParticles();
spark.emitAllParticles();

@ -59,10 +59,10 @@ public class TestMovingParticle extends SimpleApplication {
public void simpleInitApp() {
emit = new ParticleEmitter("Emitter", Type.Triangle, 200);
emit.setGravity(0);
emit.setVariation(1);
emit.setVelocityVariation(1);
emit.setLowLife(1);
emit.setHighLife(1);
emit.setStartVel(new Vector3f(0, .5f, 0));
emit.setInitialVelocity(new Vector3f(0, .5f, 0));
emit.setImagesX(15);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));

@ -37,6 +37,7 @@ import net.java.games.input.RawInputEnvironmentPlugin;
import com.jme3.app.SimpleApplication;
import com.jme3.font.BitmapFont;
import com.jme3.font.BitmapText;
import com.jme3.font.LineWrapMode;
import com.jme3.font.Rectangle;
import com.jme3.input.KeyInput;
import com.jme3.input.RawInputListener;
@ -93,7 +94,8 @@ public class TestBitmapFont extends SimpleApplication {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
if (name.equals("WordWrap") && !isPressed) {
txt.setWordWrap(!txt.isWordWrap());
txt.setLineWrapMode( txt.getLineWrapMode() == LineWrapMode.Word ?
LineWrapMode.NoWrap : LineWrapMode.Word );
}
}
};

@ -42,12 +42,12 @@ public class HelloAudio extends SimpleApplication {
/** We create two audio nodes. */
private void initAudio() {
/* gun shot sound is to be triggered by a mouse click. */
audio_gun = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false);
audio_gun = new AudioNode(audioRenderer, assetManager, "Sound/Effects/Gun.wav", false);
audio_gun.setLooping(false);
audio_gun.setVolume(2);
/* nature sound - keeps playing in a loop. */
audio_nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", false);
audio_nature = new AudioNode(audioRenderer, assetManager, "Sound/Environment/Nature.ogg", false);
audio_nature.setLooping(true);
audio_nature.setPositional(true);
audio_nature.setLocalTranslation(Vector3f.ZERO.clone());

@ -45,7 +45,7 @@ import com.jme3.scene.shape.Torus;
public class TestLightRadius extends SimpleApplication {
float angle;
float pos, vel=1;
PointLight pl;
Geometry lightMdl;
@ -95,10 +95,14 @@ public class TestLightRadius extends SimpleApplication {
// cam.setLocation(new Vector3f(5.0347548f, 6.6481347f, 3.74853f));
// cam.setRotation(new Quaternion(-0.19183293f, 0.80776674f, -0.37974006f, -0.40805697f));
angle += tpf;
angle %= FastMath.TWO_PI;
pl.setPosition(new Vector3f(FastMath.cos(angle) * 3f, 2, FastMath.sin(angle) * 3f));
pos += tpf * vel * 5f;
if (pos > 15){
vel *= -1;
}else if (pos < -15){
vel *= -1;
}
pl.setPosition(new Vector3f(pos, 2, 0));
lightMdl.setLocalTranslation(pl.getPosition());
}

@ -35,6 +35,7 @@ import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.HttpZipLocator;
import com.jme3.asset.plugins.ZipLocator;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
@ -111,35 +112,36 @@ public class TestMultiplesFilters extends SimpleApplication {
viewPort.addProcessor(fpp);
rootNode.attachChild(scene);
inputManager.addListener(new com.jme3.input.controls.ActionListener() {
inputManager.addListener(new ActionListener() {
public void onAction(String name, boolean isPressed, float tpf) {
if ("toggleSSAO".equals(name) && isPressed) {
if (fpp.isFilterEnabled(ssaoFilter)) {
fpp.setFilterEnabled(ssaoFilter, false);
if (ssaoFilter.isEnabled()) {
ssaoFilter.setEnabled(false);
} else {
fpp.setFilterEnabled(ssaoFilter, true);
ssaoFilter.setEnabled(true);
}
}
if ("toggleWater".equals(name) && isPressed) {
if (fpp.isFilterEnabled(water)) {
fpp.setFilterEnabled(water, false);
if (water.isEnabled()) {
water.setEnabled(false);
} else {
fpp.setFilterEnabled(water, true);
water.setEnabled(true);
}
}
if ("toggleBloom".equals(name) && isPressed) {
if (fpp.isFilterEnabled(bloom)) {
fpp.setFilterEnabled(bloom, false);
if (bloom.isEnabled()) {
bloom.setEnabled(false);
} else {
fpp.setFilterEnabled(bloom, true);
bloom.setEnabled(true);
}
}
if ("toggleOverlay".equals(name) && isPressed) {
if (fpp.isFilterEnabled(overlay)) {
fpp.setFilterEnabled(overlay, false);
if (overlay.isEnabled()) {
overlay.setEnabled(false);
} else {
fpp.setFilterEnabled(overlay, true);
overlay.setEnabled(true);
}
}
}

@ -76,7 +76,7 @@ public class TestPostWater extends SimpleApplication {
mainScene.attachChild(sky);
cam.setFrustumFar(4000);
//cam.setFrustumNear(100);
AudioNode waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", false);
AudioNode waves = new AudioNode(audioRenderer, assetManager, "Sound/Environment/Ocean Waves.ogg", false);
waves.setLooping(true);
audioRenderer.playSource(waves);

@ -83,11 +83,13 @@ public class GeometryBatchFactory {
int totalVerts = 0;
int totalTris = 0;
int totalLodLevels = 0;
Mode mode = null;
for (Geometry geom : geometries){
totalVerts += geom.getVertexCount();
totalTris += geom.getTriangleCount();
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
Mode listMode;
int components;

Loading…
Cancel
Save