Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2009, 8:05:51 PM (15 years ago)
Author:
rgrieder
Message:

Update from Bullet 2.73 to 2.74.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp

    r2662 r2882  
    145145}
    146146
    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.
     151btScalar
     152btHeightfieldTerrainShape::getRawHeightFieldValue(int x,int y) const
    148153{
    149154        btScalar val = 0.f;
     
    182187
    183188
    184 
     189/// this returns the vertex in bullet-local coordinates
    185190void    btHeightfieldTerrainShape::getVertex(int x,int y,btVector3& vertex) const
    186191{
    187 
    188192        btAssert(x>=0);
    189193        btAssert(y>=0);
     
    191195        btAssert(y<m_heightStickLength);
    192196
    193 
    194         btScalar        height = getHeightFieldValue(x,y);
     197        btScalar        height = getRawHeightFieldValue(x,y);
    195198
    196199        switch (m_upAxis)
     
    199202                {
    200203                vertex.setValue(
    201                         height,
     204                        height - m_localOrigin.getX(),
    202205                        (-m_width/btScalar(2.0)) + x,
    203206                        (-m_length/btScalar(2.0) ) + y
     
    209212                        vertex.setValue(
    210213                        (-m_width/btScalar(2.0)) + x,
    211                         height,
     214                        height - m_localOrigin.getY(),
    212215                        (-m_length/btScalar(2.0)) + y
    213216                        );
     
    219222                        (-m_width/btScalar(2.0)) + x,
    220223                        (-m_length/btScalar(2.0)) + y,
    221                         height
     224                        height - m_localOrigin.getZ()
    222225                        );
    223226                        break;
     
    231234
    232235        vertex*=m_localScaling;
    233        
    234236}
    235237
     
    239241getQuantized
    240242(
    241 float x
     243btScalar x
    242244)
    243245{
Note: See TracChangeset for help on using the changeset viewer.