OPCODE Collision Detection Library, example code

View previous topic View next topic Go down

OPCODE Collision Detection Library, example code

Post by Oliver1967 on Wed Dec 09, 2015 1:33 pm

Hello,

I would like to use the collision detection routine from the OPCODE library, newest version 1.3
There exist documentations, e.g. Opcode.pdf and OpcodeUserManual.pdf, but they do not agree with
the source code, neither the current nor the previous version 1.2.

Does anyone have a simple and working example to check if to meshes collide?
I only would like to define the meshes using triangles and connectivities (no callback function).

I have compiled the OPCODE library statically and dynamically using no callbacks but pointers successfully, but failed to build up a small example as listed below.
Thanks in advance!

Regards
Oliver

Code:

#include <Opcode.h>
using namespace Opcode;

int main(void)
{
    IceMaths::IndexedTriangle *Tri0 = new IceMaths::IndexedTriangle[10];
    IceMaths::Point *Pnt0 = new IceMaths::Point[10];
    MeshInterface Mesh0;
    Mesh0.SetNbTriangles(10);
    Mesh0.SetNbVertices(10);
    Mesh0.SetPointers(Tri0, Pnt0);

    OPCODECREATE OPCC;
    OPCC.SetMeshInterface(&Mesh0);
    OPCC.Build();

    AABBTreeCollider TC;
    TC.SetFirstContact(true);
    TC.SetFullBoxBoxTest(false);
    TC.SetFullPrimBoxTest(false);
    TC.SetTemporalCoherence(false);

Oliver1967
Guest


Back to top Go down

Re: OPCODE Collision Detection Library, example code

Post by templar_vii on Wed Dec 09, 2015 1:35 pm


templar_vii
Admin

Posts : 7
Join date : 2015-12-09

View user profile http://opcode.forumotion.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum