I have tested several ideas for vehicles:
1. for multibody vehicles:
-newton bodies has limited angular velocities. The rotation limit is about 40 rad/sec. Why? U told me (a year ago), that u have to know that the object is rotated to the left or the right (in every frame). So in my interpretation that means: -PI..+PI rotation per frame. If im running 60fps the maximum rotation should be Pi*60 rad/s, but its 40. Why is that?
2. For my new vehicle idea:
This is a corkscrew joint.Is this callback correct?
- Code: Select all
unsigned int wheelJointCB(NewtonJoint joint,NewtonHingeSliderUpdateDesc* desc) {
float distance=NewtonCorkscrewGetJointPosit(joint);
float speed=NewtonCorkscrewGetJointVeloc(joint);
if(distance<-0.25)
desc[0].accel=NewtonCorkscrewCalculateStopAccel(joint,desc,-0.25);
else if(distance>0.25) {
desc[0].accel=NewtonCorkscrewCalculateStopAccel(joint,desc,0.25);
else {
float a=NewtonCalculateSpringDamperAcceleration(desc.timestep,15000,distance,1000,speed)*30;
desc[0].accel=0;
desc[0].minFriction=a;
desc[0].maxFriction=a;
}
return 1;
}
my car has 900kg weight & the tires have 30kg. The problem is, that the force stop force is weak, the tires moving over the limit (both side), and if there are no stop, then a spring dampre is too instable, it is oscillating for a long time.
Thx for the answer!