Changeset 10404 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 27, 2007, 2:20:24 PM (18 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/blackscreen.cc
r10403 r10404 23 23 #include "material.h" 24 24 #include "state.h" 25 #include "camera.h"26 #include " static_model.h"25 // #include "camera.h" 26 #include "primitive_model.h" 27 27 28 28 ObjectListDefinition(BlackScreen); … … 74 74 this->material->setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 75 75 76 this->build(); 76 PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, 6., 10); 77 this->setModel(model); 77 78 78 79 i=0; … … 101 102 glEnable(GL_BLEND); // Turn Blending On 102 103 103 glMatrixMode(GL_MODELVIEW);104 glPushMatrix();105 /* translate */106 glTranslatef (this->getAbsCoor ().x,107 this->getAbsCoor ().y,108 this->getAbsCoor ().z);109 Vector tmpRot = this->getAbsDir().getSpacialAxis();110 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );104 // glMatrixMode(GL_MODELVIEW); 105 // glPushMatrix(); 106 // /* translate */ 107 // glTranslatef (this->getAbsCoor ().x, 108 // this->getAbsCoor ().y, 109 // this->getAbsCoor ().z); 110 // Vector tmpRot = this->getAbsDir().getSpacialAxis(); 111 // glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 111 112 112 113 this->material->select(); … … 139 140 140 141 this->material->setTransparency(i); 141 Camera* cam = State::getCamera();142 if( cam != NULL)143 this->setParent(cam);142 // Camera* cam = State::getCamera(); 143 // if( cam != NULL) 144 // this->setParent(cam); 144 145 } 145 146 … … 188 189 return 0; 189 190 } 190 191 192 void BlackScreen::build()193 {194 StaticModel* model = new StaticModel();195 196 float size = 10.;197 198 model->addVertex (-size, -size, size);199 model->addVertex (size, -size, size);200 model->addVertex (-size, size, size);201 model->addVertex (size, size, size);202 model->addVertex (-size, size, -size);203 model->addVertex (size, size, -size);204 model->addVertex (-size, -size, -size);205 model->addVertex (size, -size, -size);206 207 208 model->addVertexNormal (0.0, 0.0, 1.0);209 model->addVertexNormal (0.0, 1.0, 0.0);210 model->addVertexNormal (0.0, 0.0, -1.0);211 model->addVertexNormal (0.0, -1.0, 0.0);212 model->addVertexNormal (1.0, 0.0, 0.0);213 model->addVertexNormal (-1.0, 0.0, 0.0);214 215 model->addVertexTexture (0.0, 1.0);216 model->addVertexTexture (1.0, 1.0);217 model->addVertexTexture (1.0, 0.0);218 model->addVertexTexture (0.0, 0.0);219 220 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back221 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,5); // front222 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,1, 7,1,1, 1,2,1, 0,3,1); // bottom223 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,0,3, 3,1,3, 5,2,3, 4,3,3); // top224 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,2, 5,3,2, 7,0,2, 6,1,2); // left225 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,0, 3,2,0, 2,3,0); // right226 227 model->finalize();228 229 this->setModel(model);230 } -
trunk/src/world_entities/blackscreen.h
r10403 r10404 36 36 virtual void draw() const; 37 37 38 private:39 void build();40 38 41 39 }; -
trunk/src/world_entities/cameraman.cc
r10403 r10404 22 22 #include "script_class.h" 23 23 #include "loading/load_param_xml.h" 24 #include "blackscreen.h" 25 #include "p_node.h" 26 #include "camera.h" 24 27 25 28 ObjectListDefinition(CameraMan); 29 30 SHELL_COMMAND(camerainfo, CameraMan, cameraInfo); 26 31 27 32 … … 207 212 208 213 214 void CameraMan::cameraInfo() 215 { 216 bool sameCam = (this->currentCam == State::getCamera()); 217 218 219 PRINT(0)("==== CameraMan::cameraInfo ===\n"); 220 PRINT(0)("= Camera Name: %s\n", this->currentCam->getName().c_str()); 221 PRINT(0)("= Tests:\n"); 222 PRINT(0)("== State::Cam == this::Cam %i\n", sameCam); 223 PRINT(0)("== Parenting Informations:\n"); 224 this->currentCam->debugNode(10); 225 PRINT(0)("==============================\n"); 226 } 227 228 229 float CameraMan::getCurrCameraCoorX() 230 { return this->currentCam->getAbsCoorX(); } 231 232 float CameraMan::getCurrCameraCoorY() 233 { return this->currentCam->getAbsCoorY(); } 234 235 float CameraMan::getCurrCameraCoorZ() 236 { return this->currentCam->getAbsCoorZ(); } 237 238 239 209 240 //how to get a class fkt pointer 210 241 -
trunk/src/world_entities/cameraman.h
r10403 r10404 2 2 #define _CAMERAMAN_H 3 3 4 #include "p_node.h" 5 #include "camera.h" 4 6 5 #include <vector> 7 6 #include "base_object.h" 8 #include "blackscreen.h" 7 8 class BlackScreen; 9 class Camera; 10 class PNode; 9 11 10 12 class CameraMan : public BaseObject { … … 37 39 void togglFade(); 38 40 41 void cameraInfo(); 42 39 43 /// LOADING 40 44 virtual void loadParams(const TiXmlElement* root); 41 45 42 46 /// POLLING 43 float getCurrCameraCoorX() { return this->currentCam->getAbsCoorX(); }44 float getCurrCameraCoorY() { return this->currentCam->getAbsCoorY(); }45 float getCurrCameraCoorZ() { return this->currentCam->getAbsCoorZ(); }47 float getCurrCameraCoorX(); 48 float getCurrCameraCoorY(); 49 float getCurrCameraCoorZ(); 46 50 bool cameraIsInVector(Camera* camera); 47 51 -
trunk/src/world_entities/sound_entity.cc
r10403 r10404 22 22 23 23 #include "sound/resource_sound_buffer.h" 24 24 25 25 26
Note: See TracChangeset
for help on using the changeset viewer.