[ODE] Collision Trimesh-Box
Oleh Derevenko
oder at eleks.lviv.ua
Wed Aug 8 07:25:03 MST 2007
Hi Jon
> What happens if you reverse the winding of all the faces?
No. That does not help.
Here is an excerpt from gdb output
======================
(gdb)
1223 Collider.Collide(dxTriMesh::defaultBoxCache, Box,
TriMesh->Data->BVTree, null,
(gdb) p Box
$6 = {mCenter = {x = 0, y = 0, z = 1.90734863e-06}, mExtents = {x =
32.1733665, y = 4.59619427, z = 32.1733665}, mRot = {m = {{1, 0, 0}, {0, 1,
0}, {0, 0, 1}}}}
(gdb) p TriMesh[0]
$8 = {<dxGeom> = {<dBase> = {<No data fields>}, _vptr.dxGeom = 0x83428e8,
type = 8, gflags = 24, data = 0x8527400, body = 0x0, body_next = 0x0,
final_posr = 0x855c268, offset_posr = 0x0, next = 0x0, tome = 0x8524268,
parent_space = 0x8524218, aabb = {-0.52132374, 0.520342886,
-0.452284575, 5.29271603, -0.900377095, 0.901289642}, category_bits =
4294967295, collide_bits = 4294967295}, Callback = 0,
ArrayCallback = 0, RayCallback = 0, Data = 0x8527368, doSphereTC = false,
doBoxTC = false, doCapsuleTC = false, last_trans = {1, 0, 0, 0, 0, 1,
0, 0, 0, 0, 1, 0, 0.099742882, -0.288125098, 0.00957375765, 1}, static
_PlanesCollider = {<VolumeCollider> = {<Collider> = {
_vptr.Collider = 0x8342aa0, mFlags = 2, mCurrentModel = 0x0, mIMesh
= 0x0}, mTouchedPrimitives = 0x0, mCenterCoeff = {x = 0, y = 0,
z = 0}, mExtentsCoeff = {x = 0, y = 0, z = 0}, mNbVolumeBVTests = 0,
mNbVolumePrimTests = 0}, mNbPlanes = 0, mPlanes = 0x0, mVP = {
Vertex = {0x0, 0x0, 0x0}}}, static _SphereCollider = {<VolumeCollider>
= {<Collider> = {_vptr.Collider = 0x8342ae8, mFlags = 18,
mCurrentModel = 0x0, mIMesh = 0x0}, mTouchedPrimitives = 0x0,
mCenterCoeff = {x = 0, y = 0, z = 0}, mExtentsCoeff = {x = 0, y = 0,
z = 0}, mNbVolumeBVTests = 0, mNbVolumePrimTests = 0}, mCenter = {x
= 0, y = 0, z = 0}, mRadius2 = 0},
static _OBBCollider = {<VolumeCollider> = {<Collider> = {_vptr.Collider =
0x83429c0, mFlags = 4, mCurrentModel = 0x8524570,
mIMesh = 0x8524584}, mTouchedPrimitives = 0x834ec40, mCenterCoeff =
{x = 0, y = 0, z = 0}, mExtentsCoeff = {x = 0, y = 0, z = 0},
mNbVolumeBVTests = 113, mNbVolumePrimTests = 56}, mAR = {m =
{{1.00000095, 9.99999997e-07, 9.99999997e-07}, {9.99999997e-07, 1.00000095,
9.99999997e-07}, {9.99999997e-07, 9.99999997e-07, 1.00000095}}},
mRModelToBox = {m = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}},
mRBoxToModel = {m = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}}, mTModelToBox =
{x = 0.0996355265, y = 2.13209057, z = 0.00967308227}, mTBoxToModel = {
x = -0.0996355265, y = -2.13209057, z = -0.00967308227}, mBoxExtents =
{x = 32.1733665, y = 4.59619427, z = 32.1733665}, mB0 = {
x = 32.0737305, y = 2.4641037, z = 32.1636925}, mB1 = {x
= -32.2730026, y = -6.72828484, z = -32.1830406}, mBBx1 = 32.1734352,
mBBy1 = 4.59626293, mBBz1 = 32.1734352, mBB_1 = 3.67695611e-05, mBB_2 =
32.1734276, mBB_3 = 4.59623098, mBB_4 = 32.1734009,
mBB_5 = 6.43467356e-05, mBB_6 = 32.1734009, mBB_7 = 4.59623098, mBB_8 =
32.1734276, mBB_9 = 3.67695611e-05, mLeafVerts = {{x = -0.201323763,
y = 4.58104897, z = 0.027954381}, {x = -0.102990419, y = 4.57438231,
z = -0.000378954224}, {x = -0.192990437, y = 4.58604908,
z = -0.010378954}}, mFullBoxBoxTest = true}, static _RayCollider =
{<Collider> = {_vptr.Collider = 0x8342ab8, mFlags = 0,
mCurrentModel = 0x0, mIMesh = 0x0}, mOrigin = {x = 0, y = 0, z = 0},
mDir = {x = 0, y = 0, z = 0}, mFDir = {x = 0, y = 0, z = 0}, mData = {
x = 0, y = 0, z = 0}, mData2 = {x = 0, y = 0, z = 0}, mStabbedFace =
{mFaceID = 0, mDistance = 0, mU = 0, mV = 0},
mStabbedFaces = 0x834ede8, mNbRayBVTests = 0, mNbRayPrimTests = 0,
mNbIntersections = 0, mCenterCoeff = {x = 0, y = 0, z = 0},
mExtentsCoeff = {x = 0, y = 0, z = 0}, mMaxDist = 3.40282347e+38,
mClosestHit = false, mCulling = true},
static _AABBTreeCollider = {<Collider> = {_vptr.Collider = 0x8342b68,
mFlags = 0, mCurrentModel = 0x0, mIMesh = 0x0}, mPairs = {
static mNbContainers = 5, static mUsedRam = 16464, mMaxNbEntries = 0,
mCurNbEntries = 0, mEntries = 0x0, mGrowthFactor = 2}, mIMesh0 = 0x0,
mIMesh1 = 0x0, mNbBVBVTests = 0, mNbPrimPrimTests = 0, mNbBVPrimTests =
0, mAR = {m = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}}, mR0to1 = {m = {{0,
0, 0}, {0, 0, 0}, {0, 0, 0}}}, mR1to0 = {m = {{0, 0, 0}, {0, 0,
0}, {0, 0, 0}}}, mT0to1 = {x = 0, y = 0, z = 0}, mT1to0 = {x = 0,
y = 0, z = 0}, mCenterCoeff0 = {x = 0, y = 0, z = 0}, mExtentsCoeff0 =
{x = 0, y = 0, z = 0}, mCenterCoeff1 = {x = 0, y = 0, z = 0},
mExtentsCoeff1 = {x = 0, y = 0, z = 0}, mLeafVerts = {{x = 0, y = 0, z =
0}, {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}}, mLeafIndex = 0,
mFullBoxBoxTest = true, mFullPrimBoxTest = true}, static _LSSCollider =
{<VolumeCollider> = {<Collider> = {_vptr.Collider = 0x8342938,
mFlags = 16, mCurrentModel = 0x0, mIMesh = 0x0}, mTouchedPrimitives
= 0x0, mCenterCoeff = {x = 0, y = 0, z = 0}, mExtentsCoeff = {x = 0,
y = 0, z = 0}, mNbVolumeBVTests = 0, mNbVolumePrimTests = 0}, mSeg =
{mP0 = {x = 0, y = 0, z = 0}, mP1 = {x = 0, y = 0, z = 0}},
mRadius2 = 0}, static Faces = {<Container> = {static mNbContainers = 5,
static mUsedRam = 16464, mMaxNbEntries = 0, mCurNbEntries = 0,
mEntries = 0x0, mGrowthFactor = 2}, <No data fields>}, SphereTCCache =
{<dArrayBase> = {_size = 0, _anum = 0,
_data = 0x0}, <No data fields>}, static defaultSphereCache =
{<VolumeCache> = {TouchedPrimitives = {static mNbContainers = 5,
static mUsedRam = 16464, mMaxNbEntries = 0, mCurNbEntries = 0,
mEntries = 0x0, mGrowthFactor = 2}, Model = 0x0}, Center = {x = 0, y = 0,
z = 0}, FatRadius2 = 0, FatCoeff = 1.10000002}, BoxTCCache =
{<dArrayBase> = {_size = 0, _anum = 0, _data = 0x0}, <No data fields>},
static defaultBoxCache = {<VolumeCache> = {TouchedPrimitives = {static
mNbContainers = 5, static mUsedRam = 16464, mMaxNbEntries = 4096,
mCurNbEntries = 2789, mEntries = 0x85b4c60, mGrowthFactor = 2},
Model = 0x0}, FatBox = {mCenter = {x = 0, y = 0, z = 0}, mExtents = {
x = 0, y = 0, z = 0}, mRot = {m = {{1, 0, 0}, {0, 1, 0}, {0, 0,
1}}}}, FatCoeff = 1.10000002}, CapsuleTCCache = {<dArrayBase> = {
_size = 0, _anum = 0, _data = 0x0}, <No data fields>}, static
defaultCapsuleCache = {<VolumeCache> = {TouchedPrimitives = {
static mNbContainers = 5, static mUsedRam = 16464, mMaxNbEntries =
0, mCurNbEntries = 0, mEntries = 0x0, mGrowthFactor = 2},
Model = 0x0}, Previous = {<Segment> = {mP0 = {x = 0, y = 0, z = 0},
mP1 = {x = 0, y = 0, z = 0}}, mRadius = 0}, FatCoeff = 1.10000002}}
(gdb) p TriMesh[0].final_posr[0]
$10 = {pos = {0.0996355265, 2.13209057, 0.00967498962, 0}, R = {1, 0, 0, 0,
0, 1, 0, 0, 0, 0, 1, 0}}
(gdb) p TriMesh[0].Data[0]
$11 = {<dBase> = {<No data fields>}, BVTree = {<BaseModel> =
{_vptr.BaseModel = 0x8342950, mIMesh = 0x852737c, mModelCode = 2, mSource =
0x0,
mTree = 0x8554150}, <No data fields>}, Mesh = {mNbTris = 3012,
mNbVerts = 2210, mTris = 0x8579390, mVerts = 0x8572bf8, mTriStride = 12,
mVertexStride = 12, Single = true, static VertexCache = {{x = 0, y = 0,
z = 0}, {x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}}}, AABBCenter = {
-0.100125954, 0.288125038, -0.00921869278, 4.32638997e-34}, AABBExtents
= {0.520833313, 2.87250018, 0.900833368, 2.81660991e-43},
Normals = 0x0, UseFlags = 0x85e0548
"$\004\004\006\004\004\004\004\004\f&\004\004\004\f&\005\004\004\r\022\001"}
(gdb) p vPosMesh
$12 = (dReal &)[4]) @0x855c268: {0.0996355265, 2.13209057, 0.00967498962, 0}
(gdb) p mRotMesh
$13 = (dReal &)[12]) @0x855c278: {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0}
======================
The strange thing is that Collider.GetContactStatus() returns true
======================
(gdb) p Collider.mFlags
$18 = 4
(gdb) p (int)OPC_CONTACT
$20 = 4
======================
But subsequent cycle with FetchTriangle() and _cldTestOneTriangle() does not
generate any contacts.
Oleh Derevenko
-- Yahoo ID: oleh_derevenko
-- ICQ: 36361783
More information about the ODE
mailing list