|
@@ -16,15 +16,15 @@ compose_matrix(FLOATNAME(LMatrix3) &mat,
|
|
|
if (temp_hpr_fix) {
|
|
if (temp_hpr_fix) {
|
|
|
mat =
|
|
mat =
|
|
|
FLOATNAME(LMatrix3)::scale_mat(scale) *
|
|
FLOATNAME(LMatrix3)::scale_mat(scale) *
|
|
|
- FLOATNAME(LMatrix3)::rotate_mat(hpr[2], FLOATNAME(LVector3)::forward(cs), cs) *
|
|
|
|
|
- FLOATNAME(LMatrix3)::rotate_mat(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
|
|
|
|
- FLOATNAME(LMatrix3)::rotate_mat(hpr[0], FLOATNAME(LVector3)::up(cs), cs);
|
|
|
|
|
|
|
+ FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[2], FLOATNAME(LVector3)::forward(cs), cs) *
|
|
|
|
|
+ FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
|
|
|
|
+ FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[0], FLOATNAME(LVector3)::up(cs), cs);
|
|
|
} else {
|
|
} else {
|
|
|
mat =
|
|
mat =
|
|
|
FLOATNAME(LMatrix3)::scale_mat(scale) *
|
|
FLOATNAME(LMatrix3)::scale_mat(scale) *
|
|
|
- FLOATNAME(LMatrix3)::rotate_mat(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
|
|
|
|
- FLOATNAME(LMatrix3)::rotate_mat(hpr[0], FLOATNAME(LVector3)::up(cs), cs) *
|
|
|
|
|
- FLOATNAME(LMatrix3)::rotate_mat(hpr[2], FLOATNAME(LVector3)::back(cs), cs);
|
|
|
|
|
|
|
+ FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[1], FLOATNAME(LVector3)::right(cs), cs) *
|
|
|
|
|
+ FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[0], FLOATNAME(LVector3)::up(cs), cs) *
|
|
|
|
|
+ FLOATNAME(LMatrix3)::rotate_mat_normaxis(hpr[2], FLOATNAME(LVector3)::back(cs), cs);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -58,7 +58,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the heading, and continue.
|
|
// Unwind the heading, and continue.
|
|
|
Matrix rot_y;
|
|
Matrix rot_y;
|
|
|
- rot_y = Matrix::rotate_mat(-heading, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
|
|
|
|
+ rot_y = Matrix::rotate_mat_normaxis(-heading, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_y;
|
|
x = x * rot_y;
|
|
@@ -74,7 +74,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the pitch.
|
|
// Unwind the pitch.
|
|
|
Matrix rot_x;
|
|
Matrix rot_x;
|
|
|
- rot_x = Matrix::rotate_mat(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
|
|
|
|
+ rot_x = Matrix::rotate_mat_normaxis(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_x;
|
|
x = x * rot_x;
|
|
@@ -90,7 +90,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the roll from the axes, and continue.
|
|
// Unwind the roll from the axes, and continue.
|
|
|
Matrix rot_z;
|
|
Matrix rot_z;
|
|
|
- rot_z = Matrix::rotate_mat(-roll, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
|
|
|
|
+ rot_z = Matrix::rotate_mat_normaxis(-roll, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_z;
|
|
x = x * rot_z;
|
|
@@ -124,7 +124,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the roll from the axes, and continue.
|
|
// Unwind the roll from the axes, and continue.
|
|
|
Matrix rot_z;
|
|
Matrix rot_z;
|
|
|
- rot_z = Matrix::rotate_mat(-roll, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
|
|
|
|
+ rot_z = Matrix::rotate_mat_normaxis(-roll, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_z;
|
|
x = x * rot_z;
|
|
@@ -141,7 +141,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the heading, and continue.
|
|
// Unwind the heading, and continue.
|
|
|
Matrix rot_y;
|
|
Matrix rot_y;
|
|
|
- rot_y = Matrix::rotate_mat(-heading, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
|
|
|
|
+ rot_y = Matrix::rotate_mat_normaxis(-heading, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_y;
|
|
x = x * rot_y;
|
|
@@ -157,7 +157,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the pitch.
|
|
// Unwind the pitch.
|
|
|
Matrix rot_x;
|
|
Matrix rot_x;
|
|
|
- rot_x = Matrix::rotate_mat(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
|
|
|
|
+ rot_x = Matrix::rotate_mat_normaxis(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_x;
|
|
x = x * rot_x;
|
|
@@ -204,7 +204,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr,
|
|
|
|
|
|
|
|
// Unwind the roll from the axes, and continue.
|
|
// Unwind the roll from the axes, and continue.
|
|
|
Matrix rot_z;
|
|
Matrix rot_z;
|
|
|
- rot_z = Matrix::rotate_mat(-roll, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
|
|
|
|
+ rot_z = Matrix::rotate_mat_normaxis(-roll, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_z;
|
|
x = x * rot_z;
|
|
@@ -221,7 +221,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr,
|
|
|
|
|
|
|
|
// Unwind the heading, and continue.
|
|
// Unwind the heading, and continue.
|
|
|
Matrix rot_y;
|
|
Matrix rot_y;
|
|
|
- rot_y = Matrix::rotate_mat(-heading, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
|
|
|
|
+ rot_y = Matrix::rotate_mat_normaxis(-heading, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_y;
|
|
x = x * rot_y;
|
|
@@ -237,7 +237,7 @@ unwind_yup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr,
|
|
|
|
|
|
|
|
// Unwind the pitch.
|
|
// Unwind the pitch.
|
|
|
Matrix rot_x;
|
|
Matrix rot_x;
|
|
|
- rot_x = Matrix::rotate_mat(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
|
|
|
|
+ rot_x = Matrix::rotate_mat_normaxis(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
CS_yup_right);
|
|
CS_yup_right);
|
|
|
|
|
|
|
|
x = x * rot_x;
|
|
x = x * rot_x;
|
|
@@ -285,7 +285,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the heading, and continue.
|
|
// Unwind the heading, and continue.
|
|
|
Matrix rot_z;
|
|
Matrix rot_z;
|
|
|
- rot_z = Matrix::rotate_mat(-heading, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
|
|
|
|
+ rot_z = Matrix::rotate_mat_normaxis(-heading, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_z;
|
|
x = x * rot_z;
|
|
@@ -301,7 +301,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the pitch.
|
|
// Unwind the pitch.
|
|
|
Matrix rot_x;
|
|
Matrix rot_x;
|
|
|
- rot_x = Matrix::rotate_mat(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
|
|
|
|
+ rot_x = Matrix::rotate_mat_normaxis(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_x;
|
|
x = x * rot_x;
|
|
@@ -317,7 +317,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the roll from the axes, and continue.
|
|
// Unwind the roll from the axes, and continue.
|
|
|
Matrix rot_y;
|
|
Matrix rot_y;
|
|
|
- rot_y = Matrix::rotate_mat(-roll, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
|
|
|
|
+ rot_y = Matrix::rotate_mat_normaxis(-roll, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_y;
|
|
x = x * rot_y;
|
|
@@ -361,7 +361,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the roll from the axes, and continue.
|
|
// Unwind the roll from the axes, and continue.
|
|
|
Matrix rot_y;
|
|
Matrix rot_y;
|
|
|
- rot_y = Matrix::rotate_mat(roll, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
|
|
|
|
+ rot_y = Matrix::rotate_mat_normaxis(roll, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_y;
|
|
x = x * rot_y;
|
|
@@ -378,7 +378,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the heading, and continue.
|
|
// Unwind the heading, and continue.
|
|
|
Matrix rot_z;
|
|
Matrix rot_z;
|
|
|
- rot_z = Matrix::rotate_mat(-heading, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
|
|
|
|
+ rot_z = Matrix::rotate_mat_normaxis(-heading, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_z;
|
|
x = x * rot_z;
|
|
@@ -394,7 +394,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr) {
|
|
|
|
|
|
|
|
// Unwind the pitch.
|
|
// Unwind the pitch.
|
|
|
Matrix rot_x;
|
|
Matrix rot_x;
|
|
|
- rot_x = Matrix::rotate_mat(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
|
|
|
|
+ rot_x = Matrix::rotate_mat_normaxis(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_x;
|
|
x = x * rot_x;
|
|
@@ -441,7 +441,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr,
|
|
|
|
|
|
|
|
// Unwind the roll from the axes, and continue.
|
|
// Unwind the roll from the axes, and continue.
|
|
|
Matrix rot_y;
|
|
Matrix rot_y;
|
|
|
- rot_y = Matrix::rotate_mat(roll, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
|
|
|
|
+ rot_y = Matrix::rotate_mat_normaxis(roll, FLOATNAME(LVector3)(0.0, 1.0, 0.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_y;
|
|
x = x * rot_y;
|
|
@@ -458,7 +458,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr,
|
|
|
|
|
|
|
|
// Unwind the heading, and continue.
|
|
// Unwind the heading, and continue.
|
|
|
Matrix rot_z;
|
|
Matrix rot_z;
|
|
|
- rot_z = Matrix::rotate_mat(-heading, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
|
|
|
|
+ rot_z = Matrix::rotate_mat_normaxis(-heading, FLOATNAME(LVector3)(0.0, 0.0, 1.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_z;
|
|
x = x * rot_z;
|
|
@@ -474,7 +474,7 @@ unwind_zup_rotation(FLOATNAME(LMatrix3) &mat, FLOATNAME(LVecBase3) &hpr,
|
|
|
|
|
|
|
|
// Unwind the pitch.
|
|
// Unwind the pitch.
|
|
|
Matrix rot_x;
|
|
Matrix rot_x;
|
|
|
- rot_x = Matrix::rotate_mat(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
|
|
|
|
+ rot_x = Matrix::rotate_mat_normaxis(-pitch, FLOATNAME(LVector3)(1.0, 0.0, 0.0),
|
|
|
CS_zup_right);
|
|
CS_zup_right);
|
|
|
|
|
|
|
|
x = x * rot_x;
|
|
x = x * rot_x;
|