reworked for new wfobj interface

git-svn-id: svn://anubis/dwscr/trunk@122 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
josh committed 2010-10-26 20:08:39 +00:00
1 parent e2e552e338
commit 580597f389
6 files changed
+82 -52

No files matched your search

+4 -3
View File
@@ -11,7 +11,7 @@
#ifndef WITHOUT_ODE
#include <ode/ode.h>
#endif
#include "../wfobj/WFObj.hh"
#include "../wfobj/WFObj.h"
#include "LogoBox.h"
#include "../LoadFile/LoadFile.h"
@@ -21,6 +21,7 @@ using namespace std;
static GLuint _logoList = 0;
static float _logoAABB[6];
static GLuint _drawList;
static LoadFile loadFile;
/* construct a LogoBox object
* The first time the constructor is called it loads the
@@ -38,8 +39,8 @@ LogoBox::LogoBox()
{
if (_logoList == 0)
{
WFObj obj;
if (obj.load("dwlogo.obj", NULL, &LoadFile))
WFObj obj(loadFile);
if (obj.load(FileLoader::Path("", "dwlogo.obj")))
{
_logoList = obj.render(false);
const float * aabb = obj.getAABB();
+20 -20
View File
@@ -27,25 +27,25 @@ void SSMode::update()
/* push an OpenGL matrix onto the matrix stack for a given
* ODE body position and rotation */
void SSMode::pushTransform(const float pos[3], const float R[12])
void SSMode::pushTransform(const dReal pos[3], const dReal R[12])
{
GLfloat matrix[16];
matrix[0] = R[0];
matrix[1] = R[4];
matrix[2] = R[8];
matrix[3] = 0;
matrix[4] = R[1];
matrix[5] = R[5];
matrix[6] = R[9];
matrix[7] = 0;
matrix[8] = R[2];
matrix[9] = R[6];
matrix[10] = R[10];
matrix[11] = 0;
matrix[12] = pos[0];
matrix[13] = pos[1];
matrix[14] = pos[2];
matrix[15] = 1;
glPushMatrix();
glMultMatrixf(matrix);
GLfloat matrix[16];
matrix[0] = R[0];
matrix[1] = R[4];
matrix[2] = R[8];
matrix[3] = 0;
matrix[4] = R[1];
matrix[5] = R[5];
matrix[6] = R[9];
matrix[7] = 0;
matrix[8] = R[2];
matrix[9] = R[6];
matrix[10] = R[10];
matrix[11] = 0;
matrix[12] = pos[0];
matrix[13] = pos[1];
matrix[14] = pos[2];
matrix[15] = 1;
glPushMatrix();
glMultMatrixf(matrix);
}
+2 -1
View File
@@ -9,6 +9,7 @@
#include <SDL.h>
#include <GL/gl.h>
#include <ode/ode.h>
class SSMain;
@@ -20,7 +21,7 @@ public:
SSMode(SSMain * _SSMain);
virtual ~SSMode();
virtual void update();
void pushTransform(const float pos[3], const float R[12]);
void pushTransform(const dReal pos[3], const dReal R[12]);
protected:
SSMain * m_SSMain;