fix compile under linux
This commit is contained in:
parent
f615a07c35
commit
f415db4f87
5 changed files with 19 additions and 14 deletions
3
Makefile
3
Makefile
|
@ -5,7 +5,8 @@ LIBS = -lSDL -lGL -lGLU -Llua/lib -llua -llualib `sdl-config --libs`
|
||||||
|
|
||||||
OBJS = main.o lab.o bitmap.o model.o resource.o material.o debug.o \
|
OBJS = main.o lab.o bitmap.o model.o resource.o material.o debug.o \
|
||||||
textsplit.o lua.o registry.o localize.o scene.o engine.o actor.o \
|
textsplit.o lua.o registry.o localize.o scene.o engine.o actor.o \
|
||||||
sound.o mixer.o keyframe.o costume.o walkplane.o textobject.o
|
sound.o mixer.o keyframe.o costume.o walkplane.o textobject.o \
|
||||||
|
matrix3.o matrix4.o
|
||||||
|
|
||||||
DEPS = $(OBJS:.o=.d)
|
DEPS = $(OBJS:.o=.d)
|
||||||
|
|
||||||
|
|
11
matrix3.cpp
11
matrix3.cpp
|
@ -1,14 +1,14 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "matrix3.h"
|
#include "matrix3.h"
|
||||||
|
|
||||||
Matrix3::setAsIdentity( void )
|
void Matrix3::setAsIdentity( void )
|
||||||
{
|
{
|
||||||
right_.set(1.f, 0.f, 0.f);
|
right_.set(1.f, 0.f, 0.f);
|
||||||
up_.set(0.f, 1.f, 0.f);
|
up_.set(0.f, 1.f, 0.f);
|
||||||
at_.set(0.f, 0.f, 0.f);
|
at_.set(0.f, 0.f, 0.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
Matrix3::buildFromPitchYawRoll( float pitch, float yaw, float roll )
|
void Matrix3::buildFromPitchYawRoll( float pitch, float yaw, float roll )
|
||||||
{
|
{
|
||||||
Matrix3 temp1, temp2;
|
Matrix3 temp1, temp2;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ float DegreeToRadian( float degrees )
|
||||||
}
|
}
|
||||||
|
|
||||||
// right
|
// right
|
||||||
Matrix3::constructAroundPitch( float pitch )
|
void Matrix3::constructAroundPitch( float pitch )
|
||||||
{
|
{
|
||||||
float cosa;
|
float cosa;
|
||||||
float sina;
|
float sina;
|
||||||
|
@ -51,7 +51,7 @@ Matrix3::constructAroundPitch( float pitch )
|
||||||
}
|
}
|
||||||
|
|
||||||
// up
|
// up
|
||||||
Matrix3::constructAroundYaw( float yaw )
|
void Matrix3::constructAroundYaw( float yaw )
|
||||||
{
|
{
|
||||||
float cosa;
|
float cosa;
|
||||||
float sina;
|
float sina;
|
||||||
|
@ -65,7 +65,7 @@ Matrix3::constructAroundYaw( float yaw )
|
||||||
}
|
}
|
||||||
|
|
||||||
// at
|
// at
|
||||||
Matrix3::constructAroundRoll( float roll )
|
void Matrix3::constructAroundRoll( float roll )
|
||||||
{
|
{
|
||||||
float cosa;
|
float cosa;
|
||||||
float sina;
|
float sina;
|
||||||
|
@ -175,3 +175,4 @@ void Matrix3::transform( Vector3d v )
|
||||||
|
|
||||||
v.set( x, y, z );
|
v.set( x, y, z );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
matrix3.h
13
matrix3.h
|
@ -27,12 +27,12 @@ public:
|
||||||
Vector3d up_;
|
Vector3d up_;
|
||||||
Vector3d at_;
|
Vector3d at_;
|
||||||
|
|
||||||
buildFromPitchYawRoll( float pitch, float yaw, float roll );
|
void buildFromPitchYawRoll( float pitch, float yaw, float roll );
|
||||||
setAsIdentity(void);
|
void setAsIdentity(void);
|
||||||
|
|
||||||
constructAroundPitch( float pitch );
|
void constructAroundPitch( float pitch );
|
||||||
constructAroundYaw( float pitch );
|
void constructAroundYaw( float pitch );
|
||||||
constructAroundRoll( float pitch );
|
void constructAroundRoll( float pitch );
|
||||||
|
|
||||||
void getPitchYawRoll( float* pPitch, float* pYaw, float* pRoll );
|
void getPitchYawRoll( float* pPitch, float* pYaw, float* pRoll );
|
||||||
|
|
||||||
|
@ -79,4 +79,5 @@ public:
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MATRIX_HH
|
#endif // MATRIX_HH
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,5 @@ void Matrix4::translate( float x, float y, float z )
|
||||||
rot_.transform( v );
|
rot_.transform( v );
|
||||||
|
|
||||||
pos_ += v;
|
pos_ += v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,4 +56,5 @@ public:
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MATRIX_HH
|
#endif // MATRIX_HH
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue