Changeset 20530

Show
Ignore:
Timestamp:
07/09/07 20:13:49 (1 year ago)
Author:
patrick
Message:

MFT r20514: Improve const correctness. Reduce header file pollution.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryBoxCollide.cpp

    r19729 r20530  
    2929const int pfTerryBoxCollide::COLLIDE_SEGMENTS( 8 ); 
    3030 
    31 pfTerryBoxCollide::pfTerryBoxCollide( int isectMask
     31pfTerryBoxCollide::pfTerryBoxCollide(const int isectMask
    3232{ 
    3333   mUnitBox[0] = pfVec3(0.57735f, 0.57735f, 0.57735f); 
     
    5656// needs to match every node tht you want to intersect with 
    5757// read the performer docs for more info (see pfNode, or pfGeoSet::isect function) 
    58 void pfTerryBoxCollide::setup( const int& isectMask
     58void pfTerryBoxCollide::setup(const int isectMask
    5959{ 
    6060   mCollideVolume.isectMask = isectMask; 
     
    6262 
    6363//  Effectively sets the radius of your bounding volume (box/sphere) 
    64 void pfTerryBoxCollide::setRadius( float radius
     64void pfTerryBoxCollide::setRadius(const float radius
    6565{ 
    6666   int i; 
     
    7272} 
    7373 
    74 void pfTerryBoxCollide::setVelocity( pfVec3 velocityVec
     74void pfTerryBoxCollide::setVelocity(const pfVec3& velocityVec
    7575{ 
    7676   int i; 
     
    9696} 
    9797 
    98 int pfTerryBoxCollide::collide(pfVec3& correction, pfNode* objNode, pfVec3 pos ) 
     98int pfTerryBoxCollide::collide(pfVec3& correction, pfNode* objNode, 
     99                               const pfVec3& pos) 
    99100{    
    100101   int i, j, returnval = 0; 
  • juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryBoxCollide.h

    r19729 r20530  
    5050   pfVec3                  mUnitBox[8]; 
    5151       
    52    pfTerryBoxCollide( int isectMask = 0x01 ); 
     52   pfTerryBoxCollide(const int isectMask = 0x01); 
    5353 
    5454   // set the intersect mask of this volume 
     
    5757   // (see pfNode, or pfGeoSet::isect function 
    5858   // NOTE: probably the same mask you used in nodeSetup 
    59    void setup( const int& isectMask );  
     59   void setup(const int isectMask); 
    6060    
    6161   // set the radius of the simulated box/sphere volume 
    62    void setRadius(float radius); 
     62   void setRadius(const float radius); 
    6363    
    64    void setVelocity( pfVec3 velocityVec ); 
     64   void setVelocity(const pfVec3& velocityVec); 
    6565    
    6666   //: To collide with objects using the simulated volume 
     
    8282   // NOTE: before calling this function call setRadius(radius of volume)  
    8383   //       first 
    84    int collide( pfVec3 &bounce, pfNode *objNode, pfVec3 pos); 
     84   int collide(pfVec3& bounce, pfNode *objNode, const pfVec3& pos); 
    8585}; 
    8686 
  • juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryCollide.cpp

    r19729 r20530  
    2525 *************** <auto-copyright.pl END do not edit this line> ***************/ 
    2626 
     27#include <Performer/pr.h> 
     28#include <Performer/pr/pfGeoSet.h> 
     29#include <Performer/pfutil.h> 
     30 
    2731#include "pfTerryCollide.h" 
    2832 
     
    3034// intersection mask. Cache normals and such inside geosets if the geometry 
    3135// is static, but not if it is dynamic, i.e., its vertices change. 
    32 void pfTerryCollide::nodeSetup( pfNode *node, int mode, int mask
     36void pfTerryCollide::nodeSetup(pfNode *node, const int mode, const int mask
    3337{ 
    3438   int fullmode; 
  • juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryCollide.h

    r19729 r20530  
    3030#include <Performer/pf.h> 
    3131#include <Performer/pf/pfNode.h> 
    32 #include <Performer/pr.h> 
    33 #include <Performer/pr/pfGeoSet.h> 
    34 #include <Performer/pfutil.h> 
    35 #include <iostream> 
    36 #include <math.h> 
    3732 
    3833/////////////////////////////////////////////////////////////////////////////////// 
     
    5954   // This function is not necessary if you don't want to 
    6055   // distinguish different geometry using different masks. 
    61    void nodeSetup( pfNode* node, int mode, int mask ); 
     56   void nodeSetup(pfNode* node, const int mode, const int mask); 
    6257    
    6358   // data structure to get intersection result back from pfHit::mQuery 
  • juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryPogoCollide.cpp

    r19729 r20530  
    2525 *************** <auto-copyright.pl END do not edit this line> ***************/ 
    2626 
     27#include <Performer/pr.h> 
     28#include <Performer/pr/pfGeoSet.h> 
     29#include <Performer/pfutil.h> 
     30#include <iostream> 
     31#include <math.h> 
     32 
    2733#include "pfTerryPogoCollide.h" 
    2834 
     
    4349//                  that would normally be comfortable height for a human to step. 
    4450// heightAboveYourFeet is the length from posAboveYourFeet to your feet 
    45 bool pfTerryPogoCollide::collide( pfVec3& correction, pfNode *objNode, int mask, pfVec3 posAboveYourFeet, float heightAboveYourFeet ) 
     51bool pfTerryPogoCollide::collide(pfVec3& correction, pfNode* objNode, 
     52                                 const int mask, 
     53                                 const pfVec3& posAboveYourFeet, 
     54                                 const float heightAboveYourFeet) 
    4655{ 
    4756    pfHit **hit[1]; 
     
    8392} 
    8493 
    85  
    86  
    87 bool pfTerryPogoCollide::collideRide( pfVec3 &bounce, pfVec3 &ridexyz, pfVec3 &ridehpr, pfNode *objNode, int mask, pfVec3 pos, float length ) 
     94bool pfTerryPogoCollide::collideRide(pfVec3& bounce, pfVec3& ridexyz, 
     95                                     pfVec3& ridehpr, pfNode* objNode, 
     96                                     const int mask, pfVec3 pos, 
     97                                     const float length) 
    8898{ 
    8999   pfHit** hit[1]; 
  • juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryPogoCollide.h

    r19729 r20530  
    3030#include <Performer/pf.h> 
    3131#include <Performer/pf/pfNode.h> 
    32 #include <Performer/pr.h> 
    33 #include <Performer/pr/pfGeoSet.h> 
    34 #include <Performer/pfutil.h> 
    35 #include <iostream> 
    36 #include <math.h> 
    3732 
    3833#include "pfTerryCollide.h" // my base class 
     
    6156   //                  that would normally be comfortable height for a human to step. 
    6257   // heightAboveYourFeet is the length from posAboveYourFeet to your feet 
    63    bool collide( pfVec3& correction, pfNode *objNode, int mask, pfVec3 posAboveYourFeet, float heightAboveYourFeet ); 
     58   bool collide(pfVec3& correction, pfNode *objNode, const int mask, 
     59                const pfVec3& posAboveYourFeet, 
     60                const float heightAboveYourFeet); 
    6461 
    6562   //: collideRide(displacement vector, position 
     
    7572   // from the rotation offset.  The vector stores an hpr, but 
    7673   // the pitch and roll probably won't be useful. 
    77    bool collideRide( pfVec3 &bounce, pfVec3 &ridexyz, pfVec3 &ridehpr, pfNode *objNode, int mask, pfVec3 pos, float length ); 
     74   bool collideRide(pfVec3& bounce, pfVec3& ridexyz, pfVec3& ridehpr, 
     75                    pfNode* objNode, const int mask, pfVec3 pos, 
     76                    const float length); 
    7877}; 
    7978