Changeset 7009 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Feb 3, 2006, 12:14:32 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/camera.cc
r6999 r7009 145 145 void Camera::tick(float dt) 146 146 { 147 //update frustum plane 148 this->viewVector = this->getAbsCoor() - this->target->getAbsCoor(); 149 this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + Vector(-70.0,0.0,0.0)); 150 151 this->upVector = this->getAbsDirV(); 152 153 147 154 float tmpFovy = (this->toFovy - this->fovy) ; 148 155 if (tmpFovy > 0.01) … … 173 180 Vector cameraPosition = this->getAbsCoor(); 174 181 Vector targetPosition = this->target->getAbsCoor(); 175 Vector up = this->getAbsDirV();176 Vector delay = Vector(0, 0, 0);177 //if( currentMode != VIEW_FRONT) delay = (this->target->getVelocity()) / 25.0f;178 182 179 183 // Setting the Camera Eye, lookAt and up Vectors 180 gluLookAt(cameraPosition.x - delay.x, cameraPosition.y - delay.y, cameraPosition.z - delay.z,184 gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z, 181 185 targetPosition.x, targetPosition.y, targetPosition.z, 182 up.x, up.y, up.z);186 this->upVector.x, this->upVector.y, this->upVector.z); 183 187 184 188 -
trunk/src/world_entities/camera.h
r6999 r7009 9 9 #include "p_node.h" 10 10 #include "event_listener.h" 11 #include "plane.h" 11 12 12 13 class World; … … 43 44 44 45 void setViewMode(ViewMode mode); 46 inline const Vector& getViewVector() const { return this->viewVector; } 47 inline const Vector& getUpVector() const { return this->upVector; } 48 inline const Plane& getViewFrustum() const { return this->frustumPlane; } 49 50 45 51 void tick(float dt); 46 52 void apply (); … … 60 66 61 67 Vector delay; 68 Plane frustumPlane; //!< plane that marks the view frustum 69 Vector viewVector; //!< the direction of the camera view 70 Vector upVector; //!< direction of the up vector 62 71 }; 63 72
Note: See TracChangeset
for help on using the changeset viewer.