[ODE] Composite objects, only one geom moves

Matt Green themattgreen at gmail.com
Sat May 14 20:54:47 MST 2005


*sigh* here's my second posting about composite geoms. What I have is
a box geom and a ray geom, but only one geom actually moves

badly commented sample...

	dBodyID body;			
	dGeomID geom;
	dGeomID* pads;
	dGeomID geom2;
	dMass mass;

	dSpaceID rays;
	dGeomID* transform;

/////using pointers cause I need dynamically sizeable arrays
		pads= new dGeomID[1];
		body = dBodyCreate(wo);
		rays = dHashSpaceCreate(0);
		geom = dCreateBox(sp,2,2,2);
		////ray stuff for detecting road distance for hovering
		//use arrays 
		pads[0] = dCreateRay (0,100);
		transform = new dGeomID[1];
		transform[0] = dCreateGeomTransform (rays);
		dGeomTransformSetCleanup (transform[0],1);
		dGeomTransformSetGeom (transform[0],pads[0]);
		dMatrix3 Rtx;
		dRFromAxisAndAngle (Rtx,1,0,0,1.57);
		dGeomSetRotation (pads[0],Rtx);
		dGeomSetPosition (pads[0], -0.5, -1,-0.5);
		dGeomSetBody(transform[0],body);
		///end ray stuff
		dGeomSetBody(geom,body);
		dMassSetBox (&mass,1,1,1,1);
		dMassAdjust (&mass,1);
		dBodySetMass (body,&mass);


When I try to add force to 'body' only the box moves (geom) and the
ray (pads[0])stays motionless, at the transform geom position. Can
anyone who can actually be bothered to read this code please tell me
what I'm missing here? Surely this should be in the FAQ.



More information about the ODE mailing list