Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
ab797725
Commit
ab797725
authored
4 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
accept Terry's changes
parent
c17e55ac
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/edu/nps/moves/spatial/EntityBodyCoordinates.java
+72
-0
72 additions, 0 deletions
src/edu/nps/moves/spatial/EntityBodyCoordinates.java
with
72 additions
and
0 deletions
src/edu/nps/moves/spatial/EntityBodyCoordinates.java
0 → 100644
+
72
−
0
View file @
ab797725
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.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment