Changeset 2495 for GTP/trunk


Ignore:
Timestamp:
07/02/07 20:26:26 (17 years ago)
Author:
szirmay
Message:
 
Location:
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreRenderable.cpp

    r2475 r2495  
    135135                 boundingBox = parentEntity->getWorldBoundingBox(true); 
    136136                  
    137                  Vector3 center = (boundingBox.getMaximum() + boundingBox.getMaximum()) / 2.0; 
     137                 Vector3 center = (boundingBox.getMaximum() + boundingBox.getMinimum()) / 2.0; 
    138138                 float radius = (center - boundingBox.getMaximum()).length(); 
    139139                 boundingSphere.setRadius(radius); 
    140140                 boundingSphere.setCenter(center); 
    141                  //boundingSphere = parentEntity->getWorldBoundingSphere(true);  
     141                // boundingSphere = parentEntity->getWorldBoundingSphere(true);  
    142142                 break; 
    143143         } 
  • GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp

    r2333 r2495  
    9696        light = *(list.begin()); 
    9797 
     98        sharedRuns->updateBounds(); 
     99 
    98100        if(light!= 0) 
    99101        { 
     
    103105                        photonMapCamera->setDirection( dir ); 
    104106                        Real r = sharedRuns->getRootBoundingSphere(ILLUMRUN_PHOTONMAP).getRadius(); 
    105                         photonMapCamera->setPosition( sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP) - dir * r); 
     107                        Vector3 center = sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP); 
     108                        photonMapCamera->setPosition( center - dir * r); 
    106109                        photonMapCamera->setProjectionType(PT_ORTHOGRAPHIC); 
    107110                        Matrix4 proj; 
     
    114117                {                        
    115118                        Vector3 pos = light->getDerivedPosition(); 
    116                         Vector3 dir = sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP) - pos; 
     119                        Vector3 center = sharedRuns->getRootPosition(ILLUMRUN_PHOTONMAP); 
     120                        Vector3 dir = center - pos; 
    117121                        Real r = sharedRuns->getRootBoundingSphere(ILLUMRUN_PHOTONMAP).getRadius(); 
    118122                        Real d = dir.length(); 
Note: See TracChangeset for help on using the changeset viewer.