Changeset 7014 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Feb 3, 2006, 2:14:22 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/camera.cc
r7013 r7014 65 65 * @returns The PNode of the Target (from there you can get position and so on 66 66 */ 67 PNode* Camera::getTarget ()67 PNode* Camera::getTargetNode() const 68 68 { 69 69 return (PNode*)this->target; … … 146 146 { 147 147 //update frustum plane 148 this->viewVector = (this-> getAbsCoor() - this->target->getAbsCoor()).getNormalized();149 this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + this->viewVector * 3.0);148 this->viewVector = (this->target->getAbsCoor() - this->getAbsCoor()).getNormalized(); 149 this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + this->viewVector * 0.1); 150 150 151 151 this->upVector = this->getAbsDirV(); -
trunk/src/world_entities/camera.h
r7013 r7014 37 37 38 38 void lookAt(PNode* target); 39 PNode* getTarget(); 39 CameraTarget* getTarget() const { return this->target; }; 40 PNode* getTargetNode() const; 40 41 41 42 void setAspectRatio(float aspectRatio); -
trunk/src/world_entities/creatures/md2_creature.cc
r6990 r7014 119 119 this->cameraConnNode.setName("CameraConnectorNode"); 120 120 this->addChild(&this->cameraConnNode); 121 this->cameraConnNode.addChild(State::getCameraTarget ());122 this->cameraConnNode.addChild(State::getCamera ());123 State::getCameraTarget ()->setRelCoor(10,0,0);121 this->cameraConnNode.addChild(State::getCameraTargetNode()); 122 this->cameraConnNode.addChild(State::getCameraNode()); 123 State::getCameraTargetNode()->setRelCoor(10,0,0); 124 124 125 125 travelSpeed = 15.0; -
trunk/src/world_entities/playable.cc
r7010 r7014 285 285 void Playable::attachCamera() 286 286 { 287 State::getCamera ()->setParentSoft(this);288 State::getCameraTarget ()->setParentSoft(this);287 State::getCameraNode()->setParentSoft(this); 288 State::getCameraTargetNode()->setParentSoft(this); 289 289 290 290 } -
trunk/src/world_entities/space_ships/helicopter.cc
r6997 r7014 203 203 { 204 204 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true); 205 State::getCamera ()->setParentSoft(this->getWeaponManager()->getFixedTarget());206 State::getCameraTarget ()->setParentSoft(this->getWeaponManager()->getFixedTarget());205 State::getCameraNode()->setParentSoft(this->getWeaponManager()->getFixedTarget()); 206 State::getCameraTargetNode()->setParentSoft(this->getWeaponManager()->getFixedTarget()); 207 207 } 208 208 -
trunk/src/world_entities/space_ships/hover.cc
r6999 r7014 192 192 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true); 193 193 194 State::getCamera ()->setParentSoft(&this->cameraNode);195 State::getCamera ()->setRelCoorSoft(-10, 0,0);196 State::getCameraTarget ()->setParentSoft(&this->cameraNode);194 State::getCameraNode()->setParentSoft(&this->cameraNode); 195 State::getCameraNode()->setRelCoorSoft(-10, 0,0); 196 State::getCameraTargetNode()->setParentSoft(&this->cameraNode); 197 197 } 198 198 -
trunk/src/world_entities/space_ships/turbine_hover.cc
r7004 r7014 222 222 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true); 223 223 224 State::getCamera ()->setParentSoft(&this->cameraNode);225 State::getCamera ()->setRelCoorSoft(-10, 0,0);226 State::getCameraTarget ()->setParentSoft(&this->cameraNode);224 State::getCameraNode()->setParentSoft(&this->cameraNode); 225 State::getCameraNode()->setRelCoorSoft(-10, 0,0); 226 State::getCameraTargetNode()->setParentSoft(&this->cameraNode); 227 227 } 228 228 -
trunk/src/world_entities/terrain.cc
r6956 r7014 241 241 glPushMatrix(); 242 242 glLoadIdentity(); 243 Vector camera = State::getCamera ()->getAbsCoor(); // Go on here ..........!!!243 Vector camera = State::getCameraNode()->getAbsCoor(); // Go on here ..........!!! 244 244 245 245 /* -
trunk/src/world_entities/world_entity.cc
r6959 r7014 30 30 31 31 #include "state.h" 32 #include "camera.h" 32 33 33 34 using namespace std; … … 319 320 320 321 // This Draws the LOD's 321 float cameraDistance = (State::getCamera()->getAbsCoor() - this->getAbsCoor()).len(); 322 float cameraDistance = State::getCamera()->distance(this); 323 printf("%s::%s, distance %f\n", this->getClassName(), this->getName(), cameraDistance); 322 324 if (cameraDistance > 30 && this->models.size() >= 3 && this->models[2] != NULL) 323 325 {
Note: See TracChangeset
for help on using the changeset viewer.