Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2006, 11:33:10 PM (19 years ago)
Author:
patrick
Message:

branches: added new branche terrain copy of trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc

    r8534 r8693  
    4141#include "world_entity.h"
    4242
     43#include "aabb.h"
     44
    4345#include "util/loading/load_param.h"
    4446#include "util/loading/factory.h"
     
    942944  this->outputFraction = 1.0f;
    943945
    944 
    945 
    946 
    947   Vector forwardDir = worldEntity->getAbsDirX();
    948   forwardDir = forwardDir * 8.0f;
    949 
    950   Vector upDir = worldEntity->getAbsDirY();
    951   upDir.x = 0.0;
    952   upDir.y = 1.0;
    953   upDir.z = 0.0;
     946  AABB* box = worldEntity->getModelAABB();
     947
     948
     949  Vector forwardDir;
     950  Vector upDir;
    954951  Vector dest;
    955   /*
    956   dest.x  += forwardDir.x;
    957   dest.y  += forwardDir.y;
    958   dest.z  += forwardDir.z;
    959   */
    960   Vector position = worldEntity->getAbsCoor() + upDir*5.0f ;
    961   dest = worldEntity->getAbsCoor() - upDir*40.0f; //
    962   Vector out = dest;
     952  Vector position;
     953  Vector out;
     954
     955  if( box != NULL)
     956  {
     957    forwardDir = worldEntity->getAbsDirX();
     958    forwardDir = forwardDir * 8.0f;
     959
     960    upDir = worldEntity->getAbsDirY();
     961    upDir.x = 0.0;
     962    upDir.y = 1.0;
     963    upDir.z = 0.0;
     964    dest;
     965
     966    position = worldEntity->getAbsCoor() + box->center + box->axis[1] * box->halfLength[1];
     967    dest     = worldEntity->getAbsCoor() + box->center - box->axis[1] * box->halfLength[1];
     968    out = dest;
     969
     970  }
     971  else
     972  {
     973    forwardDir = worldEntity->getAbsDirX();
     974    forwardDir = forwardDir * 8.0f;
     975
     976    upDir = worldEntity->getAbsDirY();
     977    upDir.x = 0.0;
     978    upDir.y = 1.0;
     979    upDir.z = 0.0;
     980    dest;
     981
     982    position = worldEntity->getAbsCoor() + upDir*5.0f;
     983    dest = worldEntity->getAbsCoor() - upDir*40.0f; //
     984    out = dest;
     985
     986  }
    963987
    964988
Note: See TracChangeset for help on using the changeset viewer.