public override void InitJoint() { NewtonBody child = GetComponent <NewtonBody>(); dMatrix matrix = Utils.ToMatrix(m_Pivot, m_Pin); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; m_Joint = new dNewtonJointBallAndSocket(matrix, child.GetBody().GetBody(), otherBody); Stiffness = m_Stiffness; }
public override void InitJoint() { NewtonBody child = GetComponent <NewtonBody>(); dMatrix matrix = Utils.ToMatrix(m_Pivot, m_Pin); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; m_Joint = new dNewtonJointSlider(matrix, child.GetBody().GetBody(), otherBody); Stiffness = m_Stiffness; EnableCollision = m_EnableCollision; EnableLimits = m_EnableLimits; SetSpringDamper = m_SetSpringDamper; }
public override void InitJoint() { NewtonBody child = GetComponent <NewtonBody>(); dMatrix matrix = Utils.ToMatrix(m_Pivot, m_Pin); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; m_Joint = new dNewtonJointSliderActuator(matrix, child.GetBody().GetBody(), otherBody); EnableCollision = m_EnableCollision; Speed = m_Speed; MaxForce = m_MaxForce; TargetPosition = m_TargetPosition; }
public override void InitJoint() { NewtonBody child = GetComponent <NewtonBody>(); dMatrix matrix = Utils.ToMatrix(m_Pivot, m_Pin0, m_Pin1); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; m_Joint = new dNewtonJointDoubleHinge(matrix, child.GetBody().GetBody(), otherBody); Stiffness = m_Stiffness; EnableCollision = m_EnableCollision; EnableLimits_0 = m_EnableLimits_0; EnableLimits_1 = m_EnableLimits_1; }
public override void InitJoint() { NewtonBody child = GetComponent <NewtonBody>(); dMatrix matrix = Utils.ToMatrix(m_Pivot, m_Pin); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; m_Joint = new dNewtonJointHingeActuator(matrix, child.GetBody().GetBody(), otherBody); TargetAngle = m_TargetAngle; AngularRate = m_AngularRate; MaxTorque = m_MaxTorque; EnableCollision = m_EnableCollision; }
public override void InitJoint() { Vector3 childPin = m_Pin.normalized; Vector3 parentPin = m_ParentPin.normalized; NewtonBody child = GetComponent <NewtonBody>(); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; dVector childPin_ = new dVector(childPin.x, childPin.y, childPin.z, 0.0f); dVector parentPin_ = new dVector(parentPin.x, parentPin.y, parentPin.z, 0.0f); m_Joint = new dNewtonJointGear(m_GearRatio, childPin_, parentPin_, child.GetBody().GetBody(), otherBody); EnableCollision = m_EnableCollision; }
public override void InitJoint() { var childPinNorm = m_Pin.normalized; var parentPinNorm = m_ParentPin.normalized; var refPinNorm = m_ReferencePin.normalized; NewtonBody child = GetComponent <NewtonBody>(); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; IntPtr referenceBody = (m_ReferenceBody != null) ? m_ReferenceBody.GetBody().GetBody() : IntPtr.Zero; dVector dChildPin = new dVector(childPinNorm.x, childPinNorm.y, childPinNorm.z, 0.0f); dVector dParentPin = new dVector(parentPinNorm.x, parentPinNorm.y, parentPinNorm.z, 0.0f); dVector dReferencePin = new dVector(refPinNorm.x, refPinNorm.y, refPinNorm.z, 0.0f); m_Joint = new dNewtonJointDifferentialGear(m_GearRatio, dChildPin, dParentPin, dReferencePin, child.GetBody().GetBody(), otherBody, referenceBody); EnableCollision = m_EnableCollision; }
public override void InitJoint() { NewtonBody child = GetComponent <NewtonBody>(); IntPtr otherBody = (m_OtherBody != null) ? m_OtherBody.GetBody().GetBody() : IntPtr.Zero; var gearPinNorm = m_GearPin.normalized; var slidePinNorm = m_SlidePin.normalized; dVector childPin = new dVector(gearPinNorm.x, gearPinNorm.y, gearPinNorm.z, 0.0f); dVector parentPin = new dVector(slidePinNorm.x, slidePinNorm.y, slidePinNorm.z, 0.0f); m_Joint = new dNewtonJointRackAndPinion(m_GearRatio, childPin, parentPin, child.GetBody().GetBody(), otherBody); EnableCollision = m_EnableCollision; }