Changeset 1400 for GTP


Ignore:
Timestamp:
09/17/06 23:11:53 (18 years ago)
Author:
giegl
Message:

GTPD - Jungle Rumble - fixed viewport ratio (added Scene::viewPortRatio())

Location:
GTP/trunk/App/Games/Jungle_Rumble
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Games/Jungle_Rumble/src/Camera.cpp

    r1378 r1400  
    44#include "GameManager.h" 
    55 
    6 Camera::Camera(void) : Node() { 
     6//Camera::Camera(void) : Node() { 
     7Camera::Camera(const float ratio) : Node() { 
    78        angle = D3DX_PI/4; 
    89        nearClipping = 0.1f; 
    910        farClipping = 1000.0f; 
    10         ratio = 4.0f/3.0f; 
     11        //ratio = 4.0f/3.0f; 
     12        this->ratio = ratio; 
    1113        updateClippingPlanes(); 
    1214        this->setPosition(0, 50, -15); 
  • GTP/trunk/App/Games/Jungle_Rumble/src/Camera.h

    r1378 r1400  
    88public: 
    99        friend class RenderPass; 
    10         Camera(void); 
     10        Camera(const float ratio); 
    1111        ~Camera(void); 
    1212 
  • GTP/trunk/App/Games/Jungle_Rumble/src/Scene.cpp

    r1396 r1400  
    266266        return this->depth; 
    267267} 
     268 
     269float Scene::viewPortRatio() 
     270{ 
     271        //return float(this->width) / this->height; 
     272        return float(this->manager->screenWidth)/this->manager->screenHeight; 
     273} 
     274 
    268275 
    269276Camera* Scene::getActiveCamera() 
     
    461468void Scene::doFrustumCulling() 
    462469{ 
    463         Camera cam; 
     470        Camera cam(this->viewPortRatio()); 
    464471        cam.setViewMatrix(*this->activeRenderPass->getViewMatrix()); 
    465472        cam.setProjectionMatrix(*this->activeRenderPass->getProjectionMatrix()); 
     
    750757                case NODE_CAMERA: 
    751758                        { 
    752                                 SPTR<Node> node(new Camera); 
     759                                //SPTR<Node> node(new Camera); 
     760                                SPTR<Node> node(new Camera(this->viewPortRatio())); // MG 
    753761                                if(!isReference) { 
    754762                                        father.addChild(node); 
  • GTP/trunk/App/Games/Jungle_Rumble/src/Scene.h

    r1378 r1400  
    7272        float getHeight(); 
    7373        float getDepth(); 
     74        float viewPortRatio(); // MG 
    7475        virtual void clearScene(); 
    7576 
Note: See TracChangeset for help on using the changeset viewer.