Jump to content
  • Advertisement
Sign in to follow this  
themattgreen

ODE Transformed geom doesn't move with body

This topic is 4759 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am attempting to create a composite object using transform geoms in ODE. When I can create a composite which uses nothing but regular geoms, but when you throw in a transform geom, the transformed geom refuses to move when the body moves, instead remaining motionless. The following is the code I used:
class foo
{
public:
	dBodyID body;			// the body
	dGeomID geom;
	dGeomID* pads;
	
	dMass mass;

	dSpaceID rays;
	dGeomID* transform;

void create(dSpaceID &sp, dWorldID &wo)
 {

	

		pads= new dGeomID[1];
		body = dBodyCreate(wo);
		
		rays = dHashSpaceCreate(0);
		geom = dCreateBox(sp,2,2,2);

		dMassSetBox (&mass,1,1,1,1);
		dMassAdjust (&mass,1);
		////ray stuff for detecting road distance for hovering
		//use arrays 
		pads[0] = dCreateRay (0,100);
		transform = new dGeomID[1];
		transform[0] = dCreateGeomTransform(rays);
		
		
		dGeomTransformSetGeom (transform[0],pads[0]);
		dGeomTransformSetCleanup (transform[0],1);
		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);

		dBodySetMass (body,&mass);
		
		
		
		
 }
};


 
Does anybody please know what I am doing wrong (and can also tell me). I've searched through the samples included with version 0.5 and there doesn't seem to be any more to it than what I've included here. The transform geom just seems to refuse to acknowledge that it has been added to a body. [Edited by - themattgreen on May 15, 2005 1:09:25 PM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!