Fixed major problem in matrix code

This commit is contained in:
Vincent Hamm 2003-10-01 12:20:27 +00:00
parent 9fa9120f3c
commit 5a2430fd04
5 changed files with 11 additions and 11 deletions

View File

@ -163,16 +163,16 @@ float Matrix3::getRoll()
return roll;
}
void Matrix3::transform( Vector3d v )
void Matrix3::transform( Vector3d* v )
{
float x;
float y;
float z;
x = v.dotProduct( right_.x(), up_.x(), at_.x() );
y = v.dotProduct( right_.x(), up_.x(), at_.x() );
z = v.dotProduct( right_.x(), up_.x(), at_.x() );
x = v->dotProduct( right_.x(), up_.x(), at_.x() );
y = v->dotProduct( right_.x(), up_.x(), at_.x() );
z = v->dotProduct( right_.x(), up_.x(), at_.x() );
v.set( x, y, z );
v->set( x, y, z );
}

View File

@ -40,7 +40,7 @@ public:
float getYaw();
float getRoll();
void transform( Vector3d v );
void transform( Vector3d* v );
// operators
Matrix3& operator *=(const Matrix3& s)

View File

@ -12,7 +12,7 @@ void Matrix4::translate( float x, float y, float z )
v.set( x, y, z );
rot_.transform( v );
rot_.transform( &v );
pos_ += v;
}

View File

@ -42,7 +42,7 @@ public:
Vector3d v;
v = s.pos_;
rot_.transform( v );
rot_.transform( &v );
pos_+=v;

View File

@ -156,7 +156,7 @@ void Model::Mesh::update() {
v.set( *(pVertices), *(pVertices+1), *(pVertices+2) );
tempMatrix.rot_.transform( v );
tempMatrix.rot_.transform( &v );
v+= tempMatrix.pos_;
GLdouble winX;
@ -634,7 +634,7 @@ void Model::Mesh::draw() const {
v.set( *(pVertices), *(pVertices+1), *(pVertices+2) );
tempMatrix.rot_.transform( v );
tempMatrix.rot_.transform( &v );
v+= tempMatrix.pos_;
glVertex3f( v.x(), v.y(), v.z() );
@ -686,7 +686,7 @@ void Model::Mesh::draw() const {
v.set( *(pVertices), *(pVertices+1), *(pVertices+2) );
tempMatrix.rot_.transform( v );
tempMatrix.rot_.transform( &v );
v+= tempMatrix.pos_;
GLdouble winX;