I think the only thing missing is the ODE recording function.
The ODE cylinder appears to be bugged as it just won't stop moving. I compiled against ODE 0.9 and got the same behavior, but I haven't tried the latest svn snapshot yet.
headers/ode.h
Code:
679,689d678
< __rayapi int raydium_ode_object_cylinder_add (char *name, int group, dReal mass, dReal radius, dReal length, signed char type, int tag, char *mesh);
< /**
< This function will add an new "cylinder" element to an object (##group##).
< Arguments are the same as ##raydium_ode_object_sphere_add## (see above) but
< ##length##, used for box sizes. As for spheres, you can
< use ##RAYDIUM_ODE_AUTODETECT##.
< Again, Things like ##RAYDIUM_ODE_AUTODETECT*2## are ok, meaning
< "twice the detected size".
< **/
<
<
ode.c
Code:
1170,1261d1169
< //CYLINDER
< int raydium_ode_object_cylinder_add(char *name, int group, dReal mass, dReal radius, dReal length, signed char type, int tag, char *mesh)
< {
< int i;
< dMass m;
< dReal sizes[3];
< dReal tx, ty;
<
< //if(m.mass <= 0) { m.mass = 1; }
<
< if(raydium_ode_element_find(name)>=0)
< {
< raydium_log("ODE: Cannot add element \"%s\": name already exists",name);
< return -1;
< }
<
< if(!raydium_ode_object_isvalid(group))
< {
< raydium_log("ODE: Error: object not found while adding \"%s\"",name);
< return -1;
< }
<
< if(tag<0)
< {
< raydium_log("ODE: Error: Element creation failed: negative tags are forbidden");
< return -1;
< }
<
< // First element is reserved
< for(i=1;i<RAYDIUM_ODE_MAX_ELEMENTS;i++)
< if(!raydium_ode_element[i].state)
< {
< strcpy(raydium_ode_element[i].name,name);
< raydium_ode_element[i].object=group;
< raydium_ode_element[i].user_tag=tag;
< if(strlen(mesh))
< {
< raydium_ode_element[i].mesh=raydium_object_find_load(mesh);
< if(radius<0) // AUTODETECT
< {
< radius=raydium_object_find_dist_max(raydium_ode_element[i].mesh)*-radius;
< }
<
< if(length < 0) // Autodetect length
< {
< //int ratio=tx;
< int ratio = length;
< raydium_object_find_axes_max(raydium_ode_element[i].mesh,&tx,&ty,&length);
< //tx*=(-ratio);
< //ty*=(-ratio);
< //tz*=(-ratio);
< length*=(-ratio);
< }
< }
<
< if(type==RAYDIUM_ODE_STANDARD)
< {
< raydium_ode_element[i].body=dBodyCreate(raydium_ode_world);
< dMassSetCylinder(&m,1,3,radius,length);
< dMassAdjust(&m,mass);
< dBodySetMass(raydium_ode_element[i].body,&m);
< dBodySetData(raydium_ode_element[i].body,&raydium_ode_element[i]);
< // dBodySetAutoDisableSF1(raydium_ode_element[i].body,1);
< }
< else raydium_ode_element[i].body=0;
<
< raydium_ode_element[i].geom=dCreateCylinder(0,radius,length);
< raydium_ode_element[i].state=type;
< dGeomSetBody(raydium_ode_element[i].geom,raydium_ode_element[i].body);
< dGeomSetData(raydium_ode_element[i].geom,&raydium_ode_element[i]);
< dSpaceAdd(raydium_ode_object[group].group,raydium_ode_element[i].geom);
< raydium_ode_element_material(i,RAYDIUM_ODE_MATERIAL_DEFAULT);
< raydium_ode_element_slip(i,RAYDIUM_ODE_SLIP_DEFAULT);
< raydium_ode_element[i].distant=raydium_ode_network_distant_create;
< raydium_ode_network_distant_create=0;
< if(!raydium_ode_network_next_local_only)
< raydium_ode_network_element_new(i);
< raydium_ode_network_next_local_only=0;
<
< //sizes[0]=tx;
< //sizes[1]=ty;
< //sizes[2]=tz;
< //raydium_ode_capture_internal_create(RAYDIUM_ODE_RECORD_NEWBOX,i,sizes,mesh);
<
< return i;
< }
< raydium_log("ODE: No more element slots ! aborting \"%s\" creation",name);
< return -1;
<
< }
< // END CYLINDER
<
3711d3618
<
3759,3769d3665
<
< else
< if(dGeomGetClass(raydium_ode_element[i].geom)==dCylinderClass)
< {
< float cradius;
< float clength;
<
< dGeomCylinderGetParams(raydium_ode_element[i].geom, &cradius, &clength);
< //printf("%f-%f\n", cradius, clength);
< glutWireCylinder(cradius, clength, 10, 5);
< }
ode_net.c
Code:
82,85d81
< case dCylinderClass:
< raydium_ode_network_distant_create=1;
< elem=raydium_ode_object_cylinder_add(name,group,1,get[0],get[1],RAYDIUM_ODE_STATIC,tag,mesh);
< break;
reg_api.c
Code:
156d155
< PHP_i_sifffiis(raydium_ode_object_cylinder_add);
headers/myglut.h
Code:
91d90
< __rayapi void glutWireCylinder(GLdouble radius, GLdouble length, GLint slices, GLint stacks);
myglut.c
Code:
88,102d87
< // glutWireCylinder
< void glutWireCylinder(GLdouble radius, GLdouble length, GLint slices, GLint stacks)
< {
< static GLUquadricObj *quadObj=NULL;
<
< if(!quadObj)
< quadObj=gluNewQuadric();
<
< gluQuadricDrawStyle(quadObj, GLU_LINE);
< gluQuadricNormals(quadObj, GLU_SMOOTH);
<
< glTranslated(0, 0, -(length/2));
< gluCylinder(quadObj, radius, radius, length, slices, stacks);
< }
<