#include <assert.h>#include <math.h>#include "vec3d.h"#include "xform3d.h"#include "matrix33.h"Go to the source code of this file.
Functions | |
| void | Matrix33_MakeCrossProductMatrix33 (const geVec3d *v, Matrix33 *m) |
| void | Matrix33_ExtractFromXForm3d (const geXForm3d *xform, Matrix33 *m) |
| void | Matrix33_MultiplyVec3d (const Matrix33 *m, const geVec3d *v, geVec3d *res) |
| void | Matrix33_Multiply (const Matrix33 *m1, const Matrix33 *m2, Matrix33 *res) |
| void | Matrix33_GetTranspose (const Matrix33 *m, Matrix33 *t) |
| void | Matrix33_Copy (const Matrix33 *m, Matrix33 *c) |
| void | Matrix33_SetIdentity (Matrix33 *m) |
| void | Matrix33_Add (const Matrix33 *m1, const Matrix33 *m2, Matrix33 *res) |
| void | Matrix33_Subtract (const Matrix33 *m1, const Matrix33 *m2, Matrix33 *res) |
| void | Matrix33_MultiplyScalar (geFloat s, const Matrix33 *m, Matrix33 *res) |
| void | Matrix33_GetInverse (const Matrix33 *m, Matrix33 *inv) |
|
||||||||||||||||
|
Definition at line 121 of file matrix33.c. References NULL, and Matrix33::x. Referenced by gePhysicsSystem_EnforceConstraints().
|
|
||||||||||||
|
Definition at line 94 of file matrix33.c. References NULL, and Matrix33::x. Referenced by gePhysicsObject_GetInertiaTensor(), gePhysicsObject_GetInertiaTensorInverse(), and Matrix33_GetInverse().
|
|
||||||||||||
|
Definition at line 41 of file matrix33.c. References geXForm3d::AX, geXForm3d::AY, geXForm3d::AZ, geXForm3d::BX, geXForm3d::BY, geXForm3d::BZ, geXForm3d::CX, geXForm3d::CY, geXForm3d::CZ, NULL, and Matrix33::x. Referenced by gePhysicsObject_ApplyGlobalFrameImpulse(), gePhysicsObject_GetInertiaTensorInPhysicsSpace(), gePhysicsObject_GetInertiaTensorInverseInPhysicsSpace(), gePhysicsObject_Integrate(), gePhysicsSystem_EnforceConstraints(), and PhysicsObject_Control().
00042 {
00043 assert(xform != NULL);
00044 assert(m != NULL);
00045
00046 m->x[0][0] = xform->AX; m->x[0][1] = xform->AY; m->x[0][2] = xform->AZ;
00047 m->x[1][0] = xform->BX; m->x[1][1] = xform->BY; m->x[1][2] = xform->BZ;
00048 m->x[2][0] = xform->CX; m->x[2][1] = xform->CY; m->x[2][2] = xform->CZ;
00049 }
|
|
||||||||||||
|
Definition at line 159 of file matrix33.c. References geFloat, Matrix33_Copy(), Matrix33_SetIdentity(), NULL, and Matrix33::x.
00160 {
00161 int i, j, k;
00162 Matrix33 copy;
00163
00164 assert(m != NULL);
00165 assert(inv != NULL);
00166
00167 Matrix33_Copy(m, ©);
00168 Matrix33_SetIdentity(inv);
00169
00170 for (i = 0; i < 3; i++)
00171 {
00172 if (copy.x[i][i] != 1.0f)
00173 {
00174 geFloat divby = copy.x[i][i];
00175
00176 assert(fabs(divby) >= 1e-5);
00177
00178 for (j = 0; j < 3; j++)
00179 {
00180 inv->x[i][j] /= divby;
00181 copy.x[i][j] /= divby;
00182 }
00183 }
00184 for (j = 0; j < 3; j++)
00185 {
00186 if (j != i)
00187 {
00188 if (copy.x[j][i] != 0.0f)
00189 {
00190 geFloat mulby = copy.x[j][i];
00191 for (k = 0; k < 3; k++)
00192 {
00193 copy.x[j][k] -= mulby * copy.x[i][k];
00194 inv->x[j][k] -= mulby * inv->x[i][k];
00195 }
00196 }
00197 }
00198 }
00199 }
00200 }
|
|
||||||||||||
|
Definition at line 82 of file matrix33.c. References NULL, t, and Matrix33::x. Referenced by gePhysicsObject_ApplyGlobalFrameImpulse(), gePhysicsObject_GetInertiaTensorInPhysicsSpace(), gePhysicsObject_GetInertiaTensorInverseInPhysicsSpace(), gePhysicsObject_Integrate(), and gePhysicsSystem_EnforceConstraints().
|
|
||||||||||||
|
Definition at line 29 of file matrix33.c. References NULL, v, and Matrix33::x. Referenced by gePhysicsSystem_EnforceConstraints().
|
|
||||||||||||||||
|
Definition at line 62 of file matrix33.c. References NULL, and Matrix33::x. Referenced by gePhysicsObject_GetInertiaTensorInPhysicsSpace(), gePhysicsObject_GetInertiaTensorInverseInPhysicsSpace(), and gePhysicsSystem_EnforceConstraints().
00063 {
00064 int i, j, k;
00065
00066 assert(m1 != NULL);
00067 assert(m2 != NULL);
00068 assert(res != NULL);
00069
00070 for (i = 0; i < 3; i++)
00071 {
00072 for (j = 0; j < 3; j++)
00073 {
00074 res->x[i][j] = 0.0f;
00075
00076 for (k = 0; k < 3; k++)
00077 res->x[i][j] += m1->x[i][k] * m2->x[k][j];
00078 }
00079 }
00080 }
|
|
||||||||||||||||
|
Definition at line 147 of file matrix33.c. References NULL, s, and Matrix33::x. Referenced by gePhysicsSystem_EnforceConstraints().
|
|
||||||||||||||||
|
Definition at line 51 of file matrix33.c. References NULL, v, geVec3d::X, Matrix33::x, geVec3d::Y, and geVec3d::Z. Referenced by gePhysicsObject_ApplyGlobalFrameImpulse(), gePhysicsObject_Integrate(), gePhysicsSystem_EnforceConstraints(), and PhysicsObject_Control().
00052 {
00053 assert(m != NULL);
00054 assert(v != NULL);
00055 assert(res != NULL);
00056
00057 res->X = m->x[0][0] * v->X + m->x[0][1] * v->Y + m->x[0][2] * v->Z;
00058 res->Y = m->x[1][0] * v->X + m->x[1][1] * v->Y + m->x[1][2] * v->Z;
00059 res->Z = m->x[2][0] * v->X + m->x[2][1] * v->Y + m->x[2][2] * v->Z;
00060 }
|
|
|
Definition at line 106 of file matrix33.c. References NULL, and Matrix33::x. Referenced by gePhysicsObject_Create(), gePhysicsSystem_Create(), and Matrix33_GetInverse().
|
|
||||||||||||||||
|
Definition at line 134 of file matrix33.c. References NULL, and Matrix33::x. Referenced by gePhysicsSystem_EnforceConstraints().
|
1.3.2