My code commented out in the DemoCameraManager.cpp file is my first and old try method.
--
This one here is the one that I use in my current demo editor.
- Code: Select all
if (m_pickJoint) {
dFloat Ixx;
dFloat Iyy;
dFloat Izz;
dFloat mass;
NewtonBodyGetMass(m_targetPicked, &mass, &Ixx, &Iyy, &Izz);
dVector mousespeed(dVector(m_mousePosX, m_mousePosY, 0.0f));
mousespeed -= m_mousebackup;
float speed = dSqrt(mousespeed.m_x * mousespeed.m_x + mousespeed.m_y);
if (speed < 100.0f) speed = 100.0f;
//printf("%.3f \n", speed);
dFloat angularFritionAccel = speed;
dFloat linearFrictionAccel = (speed * 3.0f) * dAbs(dMax(DEMO_GRAVITY, 10.0f));
dFloat inertia = dMax(Izz, dMax(Ixx, Iyy));
m_pickJoint->SetMaxLinearFriction(mass * linearFrictionAccel);
m_pickJoint->SetMaxAngularFriction(inertia * angularFritionAccel);
m_pickJoint->SetTargetPosit (m_pickedBodyTargetPosition);
m_mousebackup = dVector(m_mousePosX, m_mousePosY, 0.0f);
}
--
I have test your change and from what I see the result is very similar to what I currently get with my demo.
I think it is pretty much the limit before get trouble with joints or with other collision bodies.
It's not perfect but for me when I move the objects I feel it better.
Please when you have time tell me if this can work for you.
For me and for general demos I think it is good and better with less lag.
I am a total moron what it come to editing stuff
I'm a winner for this too lol, In my case by repeating the same error many times before see it.
Yes it is easy to place the objects in the scene with this method.
If i'm not wrong you can apply the original forcecallback over it to let's a bit of gravity acting ?
Or for do this I need to use the mode 1 m_pickJoint->SetPickMode (1); ?