OPCODE collision detection
Would you like to react to this message? Create an account in a few clicks or log in to continue.

OPCODE Collision Detection Library, example code

Go down

OPCODE Collision Detection Library, example code Empty OPCODE Collision Detection Library, example code

Post by Oliver1967 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

OPCODE Collision Detection Library, example code Empty Re: OPCODE Collision Detection Library, example code

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


templar_vii
Admin

Posts : 7
Join date : 2015-12-09

https://opcode.iftopic.com

Back to top Go down

Back to top

- Similar topics

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