* 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
This commit is contained in:
parent
33dac750d7
commit
6196de22f7
@ -3,7 +3,7 @@
|
|||||||
<project name="jME3_ordered" default="default" basedir=".">
|
<project name="jME3_ordered" default="default" basedir=".">
|
||||||
<description>Builds, tests, and runs the project jME3_ordered.</description>
|
<description>Builds, tests, and runs the project jME3_ordered.</description>
|
||||||
<import file="nbproject/build-impl.xml"/>
|
<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-->
|
<!--this target creates the assets jar file and modifies the classpath to include it-->
|
||||||
|
@ -81,7 +81,14 @@ is divided into following sections:
|
|||||||
</target>
|
</target>
|
||||||
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
|
<target depends="-pre-init,-init-private,-init-libraries,-init-user,-init-project,-init-macrodef-property" name="-do-init">
|
||||||
<available file="${manifest.file}" property="manifest.available"/>
|
<available file="${manifest.file}" property="manifest.available"/>
|
||||||
<available file="${application.splash}" property="splashscreen.available"/>
|
<condition property="splashscreen.available">
|
||||||
|
<and>
|
||||||
|
<not>
|
||||||
|
<equals arg1="${application.splash}" arg2="" trim="true"/>
|
||||||
|
</not>
|
||||||
|
<available file="${application.splash}"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
<condition property="main.class.available">
|
<condition property="main.class.available">
|
||||||
<and>
|
<and>
|
||||||
<isset property="main.class"/>
|
<isset property="main.class"/>
|
||||||
@ -96,8 +103,14 @@ is divided into following sections:
|
|||||||
<isset property="main.class.available"/>
|
<isset property="main.class.available"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
|
<condition property="do.archive">
|
||||||
|
<not>
|
||||||
|
<istrue value="${jar.archive.disabled}"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
<condition property="do.mkdist">
|
<condition property="do.mkdist">
|
||||||
<and>
|
<and>
|
||||||
|
<isset property="do.archive"/>
|
||||||
<isset property="libs.CopyLibs.classpath"/>
|
<isset property="libs.CopyLibs.classpath"/>
|
||||||
<not>
|
<not>
|
||||||
<istrue value="${mkdist.disabled}"/>
|
<istrue value="${mkdist.disabled}"/>
|
||||||
@ -110,40 +123,41 @@ is divided into following sections:
|
|||||||
<isset property="do.mkdist"/>
|
<isset property="do.mkdist"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="manifest.available+main.class+mkdist.available+splashscreen.available">
|
|
||||||
<and>
|
|
||||||
<istrue value="${manifest.available+main.class+mkdist.available}"/>
|
|
||||||
<istrue value="${splashscreen.available}"/>
|
|
||||||
</and>
|
|
||||||
</condition>
|
|
||||||
<condition property="do.archive">
|
|
||||||
<not>
|
|
||||||
<istrue value="${jar.archive.disabled}"/>
|
|
||||||
</not>
|
|
||||||
</condition>
|
|
||||||
<condition property="do.archive+manifest.available">
|
<condition property="do.archive+manifest.available">
|
||||||
<and>
|
<and>
|
||||||
<isset property="manifest.available"/>
|
<isset property="manifest.available"/>
|
||||||
<istrue value="${do.archive}"/>
|
<istrue value="${do.archive}"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
|
<condition property="do.archive+main.class.available">
|
||||||
|
<and>
|
||||||
|
<isset property="main.class.available"/>
|
||||||
|
<istrue value="${do.archive}"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<condition property="do.archive+splashscreen.available">
|
||||||
|
<and>
|
||||||
|
<isset property="splashscreen.available"/>
|
||||||
|
<istrue value="${do.archive}"/>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
<condition property="do.archive+manifest.available+main.class">
|
<condition property="do.archive+manifest.available+main.class">
|
||||||
<and>
|
<and>
|
||||||
<istrue value="${manifest.available+main.class}"/>
|
<istrue value="${manifest.available+main.class}"/>
|
||||||
<istrue value="${do.archive}"/>
|
<istrue value="${do.archive}"/>
|
||||||
</and>
|
</and>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="do.archive+manifest.available+main.class+mkdist.available">
|
<condition property="manifest.available-mkdist.available">
|
||||||
<and>
|
<or>
|
||||||
<istrue value="${manifest.available+main.class+mkdist.available}"/>
|
<istrue value="${manifest.available}"/>
|
||||||
<istrue value="${do.archive}"/>
|
<isset property="do.mkdist"/>
|
||||||
</and>
|
</or>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available">
|
<condition property="manifest.available+main.class-mkdist.available">
|
||||||
<and>
|
<or>
|
||||||
<istrue value="${manifest.available+main.class+mkdist.available+splashscreen.available}"/>
|
<istrue value="${manifest.available+main.class}"/>
|
||||||
<istrue value="${do.archive}"/>
|
<isset property="do.mkdist"/>
|
||||||
</and>
|
</or>
|
||||||
</condition>
|
</condition>
|
||||||
<condition property="have.tests">
|
<condition property="have.tests">
|
||||||
<or>
|
<or>
|
||||||
@ -217,8 +231,17 @@ is divided into following sections:
|
|||||||
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
|
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
|
||||||
<length length="0" string="${endorsed.classpath}" when="greater"/>
|
<length length="0" string="${endorsed.classpath}" when="greater"/>
|
||||||
</condition>
|
</condition>
|
||||||
<property name="javac.fork" value="false"/>
|
<condition else="false" property="jdkBug6558476">
|
||||||
|
<and>
|
||||||
|
<matches pattern="1\.[56]" string="${java.specification.version}"/>
|
||||||
|
<not>
|
||||||
|
<os family="unix"/>
|
||||||
|
</not>
|
||||||
|
</and>
|
||||||
|
</condition>
|
||||||
|
<property name="javac.fork" value="${jdkBug6558476}"/>
|
||||||
<property name="jar.index" value="false"/>
|
<property name="jar.index" value="false"/>
|
||||||
|
<property name="jar.index.metainf" value="${jar.index}"/>
|
||||||
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
|
<available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
|
||||||
</target>
|
</target>
|
||||||
<target name="-post-init">
|
<target name="-post-init">
|
||||||
@ -364,7 +387,9 @@ is divided into following sections:
|
|||||||
<delete>
|
<delete>
|
||||||
<files includesfile="${javac.includesfile.binary}"/>
|
<files includesfile="${javac.includesfile.binary}"/>
|
||||||
</delete>
|
</delete>
|
||||||
<delete file="${javac.includesfile.binary}"/>
|
<delete>
|
||||||
|
<fileset file="${javac.includesfile.binary}"/>
|
||||||
|
</delete>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
</target>
|
</target>
|
||||||
@ -374,7 +399,8 @@ is divided into following sections:
|
|||||||
<attribute default="${excludes}" name="excludes"/>
|
<attribute default="${excludes}" name="excludes"/>
|
||||||
<attribute default="**" name="testincludes"/>
|
<attribute default="**" name="testincludes"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
|
<property name="junit.forkmode" value="perTest"/>
|
||||||
|
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
|
||||||
<batchtest todir="${build.test.results.dir}">
|
<batchtest todir="${build.test.results.dir}">
|
||||||
<fileset dir="${test.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
|
<fileset dir="${test.test.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
|
||||||
<filename name="@{testincludes}"/>
|
<filename name="@{testincludes}"/>
|
||||||
@ -390,11 +416,56 @@ is divided into following sections:
|
|||||||
<formatter type="brief" usefile="false"/>
|
<formatter type="brief" usefile="false"/>
|
||||||
<formatter type="xml"/>
|
<formatter type="xml"/>
|
||||||
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
||||||
|
<jvmarg value="-ea"/>
|
||||||
<jvmarg line="${run.jvmargs}"/>
|
<jvmarg line="${run.jvmargs}"/>
|
||||||
</junit>
|
</junit>
|
||||||
</sequential>
|
</sequential>
|
||||||
</macrodef>
|
</macrodef>
|
||||||
</target>
|
</target>
|
||||||
|
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" name="profile-init"/>
|
||||||
|
<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 default="${main.class}" name="classname"/>
|
||||||
|
<element name="customize" optional="true"/>
|
||||||
|
<sequential>
|
||||||
|
<property environment="env"/>
|
||||||
|
<resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
|
||||||
|
<java classname="@{classname}" dir="${profiler.info.dir}" fork="true" 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 from="run-sys-prop.*" to="*" type="glob"/>
|
||||||
|
</syspropertyset>
|
||||||
|
<customize/>
|
||||||
|
</java>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
</target>
|
||||||
|
<target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" name="-profile-init-check">
|
||||||
|
<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>
|
||||||
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
|
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
|
||||||
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
|
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
|
||||||
<attribute default="${main.class}" name="name"/>
|
<attribute default="${main.class}" name="name"/>
|
||||||
@ -489,6 +560,7 @@ is divided into following sections:
|
|||||||
</target>
|
</target>
|
||||||
<target name="-init-macrodef-copylibs">
|
<target name="-init-macrodef-copylibs">
|
||||||
<macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
|
<macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
|
||||||
|
<attribute default="${manifest.file}" name="manifest"/>
|
||||||
<element name="customize" optional="true"/>
|
<element name="customize" optional="true"/>
|
||||||
<sequential>
|
<sequential>
|
||||||
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
||||||
@ -504,7 +576,7 @@ is divided into following sections:
|
|||||||
</chainedmapper>
|
</chainedmapper>
|
||||||
</pathconvert>
|
</pathconvert>
|
||||||
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
||||||
<copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
<copylibs compress="${jar.compress}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
||||||
<fileset dir="${build.classes.dir}"/>
|
<fileset dir="${build.classes.dir}"/>
|
||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Class-Path" value="${jar.classpath}"/>
|
<attribute name="Class-Path" value="${jar.classpath}"/>
|
||||||
@ -651,10 +723,10 @@ is divided into following sections:
|
|||||||
<!-- Empty placeholder for easier customization. -->
|
<!-- Empty placeholder for easier customization. -->
|
||||||
<!-- You can override this target in the ../build.xml file. -->
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available">
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
|
||||||
<j2seproject1:jar/>
|
<j2seproject1:jar/>
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class">
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
|
||||||
<j2seproject1:jar manifest="${manifest.file}"/>
|
<j2seproject1:jar manifest="${manifest.file}"/>
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
|
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.archive+manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
|
||||||
@ -663,44 +735,53 @@ is divided into following sections:
|
|||||||
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
|
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
|
||||||
</j2seproject1:manifest>
|
</j2seproject1:manifest>
|
||||||
</j2seproject1:jar>
|
</j2seproject1:jar>
|
||||||
<echo>To run this application from the command line without Ant, try:</echo>
|
<echo level="info">To run this application from the command line without Ant, try:</echo>
|
||||||
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
||||||
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
||||||
<pathconvert property="run.classpath.with.dist.jar">
|
<pathconvert property="run.classpath.with.dist.jar">
|
||||||
<path path="${run.classpath}"/>
|
<path path="${run.classpath}"/>
|
||||||
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
|
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
|
||||||
</pathconvert>
|
</pathconvert>
|
||||||
<echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
|
<echo level="info">java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available+splashscreen.available" name="-do-jar-with-libraries-and-splashscreen">
|
<target depends="init" if="do.archive" name="-do-jar-with-libraries-create-manifest" unless="manifest.available">
|
||||||
|
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
|
||||||
|
<touch file="${tmp.manifest.file}" verbose="false"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init" if="do.archive+manifest.available" name="-do-jar-with-libraries-copy-manifest">
|
||||||
|
<tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
|
||||||
|
<copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+main.class.available" name="-do-jar-with-libraries-set-main">
|
||||||
|
<manifest file="${tmp.manifest.file}" mode="update">
|
||||||
|
<attribute name="Main-Class" value="${main.class}"/>
|
||||||
|
</manifest>
|
||||||
|
</target>
|
||||||
|
<target depends="init,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-with-libraries-set-splashscreen">
|
||||||
<basename file="${application.splash}" property="splashscreen.basename"/>
|
<basename file="${application.splash}" property="splashscreen.basename"/>
|
||||||
<mkdir dir="${build.classes.dir}/META-INF"/>
|
<mkdir dir="${build.classes.dir}/META-INF"/>
|
||||||
<copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
|
<copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
|
||||||
<j2seproject3:copylibs>
|
<manifest file="${tmp.manifest.file}" mode="update">
|
||||||
<customize>
|
<attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
|
||||||
<attribute name="Main-Class" value="${main.class}"/>
|
</manifest>
|
||||||
<attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
|
|
||||||
</customize>
|
|
||||||
</j2seproject3:copylibs>
|
|
||||||
<echo>To run this application from the command line without Ant, try:</echo>
|
|
||||||
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
|
||||||
<echo>java -jar "${dist.jar.resolved}"</echo>
|
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-jar,-pre-jar,-init-macrodef-copylibs" if="do.archive+manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries" unless="splashscreen.available">
|
<target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen" if="do.mkdist" name="-do-jar-with-libraries-pack">
|
||||||
<j2seproject3:copylibs>
|
<j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
|
||||||
<customize>
|
<echo level="info">To run this application from the command line without Ant, try:</echo>
|
||||||
<attribute name="Main-Class" value="${main.class}"/>
|
|
||||||
</customize>
|
|
||||||
</j2seproject3:copylibs>
|
|
||||||
<echo>To run this application from the command line without Ant, try:</echo>
|
|
||||||
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
||||||
<echo>java -jar "${dist.jar.resolved}"</echo>
|
<echo level="info">java -jar "${dist.jar.resolved}"</echo>
|
||||||
</target>
|
</target>
|
||||||
|
<target depends="-do-jar-with-libraries-pack" if="do.archive" name="-do-jar-with-libraries-delete-manifest">
|
||||||
|
<delete>
|
||||||
|
<fileset file="${tmp.manifest.file}"/>
|
||||||
|
</delete>
|
||||||
|
</target>
|
||||||
|
<target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-with-libraries-create-manifest,-do-jar-with-libraries-copy-manifest,-do-jar-with-libraries-set-main,-do-jar-with-libraries-set-splashscreen,-do-jar-with-libraries-pack,-do-jar-with-libraries-delete-manifest" name="-do-jar-with-libraries"/>
|
||||||
<target name="-post-jar">
|
<target name="-post-jar">
|
||||||
<!-- Empty placeholder for easier customization. -->
|
<!-- Empty placeholder for easier customization. -->
|
||||||
<!-- You can override this target in the ../build.xml file. -->
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries-and-splashscreen,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
|
<target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>
|
||||||
<!--
|
<!--
|
||||||
=================
|
=================
|
||||||
EXECUTION SECTION
|
EXECUTION SECTION
|
||||||
@ -765,6 +846,72 @@ is divided into following sections:
|
|||||||
<j2seproject1:nbjpdareload/>
|
<j2seproject1:nbjpdareload/>
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
|
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
|
||||||
|
<!--
|
||||||
|
=================
|
||||||
|
PROFILING SECTION
|
||||||
|
=================
|
||||||
|
-->
|
||||||
|
<target depends="profile-init,compile" description="Profile a project in the IDE." if="netbeans.home" name="profile">
|
||||||
|
<nbprofiledirect>
|
||||||
|
<classpath>
|
||||||
|
<path path="${run.classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
</nbprofiledirect>
|
||||||
|
<profile/>
|
||||||
|
</target>
|
||||||
|
<target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="netbeans.home" name="profile-single">
|
||||||
|
<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 depends="profile-init,compile-single" if="netbeans.home" name="profile-applet">
|
||||||
|
<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 depends="profile-init,compile-test-single" if="netbeans.home" name="profile-test-single">
|
||||||
|
<nbprofiledirect>
|
||||||
|
<classpath>
|
||||||
|
<path path="${run.test.classpath}"/>
|
||||||
|
</classpath>
|
||||||
|
</nbprofiledirect>
|
||||||
|
<junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
|
||||||
|
<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 from="test-sys-prop.*" to="*" type="glob"/>
|
||||||
|
</syspropertyset>
|
||||||
|
<formatter type="brief" usefile="false"/>
|
||||||
|
<formatter type="xml"/>
|
||||||
|
</junit>
|
||||||
|
</target>
|
||||||
<!--
|
<!--
|
||||||
===============
|
===============
|
||||||
JAVADOC SECTION
|
JAVADOC SECTION
|
||||||
@ -776,65 +923,66 @@ is divided into following sections:
|
|||||||
<classpath>
|
<classpath>
|
||||||
<path path="${javac.classpath}"/>
|
<path path="${javac.classpath}"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
<fileset dir="${src.core.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.core.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.core-data.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.core-data.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.core-plugins.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.core-plugins.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.terrain.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.terrain.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.networking.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.networking.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.desktop.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.desktop.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.desktop-fx.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.desktop-fx.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.games.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.games.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.jbullet.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.jbullet.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.niftygui.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.niftygui.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.jogg.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.jogg.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.lwjgl-oal.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.lwjgl-oal.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.lwjgl-ogl.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.lwjgl-ogl.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.ogre.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.ogre.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.pack.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.pack.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.jheora.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.jheora.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.test.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.test.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.tools.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.tools.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${src.xml.dir}" excludes="${excludes}" includes="${includes}">
|
<fileset dir="${src.xml.dir}" excludes="*.java,${excludes}" includes="${includes}">
|
||||||
<filename name="**/*.java"/>
|
<filename name="**/*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
|
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
|
||||||
<include name="**/*.java"/>
|
<include name="**/*.java"/>
|
||||||
|
<exclude name="*.java"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</javadoc>
|
</javadoc>
|
||||||
<copy todir="${dist.javadoc.dir}">
|
<copy todir="${dist.javadoc.dir}">
|
||||||
@ -919,7 +1067,7 @@ is divided into following sections:
|
|||||||
<target if="do.depend.true" name="-compile-test-depend">
|
<target if="do.depend.true" name="-compile-test-depend">
|
||||||
<j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.test.dir}"/>
|
<j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.test.dir}"/>
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
|
<target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
|
||||||
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.test.dir}"/>
|
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.test.dir}"/>
|
||||||
<copy todir="${build.test.classes.dir}">
|
<copy todir="${build.test.classes.dir}">
|
||||||
<fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
|
<fileset dir="${test.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
|
||||||
@ -934,7 +1082,7 @@ is divided into following sections:
|
|||||||
<!-- Empty placeholder for easier customization. -->
|
<!-- Empty placeholder for easier customization. -->
|
||||||
<!-- You can override this target in the ../build.xml file. -->
|
<!-- You can override this target in the ../build.xml file. -->
|
||||||
</target>
|
</target>
|
||||||
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
|
<target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
|
||||||
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
|
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
|
||||||
<j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
|
<j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
|
||||||
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.test.dir}" srcdir="${test.test.dir}"/>
|
<j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.test.dir}" srcdir="${test.test.dir}"/>
|
||||||
|
@ -4,8 +4,8 @@ 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.
|
# 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.
|
# 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.data.CRC32=759acdca
|
||||||
nbproject/build-impl.xml.script.CRC32=10762282
|
nbproject/build-impl.xml.script.CRC32=53d4e0e0
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=229523de@1.38.3.45
|
nbproject/build-impl.xml.stylesheet.CRC32=0ae3a408@1.44.0.45
|
||||||
nbproject/profiler-build-impl.xml.data.CRC32=aff514c1
|
nbproject/profiler-build-impl.xml.data.CRC32=aff514c1
|
||||||
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
|
nbproject/profiler-build-impl.xml.script.CRC32=abda56ed
|
||||||
nbproject/profiler-build-impl.xml.stylesheet.CRC32=f10cf54c@1.11.1
|
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>
|
|
@ -5,6 +5,10 @@ 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
|
||||||
|
assets.compress=false
|
||||||
|
assets.excludes=
|
||||||
|
assets.folder.name=
|
||||||
|
assets.jar.name=
|
||||||
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:
|
||||||
@ -76,6 +80,7 @@ jnlp.signed=true
|
|||||||
main.class=jme3test.TestChooser
|
main.class=jme3test.TestChooser
|
||||||
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
|
||||||
platform.active=default_platform
|
platform.active=default_platform
|
||||||
run.classpath=\
|
run.classpath=\
|
||||||
${javac.classpath}:\
|
${javac.classpath}:\
|
||||||
|
@ -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;
|
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) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.enabled = enabled;
|
this.enabled = enabled;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ import java.io.IOException;
|
|||||||
*/
|
*/
|
||||||
public class AudioNode extends Node {
|
public class AudioNode extends Node {
|
||||||
|
|
||||||
protected AudioRenderer renderer;
|
protected final AudioRenderer renderer;
|
||||||
|
|
||||||
protected boolean loop = false;
|
protected boolean loop = false;
|
||||||
protected float volume = 1;
|
protected float volume = 1;
|
||||||
@ -75,30 +75,32 @@ public class AudioNode extends Node {
|
|||||||
Stopped,
|
Stopped,
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioNode() {
|
public AudioNode(AudioRenderer audioRenderer) {
|
||||||
|
this.renderer = audioRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioNode(AudioData ad, AudioKey key) {
|
public AudioNode(AudioRenderer audioRenderer, AudioData ad, AudioKey key) {
|
||||||
this();
|
this(audioRenderer);
|
||||||
setAudioData(ad, key);
|
setAudioData(ad, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioNode(AssetManager manager, String name, boolean stream) {
|
public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, String name, boolean stream) {
|
||||||
this();
|
this(audioRenderer);
|
||||||
this.key = new AudioKey(name, stream);
|
this.key = new AudioKey(name, stream);
|
||||||
this.data = (AudioData) manager.loadAsset(key);
|
this.data = (AudioData) assetManager.loadAsset(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioNode(AssetManager manager, String name) {
|
public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, String name) {
|
||||||
this(manager, name, false);
|
this(audioRenderer, assetManager, name, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChannel(AudioRenderer renderer, int channel) {
|
|
||||||
|
|
||||||
|
public void setChannel(int channel) {
|
||||||
if (status != Status.Stopped) {
|
if (status != Status.Stopped) {
|
||||||
throw new IllegalStateException("Can only set source id when stopped");
|
throw new IllegalStateException("Can only set source id when stopped");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderer = renderer;
|
|
||||||
this.channel = channel;
|
this.channel = channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +118,7 @@ public class AudioNode extends Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.dryFilter = dryFilter;
|
this.dryFilter = dryFilter;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.DryFilter);
|
renderer.updateSourceParam(this, AudioParam.DryFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +149,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setLooping(boolean loop) {
|
public void setLooping(boolean loop) {
|
||||||
this.loop = loop;
|
this.loop = loop;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.Looping);
|
renderer.updateSourceParam(this, AudioParam.Looping);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +163,7 @@ public class AudioNode extends Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.pitch = pitch;
|
this.pitch = pitch;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.Pitch);
|
renderer.updateSourceParam(this, AudioParam.Pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +177,7 @@ public class AudioNode extends Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.volume = volume;
|
this.volume = volume;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.Volume);
|
renderer.updateSourceParam(this, AudioParam.Volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,7 +199,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setVelocity(Vector3f velocity) {
|
public void setVelocity(Vector3f velocity) {
|
||||||
this.velocity.set(velocity);
|
this.velocity.set(velocity);
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.Velocity);
|
renderer.updateSourceParam(this, AudioParam.Velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,7 +209,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setReverbEnabled(boolean reverbEnabled) {
|
public void setReverbEnabled(boolean reverbEnabled) {
|
||||||
this.reverbEnabled = reverbEnabled;
|
this.reverbEnabled = reverbEnabled;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.ReverbEnabled);
|
renderer.updateSourceParam(this, AudioParam.ReverbEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,7 +223,7 @@ public class AudioNode extends Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.reverbFilter = reverbFilter;
|
this.reverbFilter = reverbFilter;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.ReverbFilter);
|
renderer.updateSourceParam(this, AudioParam.ReverbFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +237,7 @@ public class AudioNode extends Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.maxDistance = maxDistance;
|
this.maxDistance = maxDistance;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.MaxDistance);
|
renderer.updateSourceParam(this, AudioParam.MaxDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,7 +251,7 @@ public class AudioNode extends Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.refDistance = refDistance;
|
this.refDistance = refDistance;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.RefDistance);
|
renderer.updateSourceParam(this, AudioParam.RefDistance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +261,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setDirectional(boolean directional) {
|
public void setDirectional(boolean directional) {
|
||||||
this.directional = directional;
|
this.directional = directional;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.IsDirectional);
|
renderer.updateSourceParam(this, AudioParam.IsDirectional);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +271,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setDirection(Vector3f direction) {
|
public void setDirection(Vector3f direction) {
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.Direction);
|
renderer.updateSourceParam(this, AudioParam.Direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +281,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setInnerAngle(float innerAngle) {
|
public void setInnerAngle(float innerAngle) {
|
||||||
this.innerAngle = innerAngle;
|
this.innerAngle = innerAngle;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.InnerAngle);
|
renderer.updateSourceParam(this, AudioParam.InnerAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,7 +291,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setOuterAngle(float outerAngle) {
|
public void setOuterAngle(float outerAngle) {
|
||||||
this.outerAngle = outerAngle;
|
this.outerAngle = outerAngle;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.OuterAngle);
|
renderer.updateSourceParam(this, AudioParam.OuterAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +301,7 @@ public class AudioNode extends Node {
|
|||||||
|
|
||||||
public void setPositional(boolean inHeadspace) {
|
public void setPositional(boolean inHeadspace) {
|
||||||
this.positional = inHeadspace;
|
this.positional = inHeadspace;
|
||||||
if (renderer != null)
|
if (channel >= 0)
|
||||||
renderer.updateSourceParam(this, AudioParam.IsPositional);
|
renderer.updateSourceParam(this, AudioParam.IsPositional);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,15 +318,6 @@ public class AudioNode extends Node {
|
|||||||
renderer.updateSourceParam(this, AudioParam.Position);
|
renderer.updateSourceParam(this, AudioParam.Position);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public boolean isUpdateNeeded(){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void clearUpdateNeeded(){
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public AudioNode clone(){
|
// public AudioNode clone(){
|
||||||
// try{
|
// try{
|
||||||
@ -334,6 +327,7 @@ public class AudioNode extends Node {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
super.write(ex);
|
super.write(ex);
|
||||||
OutputCapsule oc = ex.getCapsule(this);
|
OutputCapsule oc = ex.getCapsule(this);
|
||||||
@ -356,6 +350,7 @@ public class AudioNode extends Node {
|
|||||||
oc.write(outerAngle, "outer_angle", 360);
|
oc.write(outerAngle, "outer_angle", 360);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void read(JmeImporter im) throws IOException {
|
public void read(JmeImporter im) throws IOException {
|
||||||
super.read(im);
|
super.read(im);
|
||||||
InputCapsule ic = im.getCapsule(this);
|
InputCapsule ic = im.getCapsule(this);
|
||||||
@ -379,6 +374,7 @@ public class AudioNode extends Node {
|
|||||||
data = im.getAssetManager().loadAudio(key);
|
data = im.getAssetManager().loadAudio(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String ret = getClass().getSimpleName()
|
String ret = getClass().getSimpleName()
|
||||||
+ "[status=" + status;
|
+ "[status=" + status;
|
||||||
|
@ -198,22 +198,6 @@ public class Cinematic extends AbstractCinematicEvent implements Savable, AppSta
|
|||||||
return initialized;
|
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) {
|
public void setEnabled(boolean enabled) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
play();
|
play();
|
||||||
|
@ -70,24 +70,6 @@ public class MotionPath implements Savable {
|
|||||||
private Vector3f temp = new Vector3f();
|
private Vector3f temp = new Vector3f();
|
||||||
private Vector3f tmpVector = 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
|
* Create a motion Path
|
||||||
*/
|
*/
|
||||||
@ -248,33 +230,6 @@ public class MotionPath implements Savable {
|
|||||||
return spline.getControlPoints().iterator();
|
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 type of spline used for the path interpolation for this path
|
||||||
* @return the path interpolation spline type
|
* @return the path interpolation spline type
|
||||||
|
@ -110,7 +110,7 @@ public class SoundTrack extends AbstractCinematicEvent {
|
|||||||
@Override
|
@Override
|
||||||
public void initEvent(Application app, Cinematic cinematic) {
|
public void initEvent(Application app, Cinematic cinematic) {
|
||||||
audioRenderer = app.getAudioRenderer();
|
audioRenderer = app.getAudioRenderer();
|
||||||
audioNode = new AudioNode(app.getAssetManager(), path, stream);
|
audioNode = new AudioNode(audioRenderer, app.getAssetManager(), path, stream);
|
||||||
setLoopMode(loopMode);
|
setLoopMode(loopMode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -107,16 +107,6 @@ public class CollisionResult implements Comparable<CollisionResult> {
|
|||||||
return contactPoint;
|
return contactPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* @deprecated Use getContactPoint() instead, its already in world space.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public Vector3f getWorldContactPoint() {
|
|
||||||
return contactPoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3f getContactNormal() {
|
public Vector3f getContactNormal() {
|
||||||
return contactNormal;
|
return contactNormal;
|
||||||
}
|
}
|
||||||
|
@ -39,15 +39,12 @@ import com.jme3.math.Triangle;
|
|||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sweep sphere implements a collidable moving sphere.
|
* No longer public ..
|
||||||
* 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.
|
|
||||||
*
|
*
|
||||||
* @author Kirill Vainer
|
* @author Kirill Vainer
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class SweepSphere implements Collidable {
|
class SweepSphere implements Collidable {
|
||||||
|
|
||||||
private Vector3f velocity = new Vector3f();
|
private Vector3f velocity = new Vector3f();
|
||||||
private Vector3f center = new Vector3f();
|
private Vector3f center = new Vector3f();
|
||||||
|
@ -40,7 +40,6 @@ import com.jme3.bounding.BoundingBox;
|
|||||||
import com.jme3.bounding.BoundingVolume;
|
import com.jme3.bounding.BoundingVolume;
|
||||||
import com.jme3.collision.Collidable;
|
import com.jme3.collision.Collidable;
|
||||||
import com.jme3.collision.CollisionResults;
|
import com.jme3.collision.CollisionResults;
|
||||||
import com.jme3.collision.SweepSphere;
|
|
||||||
import com.jme3.collision.UnsupportedCollisionException;
|
import com.jme3.collision.UnsupportedCollisionException;
|
||||||
import com.jme3.export.JmeExporter;
|
import com.jme3.export.JmeExporter;
|
||||||
import com.jme3.export.JmeImporter;
|
import com.jme3.export.JmeImporter;
|
||||||
@ -422,26 +421,6 @@ public class BIHTree implements CollisionData {
|
|||||||
return 0;
|
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,
|
private int collideWithBoundingVolume(BoundingVolume bv,
|
||||||
Matrix4f worldMatrix,
|
Matrix4f worldMatrix,
|
||||||
CollisionResults results){
|
CollisionResults results){
|
||||||
@ -466,10 +445,7 @@ public class BIHTree implements CollisionData {
|
|||||||
BoundingVolume worldBound,
|
BoundingVolume worldBound,
|
||||||
CollisionResults results){
|
CollisionResults results){
|
||||||
|
|
||||||
if (other instanceof SweepSphere){
|
if (other instanceof Ray){
|
||||||
SweepSphere ss = (SweepSphere) other;
|
|
||||||
return collideWithSweepSphere(ss, worldMatrix, worldBound, results);
|
|
||||||
}else if (other instanceof Ray){
|
|
||||||
Ray ray = (Ray) other;
|
Ray ray = (Ray) other;
|
||||||
return collideWithRay(ray, worldMatrix, worldBound, results);
|
return collideWithRay(ray, worldMatrix, worldBound, results);
|
||||||
}else if (other instanceof BoundingVolume){
|
}else if (other instanceof BoundingVolume){
|
||||||
|
@ -406,22 +406,6 @@ public class ParticleEmitter extends Geometry implements Control {
|
|||||||
this.startSize = startSize;
|
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(){
|
public Vector3f getInitialVelocity(){
|
||||||
return startVel;
|
return startVel;
|
||||||
}
|
}
|
||||||
@ -440,22 +424,6 @@ public class ParticleEmitter extends Geometry implements Control {
|
|||||||
this.startVel.set(initialVelocity);
|
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() {
|
public float getVelocityVariation() {
|
||||||
return variation;
|
return variation;
|
||||||
}
|
}
|
||||||
|
@ -202,20 +202,6 @@ public class BitmapText extends Node {
|
|||||||
return block.getLineCount();
|
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() {
|
public LineWrapMode getLineWrapMode() {
|
||||||
return block.getLineWrapMode();
|
return block.getLineWrapMode();
|
||||||
}
|
}
|
||||||
|
@ -579,42 +579,6 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
|||||||
minDistance = ic.readFloat("minDistance", 1);
|
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
|
* returns the maximal vertical rotation angle of the camera around the target
|
||||||
* @return
|
* @return
|
||||||
@ -868,16 +832,6 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
|||||||
return initialUpVec;
|
return initialUpVec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param invertYaxis
|
|
||||||
* @deprecated use setInvertVerticalAxis
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void setInvertYaxis(boolean invertYaxis) {
|
|
||||||
setInvertVerticalAxis(invertYaxis);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* invert the vertical axis movement of the mouse
|
* invert the vertical axis movement of the mouse
|
||||||
* @param invertYaxis
|
* @param invertYaxis
|
||||||
|
@ -520,19 +520,8 @@ public interface KeyInput extends Input {
|
|||||||
*/
|
*/
|
||||||
public static final int KEY_DELETE = 0xD3;
|
public static final int KEY_DELETE = 0xD3;
|
||||||
public static final int KEY_LMETA = 0xDB; /* Left Windows/Option key */
|
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 */
|
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;
|
public static final int KEY_APPS = 0xDD;
|
||||||
/**
|
/**
|
||||||
* power key.
|
* power key.
|
||||||
|
@ -373,13 +373,7 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void clearTextureParam(String name) {
|
||||||
*
|
|
||||||
* @param name
|
|
||||||
* @deprecated use clearParam instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void clearTextureParam(String name) {
|
|
||||||
name = checkSetParam(null, name);
|
name = checkSetParam(null, name);
|
||||||
|
|
||||||
MatParamTexture val = getTextureParam(name);
|
MatParamTexture val = getTextureParam(name);
|
||||||
|
@ -1000,25 +1000,6 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
return this;
|
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.
|
* <code>transpose</code> <b>locally</b> transposes this Matrix.
|
||||||
* This is inconsistent with general value vs local semantics, but is
|
* 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 {
|
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();
|
public static final Transform IDENTITY = new Transform();
|
||||||
|
|
||||||
private Quaternion rot = new Quaternion();
|
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) {
|
protected void setFilterState(Filter filter, boolean enabled) {
|
||||||
if (filters.contains(filter)) {
|
if (filters.contains(filter)) {
|
||||||
filter.enabled = enabled;
|
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() {
|
public void cleanup() {
|
||||||
if (viewPort != null) {
|
if (viewPort != null) {
|
||||||
viewPort.setOutputFrameBuffer(outputBuffer);
|
viewPort.setOutputFrameBuffer(outputBuffer);
|
||||||
|
@ -362,8 +362,6 @@ public class RenderManager {
|
|||||||
case FrameRate:
|
case FrameRate:
|
||||||
u.setValue(VarType.Float, timer.getFrameRate());
|
u.setValue(VarType.Float, timer.getFrameRate());
|
||||||
break;
|
break;
|
||||||
case AmbientLightColor:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,26 +51,6 @@ public class CameraNode extends Node {
|
|||||||
public CameraNode() {
|
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) {
|
public CameraNode(String name, Camera camera) {
|
||||||
this(name, new CameraControl(camera));
|
this(name, new CameraControl(camera));
|
||||||
}
|
}
|
||||||
|
@ -453,28 +453,6 @@ public class Mesh implements Savable, Cloneable {
|
|||||||
return vertCount;
|
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){
|
public void getTriangle(int index, Vector3f v1, Vector3f v2, Vector3f v3){
|
||||||
VertexBuffer pb = getBuffer(Type.Position);
|
VertexBuffer pb = getBuffer(Type.Position);
|
||||||
VertexBuffer ib = getBuffer(Type.Index);
|
VertexBuffer ib = getBuffer(Type.Index);
|
||||||
|
@ -475,22 +475,6 @@ public class Node extends Spatial implements Savable {
|
|||||||
return children;
|
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
|
@Override
|
||||||
public void setMaterial(Material mat){
|
public void setMaterial(Material mat){
|
||||||
for (int i = 0; i < children.size(); i++){
|
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(cullHint, "cull_mode", CullHint.Inherit);
|
||||||
capsule.write(queueBucket, "queue", RenderQueue.Bucket.Inherit);
|
capsule.write(queueBucket, "queue", RenderQueue.Bucket.Inherit);
|
||||||
capsule.write(shadowMode, "shadow_mode", ShadowMode.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.write(localLights, "lights", null);
|
||||||
capsule.writeSavableArrayList(controls, "controlsList", null);
|
capsule.writeSavableArrayList(controls, "controlsList", null);
|
||||||
capsule.writeStringSavableMap(userData, "user_data", null);
|
capsule.writeStringSavableMap(userData, "user_data", null);
|
||||||
|
@ -67,14 +67,8 @@ public class LodControl extends AbstractControl implements Cloneable {
|
|||||||
private int[] numTris;
|
private int[] numTris;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Serialization only. Do not use.
|
||||||
* @param geom
|
|
||||||
* @deprecated Use {@link LodControl#LodControl() }
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public LodControl(Geometry geom){
|
|
||||||
}
|
|
||||||
|
|
||||||
public LodControl(){
|
public LodControl(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,13 +161,4 @@ public enum UniformBinding {
|
|||||||
* Type: float
|
* Type: float
|
||||||
*/
|
*/
|
||||||
FrameRate,
|
FrameRate,
|
||||||
|
|
||||||
/**
|
|
||||||
* AmbientLightColor.
|
|
||||||
* The sum of all the colors in the LightList with type
|
|
||||||
* {@link AmbientLight}.
|
|
||||||
* Type: vec4
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
AmbientLightColor;
|
|
||||||
}
|
}
|
||||||
|
@ -408,26 +408,6 @@ public abstract class Texture implements Asset, Savable, Cloneable {
|
|||||||
return this.key;
|
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
|
* <code>getImage</code> returns the image data that makes up this
|
||||||
* texture. If no image data has been set, this will return null.
|
* texture. If no image data has been set, this will return null.
|
||||||
|
@ -22,11 +22,17 @@ public class SkyFactory {
|
|||||||
sky.setCullHint(Spatial.CullHint.Never);
|
sky.setCullHint(Spatial.CullHint.Never);
|
||||||
|
|
||||||
Material skyMat = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");
|
Material skyMat = new Material(assetManager, "Common/MatDefs/Misc/Sky.j3md");
|
||||||
skyMat.setTexture("Texture", texture);
|
|
||||||
skyMat.setVector3("NormalScale", normalScale);
|
skyMat.setVector3("NormalScale", normalScale);
|
||||||
if (sphereMap){
|
if (sphereMap){
|
||||||
skyMat.setBoolean("SphereMap", 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);
|
sky.setMaterial(skyMat);
|
||||||
|
|
||||||
return sky;
|
return sky;
|
||||||
|
@ -88,12 +88,12 @@ public class FadeFilter extends Filter {
|
|||||||
if (direction > 0 && value > 1) {
|
if (direction > 0 && value > 1) {
|
||||||
value = 1;
|
value = 1;
|
||||||
playing = false;
|
playing = false;
|
||||||
processor.setFilterEnabled(this, false);
|
setEnabled(false);
|
||||||
}
|
}
|
||||||
if (direction < 0 && value < 0) {
|
if (direction < 0 && value < 0) {
|
||||||
value = 0;
|
value = 0;
|
||||||
playing = false;
|
playing = false;
|
||||||
processor.setFilterEnabled(this, false);
|
setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,13 +107,13 @@ public class FadeFilter extends Filter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void fadeIn() {
|
public void fadeIn() {
|
||||||
processor.setFilterEnabled(this, true);
|
setEnabled(true);
|
||||||
direction = 1;
|
direction = 1;
|
||||||
playing = true;
|
playing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fadeOut() {
|
public void fadeOut() {
|
||||||
processor.setFilterEnabled(this, true);
|
setEnabled(true);
|
||||||
direction = -1;
|
direction = -1;
|
||||||
playing = true;
|
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)
|
//start physics thread(pool)
|
||||||
if (threadingType == ThreadingType.PARALLEL) {
|
if (threadingType == ThreadingType.PARALLEL) {
|
||||||
startPhysicsOnExecutor();
|
startPhysicsOnExecutor();
|
||||||
} else if (threadingType == ThreadingType.DETACHED) {
|
// } else if (threadingType == ThreadingType.DETACHED) {
|
||||||
startPhysicsOnExecutor();
|
// startPhysicsOnExecutor();
|
||||||
executor.submit(detachedPhysicsUpdate);
|
// executor.submit(detachedPhysicsUpdate);
|
||||||
} else {
|
} else {
|
||||||
pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType);
|
pSpace = new PhysicsSpace(worldMin, worldMax, broadphaseType);
|
||||||
}
|
}
|
||||||
@ -149,22 +149,6 @@ public class BulletAppState implements AppState, PhysicsTickListener {
|
|||||||
return initialized;
|
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) {
|
public void setEnabled(boolean enabled) {
|
||||||
this.active = enabled;
|
this.active = enabled;
|
||||||
}
|
}
|
||||||
@ -189,9 +173,9 @@ public class BulletAppState implements AppState, PhysicsTickListener {
|
|||||||
if (!active) {
|
if (!active) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (threadingType != ThreadingType.DETACHED) {
|
// if (threadingType != ThreadingType.DETACHED) {
|
||||||
pSpace.distributeEvents();
|
pSpace.distributeEvents();
|
||||||
}
|
// }
|
||||||
this.tpf = tpf;
|
this.tpf = tpf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,14 +274,5 @@ public class BulletAppState implements AppState, PhysicsTickListener {
|
|||||||
* Multiple BulletAppStates will execute in parallel in this mode.
|
* Multiple BulletAppStates will execute in parallel in this mode.
|
||||||
*/
|
*/
|
||||||
PARALLEL,
|
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;
|
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
|
* 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.
|
* 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/>
|
* 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>
|
* <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
|
* @param manager AssetManager to load the default wireframe material for the debug shape
|
||||||
* @deprecated in favor of PhysicsSpace.enableDebug(AssetManager manager);
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
protected Spatial attachDebugShape(AssetManager manager) {
|
||||||
public Spatial attachDebugShape(AssetManager manager) {
|
|
||||||
debugMaterialBlue = new Material(manager, "Common/MatDefs/Misc/WireColor.j3md");
|
debugMaterialBlue = new Material(manager, "Common/MatDefs/Misc/WireColor.j3md");
|
||||||
debugMaterialBlue.setColor("Color", ColorRGBA.Blue);
|
debugMaterialBlue.setColor("Color", ColorRGBA.Blue);
|
||||||
// debugMaterialBlue.getAdditionalRenderState().setDepthTest(false);
|
// debugMaterialBlue.getAdditionalRenderState().setDepthTest(false);
|
||||||
@ -185,11 +183,7 @@ public abstract class PhysicsCollisionObject implements Savable {
|
|||||||
return attachDebugShape();
|
return attachDebugShape();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected Spatial attachDebugShape(Material material) {
|
||||||
* @deprecated in favor of PhysicsSpace.enableDebug(AssetManager manager);
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public Spatial attachDebugShape(Material material) {
|
|
||||||
debugMaterialBlue = material;
|
debugMaterialBlue = material;
|
||||||
debugMaterialGreen = material;
|
debugMaterialGreen = material;
|
||||||
debugMaterialRed = material;
|
debugMaterialRed = material;
|
||||||
|
@ -127,7 +127,7 @@ public class TestVideoPlayer extends SimpleApplication {
|
|||||||
public void simpleUpdate(float tpf){
|
public void simpleUpdate(float tpf){
|
||||||
if (source == null){
|
if (source == null){
|
||||||
if (decoder.getAudioStream() != null){
|
if (decoder.getAudioStream() != null){
|
||||||
source = new AudioNode(decoder.getAudioStream(), null);
|
source = new AudioNode(audioRenderer, decoder.getAudioStream(), null);
|
||||||
source.setPositional(false);
|
source.setPositional(false);
|
||||||
source.setReverbEnabled(false);
|
source.setReverbEnabled(false);
|
||||||
audioRenderer.playSource(source);
|
audioRenderer.playSource(source);
|
||||||
|
@ -740,7 +740,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
if (stopped){
|
if (stopped){
|
||||||
// became inactive
|
// became inactive
|
||||||
src.setStatus(Status.Stopped);
|
src.setStatus(Status.Stopped);
|
||||||
src.setChannel(null, -1);
|
src.setChannel(-1);
|
||||||
clearChannel(i);
|
clearChannel(i);
|
||||||
freeChannel(i);
|
freeChannel(i);
|
||||||
}
|
}
|
||||||
@ -754,7 +754,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
if (stopped){
|
if (stopped){
|
||||||
if (boundSource){
|
if (boundSource){
|
||||||
src.setStatus(Status.Stopped);
|
src.setStatus(Status.Stopped);
|
||||||
src.setChannel(null, -1);
|
src.setChannel(-1);
|
||||||
}
|
}
|
||||||
clearChannel(i);
|
clearChannel(i);
|
||||||
freeChannel(i);
|
freeChannel(i);
|
||||||
@ -853,7 +853,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
clearChannel(index);
|
clearChannel(index);
|
||||||
src.setChannel(this, index);
|
src.setChannel(index);
|
||||||
|
|
||||||
AudioData data = src.getAudioData();
|
AudioData data = src.getAudioData();
|
||||||
if (data.isUpdateNeeded())
|
if (data.isUpdateNeeded())
|
||||||
@ -908,7 +908,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
|
|||||||
assert chan != -1; // if it's not stopped, must have id
|
assert chan != -1; // if it's not stopped, must have id
|
||||||
|
|
||||||
src.setStatus(Status.Stopped);
|
src.setStatus(Status.Stopped);
|
||||||
src.setChannel(null, -1);
|
src.setChannel(-1);
|
||||||
clearChannel(chan);
|
clearChannel(chan);
|
||||||
freeChannel(chan);
|
freeChannel(chan);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import com.jme3.renderer.lwjgl.LwjglRenderer;
|
|||||||
import com.jme3.system.AppSettings;
|
import com.jme3.system.AppSettings;
|
||||||
import com.jme3.system.SystemListener;
|
import com.jme3.system.SystemListener;
|
||||||
import com.jme3.system.JmeContext;
|
import com.jme3.system.JmeContext;
|
||||||
|
import com.jme3.system.NullRenderer;
|
||||||
import com.jme3.system.Timer;
|
import com.jme3.system.Timer;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -116,6 +117,12 @@ public abstract class LwjglContext implements JmeContext {
|
|||||||
protected void initContextFirstTime(){
|
protected void initContextFirstTime(){
|
||||||
assert renderable.get();
|
assert renderable.get();
|
||||||
|
|
||||||
|
if (GLContext.getCapabilities().OpenGL20){
|
||||||
|
renderer = new LwjglRenderer();
|
||||||
|
}else{
|
||||||
|
renderer = new LwjglGL1Renderer();
|
||||||
|
}
|
||||||
|
|
||||||
// Init renderer
|
// Init renderer
|
||||||
if (renderer instanceof LwjglRenderer){
|
if (renderer instanceof LwjglRenderer){
|
||||||
((LwjglRenderer)renderer).initialize();
|
((LwjglRenderer)renderer).initialize();
|
||||||
@ -148,22 +155,25 @@ public abstract class LwjglContext implements JmeContext {
|
|||||||
|
|
||||||
public void internalCreate(){
|
public void internalCreate(){
|
||||||
timer = new LwjglTimer();
|
timer = new LwjglTimer();
|
||||||
if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL2)
|
|
||||||
|| settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)){
|
// if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL2)
|
||||||
renderer = new LwjglRenderer();
|
// || settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)){
|
||||||
}else if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL1)){
|
// renderer = new LwjglRenderer();
|
||||||
renderer = new LwjglGL1Renderer();
|
// }else if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL1)){
|
||||||
}else{
|
// renderer = new LwjglGL1Renderer();
|
||||||
throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer());
|
// }else{
|
||||||
}
|
// throw new UnsupportedOperationException("Unsupported renderer: " + settings.getRenderer());
|
||||||
|
// }
|
||||||
synchronized (createdLock){
|
synchronized (createdLock){
|
||||||
created.set(true);
|
created.set(true);
|
||||||
createdLock.notifyAll();
|
createdLock.notifyAll();
|
||||||
}
|
}
|
||||||
if (renderable.get())
|
|
||||||
|
if (renderable.get()){
|
||||||
initContextFirstTime();
|
initContextFirstTime();
|
||||||
else
|
}else{
|
||||||
assert getType() == Type.Canvas;
|
assert getType() == Type.Canvas;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void create(){
|
public void create(){
|
||||||
|
@ -50,7 +50,7 @@ public class SoundDeviceJme implements SoundDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SoundHandle loadSound(SoundSystem soundSystem, String filename) {
|
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);
|
an.setPositional(false);
|
||||||
return new SoundHandleJme(ar, an);
|
return new SoundHandleJme(ar, an);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class SoundHandleJme implements SoundHandle {
|
|||||||
ar.stopSource(node);
|
ar.stopSource(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
node = new AudioNode(am, fileName, true);
|
node = new AudioNode(ar, am, fileName, true);
|
||||||
node.setPositional(false);
|
node.setPositional(false);
|
||||||
node.setVolume(volume);
|
node.setVolume(volume);
|
||||||
ar.playSource(node);
|
ar.playSource(node);
|
||||||
|
@ -35,11 +35,8 @@ package com.jme3.terrain.geomipmap;
|
|||||||
import com.jme3.bounding.BoundingBox;
|
import com.jme3.bounding.BoundingBox;
|
||||||
import com.jme3.bounding.BoundingSphere;
|
import com.jme3.bounding.BoundingSphere;
|
||||||
import com.jme3.bounding.BoundingVolume;
|
import com.jme3.bounding.BoundingVolume;
|
||||||
import com.jme3.bounding.Intersection;
|
|
||||||
import com.jme3.collision.Collidable;
|
import com.jme3.collision.Collidable;
|
||||||
import com.jme3.collision.CollisionResult;
|
|
||||||
import com.jme3.collision.CollisionResults;
|
import com.jme3.collision.CollisionResults;
|
||||||
import com.jme3.collision.SweepSphere;
|
|
||||||
import com.jme3.collision.UnsupportedCollisionException;
|
import com.jme3.collision.UnsupportedCollisionException;
|
||||||
import com.jme3.export.InputCapsule;
|
import com.jme3.export.InputCapsule;
|
||||||
import com.jme3.export.JmeExporter;
|
import com.jme3.export.JmeExporter;
|
||||||
|
@ -44,6 +44,7 @@ import com.jme3.input.controls.KeyTrigger;
|
|||||||
import com.jme3.light.DirectionalLight;
|
import com.jme3.light.DirectionalLight;
|
||||||
import com.jme3.material.Material;
|
import com.jme3.material.Material;
|
||||||
import com.jme3.math.ColorRGBA;
|
import com.jme3.math.ColorRGBA;
|
||||||
|
import com.jme3.math.Spline.SplineType;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.CameraNode;
|
import com.jme3.scene.CameraNode;
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
@ -70,10 +71,9 @@ public class TestCameraMotionPath extends SimpleApplication {
|
|||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
createScene();
|
createScene();
|
||||||
cam.setLocation(new Vector3f(8.4399185f, 11.189463f, 14.267577f));
|
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.setControlDir(ControlDirection.SpatialToCamera);
|
||||||
camNode.getControl(0).setEnabled(false);
|
camNode.getControl(0).setEnabled(false);
|
||||||
camNode.setName("Motion cam");
|
|
||||||
path = new MotionPath();
|
path = new MotionPath();
|
||||||
path.setCycle(true);
|
path.setCycle(true);
|
||||||
path.addWayPoint(new Vector3f(20, 3, 0));
|
path.addWayPoint(new Vector3f(20, 3, 0));
|
||||||
@ -180,10 +180,10 @@ public class TestCameraMotionPath extends SimpleApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("SwitchPathInterpolation") && keyPressed) {
|
if (name.equals("SwitchPathInterpolation") && keyPressed) {
|
||||||
if (path.getPathInterpolation() == MotionPath.PathInterpolation.CatmullRom) {
|
if (path.getPathSplineType() == SplineType.CatmullRom){
|
||||||
path.setPathInterpolation(MotionPath.PathInterpolation.Linear);
|
path.setPathSplineType(SplineType.Linear);
|
||||||
} else {
|
} 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.ColorRGBA;
|
||||||
import com.jme3.math.FastMath;
|
import com.jme3.math.FastMath;
|
||||||
import com.jme3.math.Quaternion;
|
import com.jme3.math.Quaternion;
|
||||||
|
import com.jme3.math.Spline.SplineType;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import com.jme3.scene.shape.Box;
|
import com.jme3.scene.shape.Box;
|
||||||
import com.jme3.scene.shape.Line;
|
|
||||||
|
|
||||||
public class TestMotionPath extends SimpleApplication {
|
public class TestMotionPath extends SimpleApplication {
|
||||||
|
|
||||||
@ -170,10 +170,10 @@ public class TestMotionPath extends SimpleApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name.equals("SwitchPathInterpolation") && keyPressed) {
|
if (name.equals("SwitchPathInterpolation") && keyPressed) {
|
||||||
if (path.getPathInterpolation() == MotionPath.PathInterpolation.CatmullRom) {
|
if (path.getPathSplineType() == SplineType.CatmullRom){
|
||||||
path.setPathInterpolation(MotionPath.PathInterpolation.Linear);
|
path.setPathSplineType(SplineType.Linear);
|
||||||
} else {
|
} else {
|
||||||
path.setPathInterpolation(MotionPath.PathInterpolation.CatmullRom);
|
path.setPathSplineType(SplineType.CatmullRom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,10 +51,10 @@ public class TestAmbient extends AudioApp {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initAudioApp(){
|
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);
|
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");
|
// river = new AudioSource(manager, "sounds/river.ogg");
|
||||||
|
|
||||||
// float[] eax = new float[]
|
// float[] eax = new float[]
|
||||||
|
@ -52,7 +52,7 @@ public class TestDoppler extends AudioApp {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initAudioApp(){
|
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.setPositional(true);
|
||||||
ufo.setLooping(true);
|
ufo.setLooping(true);
|
||||||
audioRenderer.playSource(ufo);
|
audioRenderer.playSource(ufo);
|
||||||
|
@ -197,7 +197,7 @@ public class TestMusicPlayer extends javax.swing.JFrame {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
musicSource = new AudioNode(musicData, key);
|
musicSource = new AudioNode(ar, musicData, key);
|
||||||
musicLength = musicData.getDuration();
|
musicLength = musicData.getDuration();
|
||||||
updateTime();
|
updateTime();
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class TestOgg extends AudioApp {
|
|||||||
@Override
|
@Override
|
||||||
public void initAudioApp(){
|
public void initAudioApp(){
|
||||||
System.out.println("Playing without filter");
|
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);
|
audioRenderer.playSource(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ public class TestOgg extends AudioApp {
|
|||||||
audioRenderer.deleteAudioData(src.getAudioData());
|
audioRenderer.deleteAudioData(src.getAudioData());
|
||||||
|
|
||||||
System.out.println("Playing with low pass filter");
|
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.setDryFilter(new LowPassFilter(1f, .1f));
|
||||||
src.setVolume(3);
|
src.setVolume(3);
|
||||||
audioRenderer.playSource(src);
|
audioRenderer.playSource(src);
|
||||||
|
@ -51,7 +51,7 @@ public class TestReverb extends AudioApp {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initAudioApp(){
|
public void initAudioApp(){
|
||||||
src = new AudioNode(assetManager, "Sound/Effects/Bang.wav");
|
src = new AudioNode(audioRenderer, assetManager, "Sound/Effects/Bang.wav");
|
||||||
|
|
||||||
float[] eax = new float[]
|
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 }
|
{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
|
@Override
|
||||||
public void initAudioApp(){
|
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);
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -247,7 +247,6 @@ public class TestExplosionEffect extends SimpleApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void simpleUpdate(float tpf){
|
public void simpleUpdate(float tpf){
|
||||||
time += tpf / speed;
|
time += tpf / speed;
|
||||||
// speed = 0.02f;
|
|
||||||
if (time > 1f && state == 0){
|
if (time > 1f && state == 0){
|
||||||
flash.emitAllParticles();
|
flash.emitAllParticles();
|
||||||
spark.emitAllParticles();
|
spark.emitAllParticles();
|
||||||
|
@ -59,10 +59,10 @@ public class TestMovingParticle extends SimpleApplication {
|
|||||||
public void simpleInitApp() {
|
public void simpleInitApp() {
|
||||||
emit = new ParticleEmitter("Emitter", Type.Triangle, 200);
|
emit = new ParticleEmitter("Emitter", Type.Triangle, 200);
|
||||||
emit.setGravity(0);
|
emit.setGravity(0);
|
||||||
emit.setVariation(1);
|
emit.setVelocityVariation(1);
|
||||||
emit.setLowLife(1);
|
emit.setLowLife(1);
|
||||||
emit.setHighLife(1);
|
emit.setHighLife(1);
|
||||||
emit.setStartVel(new Vector3f(0, .5f, 0));
|
emit.setInitialVelocity(new Vector3f(0, .5f, 0));
|
||||||
emit.setImagesX(15);
|
emit.setImagesX(15);
|
||||||
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
|
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
|
||||||
mat.setTexture("Texture", assetManager.loadTexture("Effects/Smoke/Smoke.png"));
|
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.app.SimpleApplication;
|
||||||
import com.jme3.font.BitmapFont;
|
import com.jme3.font.BitmapFont;
|
||||||
import com.jme3.font.BitmapText;
|
import com.jme3.font.BitmapText;
|
||||||
|
import com.jme3.font.LineWrapMode;
|
||||||
import com.jme3.font.Rectangle;
|
import com.jme3.font.Rectangle;
|
||||||
import com.jme3.input.KeyInput;
|
import com.jme3.input.KeyInput;
|
||||||
import com.jme3.input.RawInputListener;
|
import com.jme3.input.RawInputListener;
|
||||||
@ -93,7 +94,8 @@ public class TestBitmapFont extends SimpleApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onAction(String name, boolean isPressed, float tpf) {
|
public void onAction(String name, boolean isPressed, float tpf) {
|
||||||
if (name.equals("WordWrap") && !isPressed) {
|
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. */
|
/** We create two audio nodes. */
|
||||||
private void initAudio() {
|
private void initAudio() {
|
||||||
/* gun shot sound is to be triggered by a mouse click. */
|
/* 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.setLooping(false);
|
||||||
audio_gun.setVolume(2);
|
audio_gun.setVolume(2);
|
||||||
|
|
||||||
/* nature sound - keeps playing in a loop. */
|
/* 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.setLooping(true);
|
||||||
audio_nature.setPositional(true);
|
audio_nature.setPositional(true);
|
||||||
audio_nature.setLocalTranslation(Vector3f.ZERO.clone());
|
audio_nature.setLocalTranslation(Vector3f.ZERO.clone());
|
||||||
|
@ -45,7 +45,7 @@ import com.jme3.scene.shape.Torus;
|
|||||||
|
|
||||||
public class TestLightRadius extends SimpleApplication {
|
public class TestLightRadius extends SimpleApplication {
|
||||||
|
|
||||||
float angle;
|
float pos, vel=1;
|
||||||
PointLight pl;
|
PointLight pl;
|
||||||
Geometry lightMdl;
|
Geometry lightMdl;
|
||||||
|
|
||||||
@ -95,10 +95,14 @@ public class TestLightRadius extends SimpleApplication {
|
|||||||
// cam.setLocation(new Vector3f(5.0347548f, 6.6481347f, 3.74853f));
|
// cam.setLocation(new Vector3f(5.0347548f, 6.6481347f, 3.74853f));
|
||||||
// cam.setRotation(new Quaternion(-0.19183293f, 0.80776674f, -0.37974006f, -0.40805697f));
|
// cam.setRotation(new Quaternion(-0.19183293f, 0.80776674f, -0.37974006f, -0.40805697f));
|
||||||
|
|
||||||
angle += tpf;
|
pos += tpf * vel * 5f;
|
||||||
angle %= FastMath.TWO_PI;
|
if (pos > 15){
|
||||||
|
vel *= -1;
|
||||||
|
}else if (pos < -15){
|
||||||
|
vel *= -1;
|
||||||
|
}
|
||||||
|
|
||||||
pl.setPosition(new Vector3f(FastMath.cos(angle) * 3f, 2, FastMath.sin(angle) * 3f));
|
pl.setPosition(new Vector3f(pos, 2, 0));
|
||||||
lightMdl.setLocalTranslation(pl.getPosition());
|
lightMdl.setLocalTranslation(pl.getPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ import com.jme3.app.SimpleApplication;
|
|||||||
import com.jme3.asset.plugins.HttpZipLocator;
|
import com.jme3.asset.plugins.HttpZipLocator;
|
||||||
import com.jme3.asset.plugins.ZipLocator;
|
import com.jme3.asset.plugins.ZipLocator;
|
||||||
import com.jme3.input.KeyInput;
|
import com.jme3.input.KeyInput;
|
||||||
|
import com.jme3.input.controls.ActionListener;
|
||||||
import com.jme3.input.controls.KeyTrigger;
|
import com.jme3.input.controls.KeyTrigger;
|
||||||
import com.jme3.light.DirectionalLight;
|
import com.jme3.light.DirectionalLight;
|
||||||
import com.jme3.material.Material;
|
import com.jme3.material.Material;
|
||||||
@ -111,35 +112,36 @@ public class TestMultiplesFilters extends SimpleApplication {
|
|||||||
viewPort.addProcessor(fpp);
|
viewPort.addProcessor(fpp);
|
||||||
|
|
||||||
rootNode.attachChild(scene);
|
rootNode.attachChild(scene);
|
||||||
inputManager.addListener(new com.jme3.input.controls.ActionListener() {
|
|
||||||
|
inputManager.addListener(new ActionListener() {
|
||||||
|
|
||||||
public void onAction(String name, boolean isPressed, float tpf) {
|
public void onAction(String name, boolean isPressed, float tpf) {
|
||||||
if ("toggleSSAO".equals(name) && isPressed) {
|
if ("toggleSSAO".equals(name) && isPressed) {
|
||||||
if (fpp.isFilterEnabled(ssaoFilter)) {
|
if (ssaoFilter.isEnabled()) {
|
||||||
fpp.setFilterEnabled(ssaoFilter, false);
|
ssaoFilter.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
fpp.setFilterEnabled(ssaoFilter, true);
|
ssaoFilter.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("toggleWater".equals(name) && isPressed) {
|
if ("toggleWater".equals(name) && isPressed) {
|
||||||
if (fpp.isFilterEnabled(water)) {
|
if (water.isEnabled()) {
|
||||||
fpp.setFilterEnabled(water, false);
|
water.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
fpp.setFilterEnabled(water, true);
|
water.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("toggleBloom".equals(name) && isPressed) {
|
if ("toggleBloom".equals(name) && isPressed) {
|
||||||
if (fpp.isFilterEnabled(bloom)) {
|
if (bloom.isEnabled()) {
|
||||||
fpp.setFilterEnabled(bloom, false);
|
bloom.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
fpp.setFilterEnabled(bloom, true);
|
bloom.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("toggleOverlay".equals(name) && isPressed) {
|
if ("toggleOverlay".equals(name) && isPressed) {
|
||||||
if (fpp.isFilterEnabled(overlay)) {
|
if (overlay.isEnabled()) {
|
||||||
fpp.setFilterEnabled(overlay, false);
|
overlay.setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
fpp.setFilterEnabled(overlay, true);
|
overlay.setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class TestPostWater extends SimpleApplication {
|
|||||||
mainScene.attachChild(sky);
|
mainScene.attachChild(sky);
|
||||||
cam.setFrustumFar(4000);
|
cam.setFrustumFar(4000);
|
||||||
//cam.setFrustumNear(100);
|
//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);
|
waves.setLooping(true);
|
||||||
audioRenderer.playSource(waves);
|
audioRenderer.playSource(waves);
|
||||||
|
|
||||||
|
@ -83,11 +83,13 @@ public class GeometryBatchFactory {
|
|||||||
|
|
||||||
int totalVerts = 0;
|
int totalVerts = 0;
|
||||||
int totalTris = 0;
|
int totalTris = 0;
|
||||||
|
int totalLodLevels = 0;
|
||||||
|
|
||||||
Mode mode = null;
|
Mode mode = null;
|
||||||
for (Geometry geom : geometries){
|
for (Geometry geom : geometries){
|
||||||
totalVerts += geom.getVertexCount();
|
totalVerts += geom.getVertexCount();
|
||||||
totalTris += geom.getTriangleCount();
|
totalTris += geom.getTriangleCount();
|
||||||
|
totalLodLevels = Math.min(totalLodLevels, geom.getMesh().getNumLodLevels());
|
||||||
|
|
||||||
Mode listMode;
|
Mode listMode;
|
||||||
int components;
|
int components;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user