Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Opcode collision detection library

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
oliver67
Posts: 10
Joined: 2007-01-12 07:38

Opcode collision detection library

#1 Post by oliver67 »

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 started with a code like the following, but not sucessfully.
Thanks in advance!

Regards
Oliver

#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);

Post Reply