Changeset 2908 for code/branches/questsystem5/src/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
r2907 r2908 145 145 } 146 146 147 148 /// This returns the "raw" (user's initial) height, not the actual height. 149 /// The actual height needs to be adjusted to be relative to the center 150 /// of the heightfield's AABB. 151 btScalar 152 btHeightfieldTerrainShape::getRawHeightFieldValue(int x,int y) const 147 btScalar btHeightfieldTerrainShape::getHeightFieldValue(int x,int y) const 153 148 { 154 149 btScalar val = 0.f; … … 187 182 188 183 189 /// this returns the vertex in bullet-local coordinates 184 190 185 void btHeightfieldTerrainShape::getVertex(int x,int y,btVector3& vertex) const 191 186 { 187 192 188 btAssert(x>=0); 193 189 btAssert(y>=0); … … 195 191 btAssert(y<m_heightStickLength); 196 192 197 btScalar height = getRawHeightFieldValue(x,y); 193 194 btScalar height = getHeightFieldValue(x,y); 198 195 199 196 switch (m_upAxis) … … 202 199 { 203 200 vertex.setValue( 204 height - m_localOrigin.getX(),201 height, 205 202 (-m_width/btScalar(2.0)) + x, 206 203 (-m_length/btScalar(2.0) ) + y … … 212 209 vertex.setValue( 213 210 (-m_width/btScalar(2.0)) + x, 214 height - m_localOrigin.getY(),211 height, 215 212 (-m_length/btScalar(2.0)) + y 216 213 ); … … 222 219 (-m_width/btScalar(2.0)) + x, 223 220 (-m_length/btScalar(2.0)) + y, 224 height - m_localOrigin.getZ()221 height 225 222 ); 226 223 break; … … 234 231 235 232 vertex*=m_localScaling; 233 236 234 } 237 235 … … 241 239 getQuantized 242 240 ( 243 btScalarx241 float x 244 242 ) 245 243 {
Note: See TracChangeset
for help on using the changeset viewer.