Changeset 20530
- Timestamp:
- 07/09/07 20:13:49 (1 year ago)
- Files:
-
- juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryBoxCollide.cpp (modified) (5 diffs)
- juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryBoxCollide.h (modified) (3 diffs)
- juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryCollide.cpp (modified) (2 diffs)
- juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryCollide.h (modified) (2 diffs)
- juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryPogoCollide.cpp (modified) (3 diffs)
- juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryPogoCollide.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryBoxCollide.cpp
r19729 r20530 29 29 const int pfTerryBoxCollide::COLLIDE_SEGMENTS( 8 ); 30 30 31 pfTerryBoxCollide::pfTerryBoxCollide( int isectMask)31 pfTerryBoxCollide::pfTerryBoxCollide(const int isectMask) 32 32 { 33 33 mUnitBox[0] = pfVec3(0.57735f, 0.57735f, 0.57735f); … … 56 56 // needs to match every node tht you want to intersect with 57 57 // read the performer docs for more info (see pfNode, or pfGeoSet::isect function) 58 void pfTerryBoxCollide::setup( const int& isectMask)58 void pfTerryBoxCollide::setup(const int isectMask) 59 59 { 60 60 mCollideVolume.isectMask = isectMask; … … 62 62 63 63 // Effectively sets the radius of your bounding volume (box/sphere) 64 void pfTerryBoxCollide::setRadius( float radius)64 void pfTerryBoxCollide::setRadius(const float radius) 65 65 { 66 66 int i; … … 72 72 } 73 73 74 void pfTerryBoxCollide::setVelocity( pfVec3 velocityVec)74 void pfTerryBoxCollide::setVelocity(const pfVec3& velocityVec) 75 75 { 76 76 int i; … … 96 96 } 97 97 98 int pfTerryBoxCollide::collide(pfVec3& correction, pfNode* objNode, pfVec3 pos ) 98 int pfTerryBoxCollide::collide(pfVec3& correction, pfNode* objNode, 99 const pfVec3& pos) 99 100 { 100 101 int i, j, returnval = 0; juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryBoxCollide.h
r19729 r20530 50 50 pfVec3 mUnitBox[8]; 51 51 52 pfTerryBoxCollide( int isectMask = 0x01);52 pfTerryBoxCollide(const int isectMask = 0x01); 53 53 54 54 // set the intersect mask of this volume … … 57 57 // (see pfNode, or pfGeoSet::isect function 58 58 // NOTE: probably the same mask you used in nodeSetup 59 void setup( const int& isectMask );59 void setup(const int isectMask); 60 60 61 61 // set the radius of the simulated box/sphere volume 62 void setRadius( float radius);62 void setRadius(const float radius); 63 63 64 void setVelocity( pfVec3 velocityVec);64 void setVelocity(const pfVec3& velocityVec); 65 65 66 66 //: To collide with objects using the simulated volume … … 82 82 // NOTE: before calling this function call setRadius(radius of volume) 83 83 // first 84 int collide( pfVec3 &bounce, pfNode *objNode, pfVec3pos);84 int collide(pfVec3& bounce, pfNode *objNode, const pfVec3& pos); 85 85 }; 86 86 juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryCollide.cpp
r19729 r20530 25 25 *************** <auto-copyright.pl END do not edit this line> ***************/ 26 26 27 #include <Performer/pr.h> 28 #include <Performer/pr/pfGeoSet.h> 29 #include <Performer/pfutil.h> 30 27 31 #include "pfTerryCollide.h" 28 32 … … 30 34 // intersection mask. Cache normals and such inside geosets if the geometry 31 35 // is static, but not if it is dynamic, i.e., its vertices change. 32 void pfTerryCollide::nodeSetup( pfNode *node, int mode, int mask)36 void pfTerryCollide::nodeSetup(pfNode *node, const int mode, const int mask) 33 37 { 34 38 int fullmode; juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryCollide.h
r19729 r20530 30 30 #include <Performer/pf.h> 31 31 #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>37 32 38 33 /////////////////////////////////////////////////////////////////////////////////// … … 59 54 // This function is not necessary if you don't want to 60 55 // 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); 62 57 63 58 // data structure to get intersection result back from pfHit::mQuery juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryPogoCollide.cpp
r19729 r20530 25 25 *************** <auto-copyright.pl END do not edit this line> ***************/ 26 26 27 #include <Performer/pr.h> 28 #include <Performer/pr/pfGeoSet.h> 29 #include <Performer/pfutil.h> 30 #include <iostream> 31 #include <math.h> 32 27 33 #include "pfTerryPogoCollide.h" 28 34 … … 43 49 // that would normally be comfortable height for a human to step. 44 50 // heightAboveYourFeet is the length from posAboveYourFeet to your feet 45 bool pfTerryPogoCollide::collide( pfVec3& correction, pfNode *objNode, int mask, pfVec3 posAboveYourFeet, float heightAboveYourFeet ) 51 bool pfTerryPogoCollide::collide(pfVec3& correction, pfNode* objNode, 52 const int mask, 53 const pfVec3& posAboveYourFeet, 54 const float heightAboveYourFeet) 46 55 { 47 56 pfHit **hit[1]; … … 83 92 } 84 93 85 86 87 bool pfTerryPogoCollide::collideRide( pfVec3 &bounce, pfVec3 &ridexyz, pfVec3 &ridehpr, pfNode *objNode, int mask, pfVec3 pos, float length ) 94 bool pfTerryPogoCollide::collideRide(pfVec3& bounce, pfVec3& ridexyz, 95 pfVec3& ridehpr, pfNode* objNode, 96 const int mask, pfVec3 pos, 97 const float length) 88 98 { 89 99 pfHit** hit[1]; juggler/branches/2.2/modules/vrjuggler/samples/Pf/advanced/nav/pfTerryPogoCollide.h
r19729 r20530 30 30 #include <Performer/pf.h> 31 31 #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>37 32 38 33 #include "pfTerryCollide.h" // my base class … … 61 56 // that would normally be comfortable height for a human to step. 62 57 // 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); 64 61 65 62 //: collideRide(displacement vector, position … … 75 72 // from the rotation offset. The vector stores an hpr, but 76 73 // 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); 78 77 }; 79 78
