try this:
- Code: Select all
ndMatrix matrix (ndGetIndetityMatrix());
matrix.m_poist = ((pMainBody->GetMatrix().m_posit + pMainBody2->GetMatrix().m_psoit).Scale (0.5f);
ndJointFix6dof* const joint = new ndJointFix6dof(matrix, pMainBody, pMainBody2)
Moderators: Sascha Willems, walaber
ndMatrix matrix (ndGetIndetityMatrix());
matrix.m_poist = ((pMainBody->GetMatrix().m_posit + pMainBody2->GetMatrix().m_psoit).Scale (0.5f);
ndJointFix6dof* const joint = new ndJointFix6dof(matrix, pMainBody, pMainBody2)
origin.m_posit.m_y += 20.f;
auto pMainBody2 = AddBox(scene, origin, 1500000.0, 4.0, 8.0, 8.0);
ndMatrix Gmatrix(ndGetIdentityMatrix());
Gmatrix.m_posit = ((pMainBody->GetMatrix().m_posit + pMainBody2->GetMatrix().m_posit).Scale(0.5f));
ndJointFix6dof* const joint = new ndJointFix6dof(Gmatrix, pMainBody, pMainBody2);
ndSharedPtr<ndJointBilateralConstraint> jointPtr(joint);
ndWorld* myworld = scene->GetWorld();
myworld->AddJoint(jointPtr);
void ndBasicRigidBody (ndDemoEntityManager* const scene)
{
// build a floor
BuildFloorBox(scene, ndGetIdentityMatrix());
ndMatrix origin1(ndGetIdentityMatrix());
//AddSphere(scene, origin1, 1.0f, 0.5f);
//AddCapsulesStacks(scene, origin1, 10.0f, 0.5f, 0.5f, 1.0f, 1, 2, 7);
AddCapsulesStacks(scene, origin1, 10.0f, 0.5f, 0.5f, 1.0f, 10, 10, 7);
//AddCapsulesStacks(scene, origin1, 10.0f, 0.5f, 0.5f, 1.0f, 4, 4, 4);
//AddCapsulesStacks(scene, origin1, 10.0f, 0.5f, 0.5f, 1.0f, 2, 2, 7);
ndQuaternion rot;
ndVector origin(-60.0f, 5.0f, 0.0f, 1.0f);
scene->SetCameraMatrix(rot, origin);
}
class ndModelDragLine : public ndModelArticulation
{
public:
ndModelDragLine(ndDemoEntityManager* const scene, ndMatrix& origin)
:ndModelArticulation()
,m_controlJoint(nullptr)
{
auto pMainBody = AddBox(scene, origin, 1500000.0, 4.0, 8.0, 8.0);
// Misho
origin.m_posit.m_y += 20.f;
auto pMainBody2 = AddBox(scene, origin, 1500000.0, 4.0, 8.0, 8.0);
ndMatrix Gmatrix(ndGetIdentityMatrix());
Gmatrix.m_posit = ((pMainBody->GetMatrix().m_posit + pMainBody2->GetMatrix().m_posit).Scale(0.5f));
ndJointFix6dof* const joint = new ndJointFix6dof(Gmatrix, pMainBody, pMainBody2);
ndSharedPtr<ndJointBilateralConstraint> jointPtr(joint);
ndWorld* myworld = scene->GetWorld();
myworld->AddJoint(jointPtr);
//
// Misho
origin.m_posit.m_y += 20.f;
auto pMainBody2 = AddBox(scene, origin, 1500000.0, 4.0, 8.0, 8.0);
ndMatrix m(pMainBody2->GetMatrix());
m.m_posit.m_y = 20.0f;
pMainBody2->SetMatrix(m);
misho wrote:Any thoughts on how to accomplish this?
JoeJ wrote:I remember we had proposed to use compounds instead fixed joints before,
but the first problem seems not that, but to make a single body representing the jet following the jet precisely, without lag.
Users browsing this forum: No registered users and 3 guests