Changeset 2907 for code/branches/questsystem5/src/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
- Timestamp:
- Apr 8, 2009, 12:36:08 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
r2662 r2907 145 145 } 146 146 147 btScalar btHeightfieldTerrainShape::getHeightFieldValue(int x,int y) const 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 148 153 { 149 154 btScalar val = 0.f; … … 182 187 183 188 184 189 /// this returns the vertex in bullet-local coordinates 185 190 void btHeightfieldTerrainShape::getVertex(int x,int y,btVector3& vertex) const 186 191 { 187 188 192 btAssert(x>=0); 189 193 btAssert(y>=0); … … 191 195 btAssert(y<m_heightStickLength); 192 196 193 194 btScalar height = getHeightFieldValue(x,y); 197 btScalar height = getRawHeightFieldValue(x,y); 195 198 196 199 switch (m_upAxis) … … 199 202 { 200 203 vertex.setValue( 201 height ,204 height - m_localOrigin.getX(), 202 205 (-m_width/btScalar(2.0)) + x, 203 206 (-m_length/btScalar(2.0) ) + y … … 209 212 vertex.setValue( 210 213 (-m_width/btScalar(2.0)) + x, 211 height ,214 height - m_localOrigin.getY(), 212 215 (-m_length/btScalar(2.0)) + y 213 216 ); … … 219 222 (-m_width/btScalar(2.0)) + x, 220 223 (-m_length/btScalar(2.0)) + y, 221 height 224 height - m_localOrigin.getZ() 222 225 ); 223 226 break; … … 231 234 232 235 vertex*=m_localScaling; 233 234 236 } 235 237 … … 239 241 getQuantized 240 242 ( 241 floatx243 btScalar x 242 244 ) 243 245 {
Note: See TracChangeset
for help on using the changeset viewer.