[F4-users] trying to set opcode callbacks
Status: Pre-Alpha
Brought to you by:
starkos
|
From: Charles J. L. Q. C. <cha...@ho...> - 2002-08-29 08:43:24
|
Hi!
thanks to Jason and Pierre for your prompt help!
Now i have a problem setting the mesh callbacks, look at my code:
// this is the callback
static void _opcodeCallback(udword triangleIndex, VertexPointers&
triangle, udword userdata)
{
udword *tri_array =((csOPCODECollider *)userdata)->indexholder;
Point *vertholder =((csOPCODECollider *)userdata)->vertholder;
int index = 3*triangleIndex;
triangle.Vertex[0]=&vertholder [ tri_array[ index ] ] ;
triangle.Vertex[1]=&vertholder [ tri_array[ index + 1 ] ];
triangle.Vertex[2]=&vertholder [ tri_array[ index + 2 ] ];
};
and this is how i set them:
AABBTreeCollider.SetCallback0 ( _opcodeCallback , udword(col1) );
AABBTreeCollider.SetCallback1 ( _opcodeCallback , udword(col2) );
but at compile, i get this error:
CSopcode.cpp:76: no matching function for call to
`Opcode::AABBTreeCollider::SetCallback0 (void (&) (unsigned int,
Opcode::VertexPointers &, unsigned int), udword)'
CSopcode.cpp:77: no matching function for call to
`Opcode::AABBTreeCollider::SetCallback1 (void (&) (unsigned int,
Opcode::VertexPointers &, unsigned int), udword)'
CSopcode.cpp:79: no matching function for call to
`Opcode::AABBTreeCollider::SetUserData0 (udword)'
CSopcode.cpp:80: no matching function for call to
`Opcode::AABBTreeCollider::SetUserData1 (udword)'
anyway, i tried two things, first to change the type of the callback to the
mysterious macro OBJ_CALLBACK, and i say mysterious because i couldn't grep
the define nowhere! =) .... well, but then it said that i should give a
return, since the type is non-void, hmmm.. weird indeed, any ideas?
the other thing i tried was to set individually the
AABBTreeCollider::mObjCallback0, mObjCallback1 and mUserdata0&1, but then it
said something like:
CSopcode.cpp:78: `class Opcode::AABBTreeCollider' has no member named
`mObjCallback0'
CSopcode.cpp:79: `class Opcode::AABBTreeCollider' has no member named
`mObjCallback1'
CSopcode.cpp:80: `class Opcode::AABBTreeCollider' has no member named
`mUserData0'
CSopcode.cpp:81: `class Opcode::AABBTreeCollider' has no member named
`mUserData1'
hmmm, no member, btw, i had to comment all the ICECORE_API and OPCODE_API
macros on class declarations because it was giving errors such as,.. err..
oops i should increase the terminal buffer size.. well, anyways, could that
have something to do?
Regards,
Charlls
_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com
|