mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
Fixed major problem in matrix code
This commit is contained in:
parent
9fa9120f3c
commit
5a2430fd04
10
matrix3.cpp
10
matrix3.cpp
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
float getYaw();
|
||||
float getRoll();
|
||||
|
||||
void transform( Vector3d v );
|
||||
void transform( Vector3d* v );
|
||||
|
||||
// operators
|
||||
Matrix3& operator *=(const Matrix3& s)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
Vector3d v;
|
||||
|
||||
v = s.pos_;
|
||||
rot_.transform( v );
|
||||
rot_.transform( &v );
|
||||
|
||||
pos_+=v;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user