Mikhail Mikhailov wrote:
typedef struct {
       VECTOR3D vCollisionNormal;
       VECTOR3D vCollisionImpact;
       float fDistance;
       float fU;
       float fV;
       int iFaceindex;
       int iGroupIndex;
       bool bHasCollided;
       int iEntityID;
       int iMeshID;
       int iLandscapeID;
       int iBoneID;
       float fTexU;
       float fTexV;
   } COLLISIONRESULT;

I use mema/memr/memw too. First thing is to determine the offset of each member, this is not as easy because there are many types (VECTOR3D, float, int, bool etc) and the library may use different alignment not necessary 4 bytes. This information may be inferred from header file.

If you have many structures and functions (hundreds or thousands), it becomes infeasible to do it manually. You may consider SWIG (Simplified Wrapper and Interface Generator). Once you have to write the language binding of J, wrapper code can be generated automatically.

--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to