btHeightfieldTerrainShape unusable

Post Reply
Thyrion
Posts: 6
Joined: Sun Mar 09, 2014 1:55 pm

btHeightfieldTerrainShape unusable

Post by Thyrion »

Anyone using btHeightfieldTerrainShape without problems (Not just plane terrain)?
I ask because of this issue:

https://www.youtube.com/watch?v=zCJwxk0 ... e=youtu.be
https://github.com/bulletphysics/bullet3/issues/57

its not usable ... someone need to fix that :)
DannyChapman
Posts: 84
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: btHeightfieldTerrainShape unusable

Post by DannyChapman »

The only problems (with v2.81) I've had are:

- tunnelling when the velocity is high (to be expected)

- hitting internal triangle edges (not a big deal for me - and probably solvable anyway)

- performance problems due to missing broad-phase tests, resulting in more low-level tests than necessary (I have a local workaround, and I think Erwin fixed it anyway after some emails between us).

Other than that it's fine - works well for my flight sim: http://www.rowlhouse.co.uk/PicaSim. I use the diamond subdivision.
Thyrion
Posts: 6
Joined: Sun Mar 09, 2014 1:55 pm

Re: btHeightfieldTerrainShape unusable

Post by Thyrion »

Does anyone have the same problems with the terrain?

if i comment out the following code in btGjkPairDetector.h the collisoin for Cube,Capsule seems to work for static terrains.
The terrain demo works with static terrain, too.

Code: Select all

   //  //if (m_fixContactNormalDirection)
    //{
    //  ///@workaround for sticky convex collisions
    //  //in some degenerate cases (usually when the use uses very small margins) 
    //  //the contact normal is pointing the wrong direction
    //  //so fix it now (until we can deal with all degenerate cases in GJK and EPA)
    //  //contact normals need to point from B to A in all cases, so we can simply check if the contact normal really points from B to A
    //  //We like to use a dot product of the normal against the difference of the centroids, 
    //  //once the centroid is available in the API
    //  //until then we use the center of the aabb to approximate the centroid
    //  btVector3 aabbMin,aabbMax;
    //  m_minkowskiA->getAabb(localTransA,aabbMin,aabbMax);
    //  btVector3 posA  = (aabbMax+aabbMin)*btScalar(0.5);
    //
    //  m_minkowskiB->getAabb(localTransB,aabbMin,aabbMax);
    //  btVector3 posB = (aabbMin+aabbMax)*btScalar(0.5);//btVector3 diff = posA-posB;
    //  //if (diff.dot(normalInB) < 0.f)
    //  //  normalInB *= -1.f;
    //}
https://github.com/bulletphysics/bullet3/issues/57

My english must be chinese for erwin... :)
Post Reply