Skip to content
Snippets Groups Projects
Commit 2895f696 authored by terry-norbraten's avatar terry-norbraten
Browse files

add spacial package for SRM to DIS coordinates

parent 8685d5a1
No related branches found
No related tags found
No related merge requests found
File added
......@@ -90,7 +90,7 @@ is divided into following sections:
</not>
</condition>
</fail>
<j2seproject3:modulename property="module.name" sourcepath="${src.dir}:${src.src-generated.dir}"/>
<j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
<condition property="named.module.internal">
<and>
<isset property="module.name"/>
......@@ -186,7 +186,6 @@ is divided into following sections:
<condition property="have.sources">
<or>
<available file="${src.dir}"/>
<available file="${src.src-generated.dir}"/>
</or>
</condition>
<condition property="netbeans.home+have.tests">
......@@ -290,7 +289,6 @@ is divided into following sections:
</target>
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="src.src-generated.dir">Must set src.src-generated.dir</fail>
<fail unless="test.src.dir">Must set test.src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
......@@ -312,7 +310,7 @@ is divided into following sections:
</target>
<target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}:${src.src-generated.dir}" name="srcdir"/>
<attribute default="${src.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}" name="classpath"/>
<attribute default="${javac.modulepath}" name="modulepath"/>
......@@ -324,7 +322,7 @@ is divided into following sections:
<attribute default="${excludes}" name="excludes"/>
<attribute default="${javac.debug}" name="debug"/>
<attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
<attribute default="${src.dir}:${src.src-generated.dir}" if:set="named.module.internal" name="sourcepath"/>
<attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
<attribute default="${empty.dir}" name="gensrcdir"/>
<element name="customize" optional="true"/>
<sequential>
......@@ -379,7 +377,7 @@ is divided into following sections:
</target>
<target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}:${src.src-generated.dir}" name="srcdir"/>
<attribute default="${src.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}" name="classpath"/>
<attribute default="${javac.modulepath}" name="modulepath"/>
......@@ -422,7 +420,7 @@ is divided into following sections:
</target>
<target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}:${src.src-generated.dir}" name="srcdir"/>
<attribute default="${src.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}" name="classpath"/>
<attribute default="${javac.modulepath}" name="modulepath"/>
......@@ -457,7 +455,7 @@ is divided into following sections:
</target>
<target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
<macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute default="${src.dir}:${src.src-generated.dir}" name="srcdir"/>
<attribute default="${src.dir}" name="srcdir"/>
<attribute default="${build.classes.dir}" name="destdir"/>
<attribute default="${javac.classpath}" name="classpath"/>
<sequential>
......@@ -1092,13 +1090,12 @@ is divided into following sections:
<include name="*"/>
</dirset>
</pathconvert>
<j2seproject3:depend srcdir="${src.dir}:${src.src-generated.dir}:${build.generated.subdirs}"/>
<j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
</target>
<target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
<j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
<fileset dir="${src.src-generated.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
</copy>
</target>
<target if="has.persistence.xml" name="-copy-persistence-xml">
......@@ -1119,7 +1116,7 @@ is divided into following sections:
<target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject3:force-recompile/>
<j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}:${src.src-generated.dir}"/>
<j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
</target>
<target name="-post-compile-single">
<!-- Empty placeholder for easier customization. -->
......@@ -1514,9 +1511,6 @@ is divided into following sections:
<fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
<filename name="**/*.java"/>
</fileset>
<fileset dir="${src.src-generated.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
<filename name="**/*.java"/>
</fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
<include name="**/*.java"/>
<exclude name="*.java"/>
......@@ -1528,9 +1522,6 @@ is divided into following sections:
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/doc-files/**"/>
</fileset>
<fileset dir="${src.src-generated.dir}" excludes="${excludes}" includes="${includes}">
<filename name="**/doc-files/**"/>
</fileset>
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
<include name="**/doc-files/**"/>
</fileset>
......
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=be778aa9
nbproject/build-impl.xml.script.CRC32=c34c2285
nbproject/build-impl.xml.stylesheet.CRC32=f89f7d21@1.95.0.48
......@@ -47,18 +47,18 @@ file.reference.junit-platform-console-1.6.2.jar=testlibs/junit-platform-console-
file.reference.junit-platform-engine-1.6.2.jar=testlibs/junit-platform-engine-1.6.2.jar
file.reference.junit-platform-launcher-1.6.2.jar=testlibs/junit-platform-launcher-1.6.2.jar
file.reference.junit-platform-reporting-1.6.2.jar=testlibs/junit-platform-reporting-1.6.2.jar
file.reference.open-dis7-java-src=src
file.reference.open-dis7-java-src-generated=src-generated
file.reference.open-dis7-enumerations-classes.jar=dist/open-dis7-enumerations-classes.jar
file.reference.opentest4j-1.2.0.jar=testlibs/opentest4j-1.2.0.jar
file.reference.srm-4.4.0.jar=lib/srm-4.4.0.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=false
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.open-dis7-java-src}:\
${file.reference.open-dis7-java-src-generated}:\
${file.reference.commons-io-2.6.jar}:\
${file.reference.guava-28.0-jre.jar}
${file.reference.guava-28.0-jre.jar}:\
${file.reference.open-dis7-enumerations-classes.jar}:\
${file.reference.srm-4.4.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=-Xlint:unchecked
javac.deprecation=true
......@@ -70,8 +70,6 @@ javac.processorpath=\
javac.source=1.8
javac.target=1.8
javac.test.classpath=\
${file.reference.open-dis7-java-src}:\
${file.reference.open-dis7-java-src-generated}:\
${libs.junit_5.classpath}:\
${file.reference.apiguardian-api-1.1.0.jar}:\
${libs.hamcrest.classpath}:\
......@@ -131,8 +129,6 @@ run.jvmargs=
run.modulepath=\
${javac.modulepath}
run.test.classpath=\
${file.reference.open-dis7-java-src}:\
${file.reference.open-dis7-java-src-generated}:\
${file.reference.junit-platform-commons-1.6.2.jar}:\
${file.reference.junit-platform-console-1.6.2.jar}:\
${file.reference.junit-platform-engine-1.6.2.jar}:\
......@@ -145,5 +141,4 @@ run.test.modulepath=\
${javac.test.modulepath}
source.encoding=UTF-8
src.dir=src
src.src-generated.dir=src-generated
test.src.dir=test
......@@ -6,7 +6,6 @@
<name>open-dis7-java</name>
<source-roots>
<root id="src.dir"/>
<root id="src.src-generated.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
......
package edu.nps.moves.spatial;
import SRM.*;
/**
* Local coordinate system for an entity, e.g., relative to one UAV. This
* is typically embedded in another coordinate system, such as a range
* coordinate system. The origin of the local coordinate system should be
* the center of mass of the entity. The u axis points out the front, v axis
* out the right side of the entity, and the w axis down. The SRF is specified
* via a point (in the reference frame of the parent) and two unit vectors
* in the parent SRF, which are parallel to the entity u,v plane. Directions,
* orientations, and vector
* quantities are independent of the position of the lococenter WRT the
* parent SRF; if you're concerned only with directions, orientations, and
* vector quantities it doesn't matter where the origin is, so you can
* pick someplace handy, like the origin of the parent SRF.
*
* @author DMcG
*/
public class EntityBodyCoordinates
{
/** body-centric coordinate system for the entity */
SRF_LococentricEuclidean3D bodySRF;
/** The coordinate system in which this body-centric coordinate system is embedded */
BaseSRF_3D parentSRF;
/** origin of body-centric coordinate system, in the parent SRF */
Coord3D lococenter;
/** Create a new lococentric Euclidean reference frame embedded in a parent SRF.
* The origin of the lococentric coordinate system is specified, along with
* two unit vectors, parallel to the u and v axes.
* @param parentSRF
* @param x
* @param y
* @param z
* @param primaryDirectionX
* @param primaryDirectionY
* @param primaryDirectionZ
* @param secondaryDirectionX
* @param secondaryDirectionY
* @param secondaryDirectionZ
*/
public EntityBodyCoordinates(BaseSRF_3D parentSRF,
float x, float y, float z, // lococenter, in parent SRF
float primaryDirectionX, float primaryDirectionY, float primaryDirectionZ, // unit vector parallel to u axis
float secondaryDirectionX, float secondaryDirectionY, float secondaryDirectionZ) // unit vector parallel to v axis
{
try
{
this.parentSRF = parentSRF;
this.lococenter = parentSRF.createCoordinate3D(x, y, z);
// Unit vector along entity u axis in parent SRF
double[] d1 = {primaryDirectionX, primaryDirectionY, primaryDirectionZ};
Direction primaryAxisDirection = parentSRF.createDirection(lococenter, d1);
// Unit vector along v axis in parent SRF
double[] d2 = {secondaryDirectionX, secondaryDirectionY, secondaryDirectionZ};
Direction secondaryAxisDirection = parentSRF.createDirection(lococenter, d2);
this.bodySRF = parentSRF.createLococentricEuclidean3DSRF(lococenter, primaryAxisDirection, primaryAxisDirection);
}
catch(SrmException e)
{
System.err.print(e);
}
}
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment