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
2256c681
Commit
2256c681
authored
3 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
suppress some javadoc warnings
parent
7b713844
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/legacy/math/Matrix3f.java
+39
-2
39 additions, 2 deletions
src/edu/nps/moves/legacy/math/Matrix3f.java
with
39 additions
and
2 deletions
src/edu/nps/moves/legacy/math/Matrix3f.java
+
39
−
2
View file @
2256c681
...
@@ -42,60 +42,89 @@ package edu.nps.moves.legacy.math;
...
@@ -42,60 +42,89 @@ package edu.nps.moves.legacy.math;
* Description: Definition of the Matrix3f class
* Description: Definition of the Matrix3f class
* @author Kent A. Watsen, http://www.mbay.net/~watsen
* @author Kent A. Watsen, http://www.mbay.net/~watsen
*/
*/
@SuppressWarnings
(
"javadoc"
)
public
class
Matrix3f
public
class
Matrix3f
{
{
private
private
float
m
[][];
float
m
[][];
/** constructor */
public
Matrix3f
()
public
Matrix3f
()
{
{
m
=
new
float
[
3
][
3
];
m
=
new
float
[
3
][
3
];
makeNull
();
makeNull
();
}
}
/** constructor
* @param mat initialization matrix */
public
Matrix3f
(
float
mat
[][])
public
Matrix3f
(
float
mat
[][])
{
{
m
=
new
float
[
3
][
3
];
m
=
new
float
[
3
][
3
];
setMat
(
mat
);
setMat
(
mat
);
}
}
/** constructor
* @param mat initialization matrix */
public
Matrix3f
(
Matrix3f
mat
)
public
Matrix3f
(
Matrix3f
mat
)
{
{
m
=
new
float
[
3
][
3
];
m
=
new
float
[
3
][
3
];
setMat
(
mat
);
setMat
(
mat
);
}
}
/** constructor
* @param quat initialization quaternion */
public
Matrix3f
(
Quaternion
quat
)
public
Matrix3f
(
Quaternion
quat
)
{
{
setQuat
(
quat
);
setQuat
(
quat
);
}
}
/** constructor
* @param hpr initialization heading, pitch, roll */
public
Matrix3f
(
float
hpr
[])
public
Matrix3f
(
float
hpr
[])
{
{
m
=
new
float
[
3
][
3
];
m
=
new
float
[
3
][
3
];
setEulers
(
hpr
);
setEulers
(
hpr
);
}
}
/** constructor
* @param heading initialization heading
* @param pitch initialization pitch
* @param roll initialization roll */
public
Matrix3f
(
float
heading
,
float
pitch
,
float
roll
)
public
Matrix3f
(
float
heading
,
float
pitch
,
float
roll
)
{
{
m
=
new
float
[
3
][
3
];
m
=
new
float
[
3
][
3
];
setEulers
(
heading
,
pitch
,
roll
);
setEulers
(
heading
,
pitch
,
roll
);
}
}
public
void
print
()
/**
* output matrix to console
*/
public
void
print
()
{
{
System
.
out
.
println
(
"m = "
+
m
[
0
][
0
]
+
", "
+
m
[
0
][
1
]
+
", "
+
m
[
0
][
2
]
System
.
out
.
println
(
"m = "
+
m
[
0
][
0
]
+
", "
+
m
[
0
][
1
]
+
", "
+
m
[
0
][
2
]
+
m
[
1
][
0
]
+
", "
+
m
[
1
][
1
]
+
", "
+
m
[
1
][
2
]
+
m
[
1
][
0
]
+
", "
+
m
[
1
][
1
]
+
", "
+
m
[
1
][
2
]
+
m
[
2
][
0
]
+
", "
+
m
[
2
][
1
]
+
", "
+
m
[
2
][
2
]);
+
m
[
2
][
0
]
+
", "
+
m
[
2
][
1
]
+
", "
+
m
[
2
][
2
]);
}
}
public
void
setMatValue
(
int
row
,
int
col
,
float
val
)
/**
* Set a single value in matrix
* @param row row
* @param col column
* @param val value
*/
public
void
setMatValue
(
int
row
,
int
col
,
float
val
)
{
{
if
(
row
<
0
||
row
>
3
||
col
<
0
||
col
>
3
)
if
(
row
<
0
||
row
>
3
||
col
<
0
||
col
>
3
)
return
;
return
;
m
[
row
][
col
]
=
val
;
m
[
row
][
col
]
=
val
;
}
}
/**
* Get a single value in matrix
* @param row row
* @param col column
* @return value
*/
public
float
getMatValue
(
int
row
,
int
col
)
public
float
getMatValue
(
int
row
,
int
col
)
{
{
if
(
row
<
0
||
row
>
3
||
col
<
0
||
col
>
3
)
if
(
row
<
0
||
row
>
3
||
col
<
0
||
col
>
3
)
...
@@ -103,6 +132,8 @@ public class Matrix3f
...
@@ -103,6 +132,8 @@ public class Matrix3f
return
m
[
row
][
col
];
return
m
[
row
][
col
];
}
}
/** Accessor method to set new matrix
* @param mat initialization matrix */
public
void
setMat
(
float
mat
[][])
public
void
setMat
(
float
mat
[][])
{
{
m
[
0
][
0
]
=
mat
[
0
][
0
];
m
[
0
][
0
]
=
mat
[
0
][
0
];
...
@@ -116,6 +147,8 @@ public class Matrix3f
...
@@ -116,6 +147,8 @@ public class Matrix3f
m
[
2
][
2
]
=
mat
[
2
][
2
];
m
[
2
][
2
]
=
mat
[
2
][
2
];
}
}
/** Accessor method to get matrix
* @param mat array to receive matrix values */
public
void
getMat
(
float
mat
[][])
public
void
getMat
(
float
mat
[][])
{
{
mat
[
0
][
0
]
=
m
[
0
][
0
];
mat
[
0
][
0
]
=
m
[
0
][
0
];
...
@@ -129,6 +162,8 @@ public class Matrix3f
...
@@ -129,6 +162,8 @@ public class Matrix3f
mat
[
2
][
2
]
=
m
[
2
][
2
];
mat
[
2
][
2
]
=
m
[
2
][
2
];
}
}
/** Accessor method to set new matrix
* @param mat initialization matrix */
public
void
setMat
(
Matrix3f
mat
)
public
void
setMat
(
Matrix3f
mat
)
{
{
float
mat2
[][]
=
new
float
[
3
][
3
];
float
mat2
[][]
=
new
float
[
3
][
3
];
...
@@ -143,6 +178,8 @@ public class Matrix3f
...
@@ -143,6 +178,8 @@ public class Matrix3f
mat
.
setMat
(
mat2
);
mat
.
setMat
(
mat2
);
}
}
/** Accessor method to set new matrix
* @param quat initialization quaternion */
public
void
setQuat
(
Quaternion
quat
)
public
void
setQuat
(
Quaternion
quat
)
{
{
quat
.
getMat3
(
m
);
quat
.
getMat3
(
m
);
...
...
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