Witam, od wczoraj dopiero bawie sie z ode [0.11.1 + gimpact]
Mam 2 trimeshe, sa to boxy ale przedstawione jako trimeshe, jeden na wysokosci 30, drugi 60, jak odpale aplikacje to ladnie wszystko cud miód oba spadają na ziemie, ale jak ma dojść do kolizji między nimi to nic się nie dzieje, przenikają przez siebie...

Tak tworze trimesha
HRESULT hr = D3DXLoadMeshFromX( "data/models/latus/
body.X",
D3DXMESH_SYSTEMMEM,
cGame->GetDevice(),
NULL,
&m_BodyMaterialBuffer,
NULL,
&m_BodyNumMaterials,
&m_BodyMesh );

    if( FAILED( hr ) )
    {
        return false;
    }

    D3DXMATERIAL* Bodyd3dxMaterials = (D3DXMATERIAL*)

m_BodyMaterialBuffer->GetBufferPointer();

    m_BodyMeshMaterials = new D3DMATERIAL9[m_BodyNumMaterials];
    m_BodyMeshTextures  = new

LPDIRECT3DTEXTURE9[m_BodyNumMaterials];

    for( DWORD i = 0; i < m_BodyNumMaterials; i++ )
    {
        m_BodyMeshMaterials[i] = Bodyd3dxMaterials[i].MatD3D;
        m_BodyMeshMaterials[i].Ambient =

m_BodyMeshMaterials[i].Diffuse;

        m_BodyMeshTextures[i] = NULL;

        if( Bodyd3dxMaterials[i].pTextureFilename )
        {
            D3DXCreateTextureFromFile( cGame->GetDevice(),

Bodyd3dxMaterials[i].pTextureFilename, &m_BodyMeshTextures[i] );
}
}

    m_BodyMaterialBuffer->Release();

    //Vertexy karoserii
    D3DXVECTOR3 *p_Vertices;
    BYTE *p_iVertices;

    m_BodyMesh->LockVertexBuffer( D3DLOCK_READONLY, (LPVOID*)

&p_Vertices );

    m_VerticesCount = m_BodyMesh->GetNumVertices(); //ilosc

vertexow

    m_Vertices = new dVector3[ m_VerticesCount ];

    for( int i = m_VerticesCount; i == 0; i-- )
    {
        m_Vertices[i][0] = p_Vertices[i].x;
        m_Vertices[i][1] = p_Vertices[i].y;
        m_Vertices[i][2] = p_Vertices[i].z;
    }

    m_BodyMesh->LockIndexBuffer( D3DLOCK_READONLY, (LPVOID*)

&p_iVertices );

    int ic = (int) m_BodyMesh->GetNumFaces() * 3;

    m_iVertices = new dTriIndex[ ic ];

    for( int i = 0; i < ic; i++ )
    {
        m_iVertices[i] = p_iVertices[i];
    }

    m_BodyMesh->UnlockIndexBuffer();

    m_BodyMesh->UnlockVertexBuffer();

    m_TrimeshData = dGeomTriMeshDataCreate();
    //dGeomTriMeshDataBuildSimple( m_TrimeshData, (dReal*)

m_Vertices, m_VerticesCount, m_iVertices, ic );
dGeomTriMeshDataBuildSingle( m_TrimeshData, (dReal)
m_Vertices, 3
sizeof(dReal), m_VerticesCount, m_iVertices, ic,
3*sizeof(unsigned int) );

    //Dodajemy samochod do jako obiekt fizyczny aby ode go

widzialo
m_ODEBody = dBodyCreate( cWorld.GetWorld() );
m_ODEGeom = dCreateTriMesh( cWorld.GetSpace(), m_TrimeshData,
0, 0, 0 );
dMassSetTrimesh( &m_ODEMass, 5, m_ODEGeom );
dGeomSetBody( m_ODEGeom, m_ODEBody );
dBodySetPosition( m_ODEBody, 0, 0, MaxSpeed );

Tu moj callback
[code]void World::CollisionCallback( dGeomID o1, dGeomID o2 )
{
int i;
// if (o1->body && o2->body) return;

// exit without doing anything if the two bodies are connected by a
joint
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact))
return;

dContact contact[ODE_MAX_CONTACTS]; // up to MAX_CONTACTS contacts
per box-box
for (i=0; i<ODE_MAX_CONTACTS; i++) {
contact[i].surface.mode = dContactBounce | dContactSoftCFM;
contact[i].surface.mu = dInfinity;
contact[i].surface.mu2 = 0;
contact[i].surface.bounce = 0.7;
contact[i].surface.bounce_vel = 0.1;
contact[i].surface.soft_cfm = 0.01;
}
if (int numc = dCollide (o1,o2,ODE_MAX_CONTACTS,&contact[0].geom,
sizeof(dContact))) {
dMatrix3 RI;
dRSetIdentity (RI);
const dReal ss[3] = {0.02,0.02,0.02};
for (i=0; i<numc; i++) {
dJointID c = dJointCreateContact (m_World,m_ContactGroup,contact
+i);
dJointAttach (c,b1,b2);
//if (show_contacts) dsDrawBox (contact[i].geom.pos,RI,ss);
}
}
}