Complexe structure with pointer using FFI

jpruvot jpruvot at etu.info.unicaen.fr
Mon May 26 11:45:41 UTC 2003


Hi!
we need to use external c structures. We tried to make subclasses
of ExternalStructure as in X11 exemples provided by FFI but we didn't
manage to do it. Can someone help us and give us the correct syntax for this 
kind of c code:
(just the dGeomClass structure if you don't have so much time) 

 

typedef double dReal;
typedef dReal dVector3[4];
typedef dReal dVector4[4]; 


struct dxGeom;		/* geometry (collision object) */
typedef struct dxGeom *dGeomID; 

typedef struct dContactGeom {
 dVector3 pos;
 dVector3 normal;
 dReal depth;
 dGeomID g1,g2;
} dContactGeom; 


typedef void dGetAABBFn (dGeomID, dReal aabb[6]);
typedef int dColliderFn (dGeomID o1, dGeomID o2,
			 int flags, dContactGeom *contact, int skip); 

typedef dColliderFn * dGetColliderFnFn (int num);
typedef void dGeomDtorFn (dGeomID o);
typedef int dAABBTestFn (dGeomID o1, dGeomID o2, dReal aabb[6]); 

typedef struct dGeomClass {
 int bytes;
 dGetColliderFnFn *collider;
 dGetAABBFn *aabb;
 dAABBTestFn *aabb_test;
 dGeomDtorFn *dtor;
} dGeomClass; 


Please help us !!!
Thanks. 

Emeric Rollo			
Jean-Hugues Pruvot		
University of Caen, France 



More information about the Squeak-dev mailing list