Collision

This topic contains 3 replies, has 2 voices, and was last updated by  Joe Davis 3 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31717

    aicha11
    Member

    please can you give me a bref idea about linking this sdk with bullet physics?
    I search in the internet but I don’t well understand. I tried some code but always an error was displayed.
    thanks for help me

    #38762

    Joe Davis
    Member

    Hi Aicha,

    The best thing to do is create an array of vertices from a POD mesh that can be passed to Bullet. A function like this should work (FYI, I’ve not tested it so it may be a little buggy):

    CPVRTArray CModel::GetVertices(const unsigned int mesh_id)
    {
    CPVRTArray vertices;
    const SPODMesh& mesh(pod_.pMesh[mesh_id]);
    for(unsigned int vertex_id = 0; vertex_id < mesh.nNumVertex; ++vertex_id)
    {
    PVRTVec3 v = *(PVRTVec3*)(mesh.pInterleaved + mesh.sVertex.nStride * vertex_id);
    vertices.Append(v);
    }
    return vertices;
    }

    Joe

    #38763

    aicha11
    Member

    I want to test the distance between the wheelchair and the other objects in the house to detect collision using the code below I mean that I calculate the distance between wheelchair’s vertices and objects’s vertices . is that possible?
    I don’t succeed to use bullet physics with yhis sdk and I don’t have enough time to do it.

    #38764

    Joe Davis
    Member

    Hi Aicha,

    Writing an accurate collision detection and response system from scratch is a very time consuming task. I would recommend revisiting integration of an existing solution, such as Bullet, as it will take significantly less time than implementing your own solution.

    Bullet have a Hello World example that explains how to set up the various systems within Bullet to implement a simple bounding ball application: http://www.bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World

    Once you have an understanding of the fundamentals of the Bullet engine, I would recommend reading through the code of the various examples included in the Bullet SDK.

    Regards,
    Joe

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.