|
From: Mike D. <o3d...@us...> - 2004-08-18 14:53:29
|
Update of /cvsroot/grappelmann/spaceplane In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27856 Modified Files: material.cpp model_loader.cpp scene_object.cpp scene_object.h Log Message: - fixed material problems Index: scene_object.cpp =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/scene_object.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** scene_object.cpp 17 Aug 2004 18:21:43 -0000 1.5 --- scene_object.cpp 18 Aug 2004 14:53:17 -0000 1.6 *************** *** 5,8 **** --- 5,9 ---- #include "scene_object.h" + #include "material.h" SceneObject::SceneObject(SceneObject* parent) *************** *** 15,21 **** } bool SceneObject::addChild(SceneObject* child) { m_children.push_back(child); ! return true; } --- 16,33 ---- } + bool SceneObject::addChild(Material* child) { + cerr << "<SceneObject::addChild>\tmaterial add called, adding to front" << endl; + m_children.insert(m_children.begin(), (SceneObject*)child); + + return true; + } + bool SceneObject::addChild(SceneObject* child) { + if(dynamic_cast<Material*>(child) != NULL) { + cerr << "<SceneObject::addChild>\tmaterial add called, adding to front" << endl; + m_children.insert(m_children.begin(), (SceneObject*)child); + } else { m_children.push_back(child); ! } return true; } *************** *** 101,104 **** --- 113,119 ---- /* $Log$ + Revision 1.6 2004/08/18 14:53:17 o3dozone + - fixed material problems + Revision 1.5 2004/08/17 18:21:43 o3dozone Index: scene_object.h =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/scene_object.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** scene_object.h 25 Jul 2004 10:35:59 -0000 1.4 --- scene_object.h 18 Aug 2004 14:53:17 -0000 1.5 *************** *** 13,16 **** --- 13,19 ---- #include "opengl_includes.h" + // avoid the nasty circular dependencies for now + class Material; + using namespace std; *************** *** 20,23 **** --- 23,27 ---- virtual ~SceneObject(); + bool addChild(Material* child); bool addChild(SceneObject* child); bool makeDisplayList(); *************** *** 39,42 **** --- 43,49 ---- /* $Log$ + Revision 1.5 2004/08/18 14:53:17 o3dozone + - fixed material problems + Revision 1.4 2004/07/25 10:35:59 o3dozone - added material and transform nodes Index: material.cpp =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/material.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** material.cpp 17 Aug 2004 18:21:43 -0000 1.2 --- material.cpp 18 Aug 2004 14:53:17 -0000 1.3 *************** *** 54,58 **** GLfloat mat_diffuse[] = { m_diffuse[0], m_diffuse[1], m_diffuse[2], 1.0 }; GLfloat mat_emission[] = { m_emission[0], m_emission[1], m_emission[2], 1.0 }; ! /* glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); --- 54,58 ---- GLfloat mat_diffuse[] = { m_diffuse[0], m_diffuse[1], m_diffuse[2], 1.0 }; GLfloat mat_emission[] = { m_emission[0], m_emission[1], m_emission[2], 1.0 }; ! glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); *************** *** 60,65 **** glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); ! */ ! drawChildren(); --- 60,64 ---- glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); ! drawChildren(); *************** *** 69,72 **** --- 68,74 ---- /* $Log$ + Revision 1.3 2004/08/18 14:53:17 o3dozone + - fixed material problems + Revision 1.2 2004/08/17 18:21:43 o3dozone Index: model_loader.cpp =================================================================== RCS file: /cvsroot/grappelmann/spaceplane/model_loader.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** model_loader.cpp 15 Aug 2004 21:07:35 -0000 1.6 --- model_loader.cpp 18 Aug 2004 14:53:17 -0000 1.7 *************** *** 297,304 **** assert(scaleElements.size() == 3); ! rotation.m_x = rotationElements[0]; ! rotation.m_y = rotationElements[1]; ! rotation.m_z = rotationElements[2]; ! rotationSize = rotationElements[3]; cout << "rotation size [" << rotationSize << "] x [" << rotation.m_x << "] y [" << rotation.m_y << "] z [" << rotation.m_z << "]" << endl; --- 297,305 ---- assert(scaleElements.size() == 3); ! int curIndex = 0; ! rotation.m_x = rotationElements[curIndex++]; ! rotation.m_y = rotationElements[curIndex++]; ! rotation.m_z = rotationElements[curIndex++]; ! rotationSize = rotationElements[curIndex++]; cout << "rotation size [" << rotationSize << "] x [" << rotation.m_x << "] y [" << rotation.m_y << "] z [" << rotation.m_z << "]" << endl; *************** *** 528,531 **** --- 529,535 ---- /* $Log$ + Revision 1.7 2004/08/18 14:53:17 o3dozone + - fixed material problems + Revision 1.6 2004/08/15 21:07:35 o3dozone - added scale operation |