- Code: Select all
NewtonBody* car_body = newton_addentity(me, 1300, NEWTON_CONVEXHULL, onforceandtorque);
NewtonBodySetLinearDamping(car_body,0.005);
NewtonBodyGetMatrix(car_body,&tire_offset);
NewtonJoint* car_joint = DGRaycastVehicleCreate(4, &tire_offset, car_body);
FLwheelPtr = ent_create("WheelL.mdl",nullvector,NULL);
vec_for_bone(tirepos,me,"FLBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset1, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
DGRaycastVehicleAddTire(car_joint,FLwheelPtr,&tire_offset1,20,0.35,0.3,1.1,0.25,60,5,1);
FLwheelPtr = ent_create("WheelR.mdl",nullvector,NULL);
vec_for_bone(tirepos,me,"FRBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset2, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
DGRaycastVehicleAddTire(car_joint,FRwheelPtr,&tire_offset2,20,0.35,0.3,1.1,0.25,60,5,1);
FLwheelPtr = ent_create("WheelL.mdl",nullvector,NULL);
vec_for_bone(tirepos,me,"BLBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset3, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
DGRaycastVehicleAddTire(car_joint,BLwheelPtr,&tire_offset3,20,0.35,0.3,1.1,0.25,60,5,1);
FLwheelPtr = ent_create("WheelR.mdl",nullvector,NULL);
vec_for_bone(tirepos,me,"BRBone");
vec_sub(tirepos,my.x);
D3DXMatrixTranslation(&tire_offset4, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
DGRaycastVehicleAddTire(car_joint,BRwheelPtr,&tire_offset4,20,0.35,0.3,1.1,0.25,60,5,1);
but now car falls down and starts to move in the left direction.
here it falls

here it begin to move (blue is a place, where it falls)


in addition, in v1.53 i could see wheels in the debug (wich just runs through all bodies), in DGCar i canlt see them at all (as at the first picture).. i didnt add a visualisation of wheels, but i think i would be able to see it in the debug mode


looking like i'm missing something