internal override void getInfo1( ref btConstraintInfo1 info )
		{
			//prepare constraint
			calculateTransforms( ref m_rbA.m_worldTransform, ref m_rbB.m_worldTransform );
			info.m_numConstraintRows = 0;
			info.nub = 0;
			int i;
			//test linear limits
			for( i = 0; i < 3; i++ )
			{
				if( m_linearLimits.m_currentLimit[i] == 4 ) info.m_numConstraintRows += 2;
				else if( m_linearLimits.m_currentLimit[i] != 0 ) info.m_numConstraintRows += 1;
				if( m_linearLimits.m_enableMotor[i] ) info.m_numConstraintRows += 1;
				if( m_linearLimits.m_enableSpring[i] ) info.m_numConstraintRows += 1;
			}
			//test angular limits
			for( i = 0; i < 3; i++ )
			{
				testAngularLimitMotor( i );
				if( m_angularLimits[i].m_currentLimit == 4 ) info.m_numConstraintRows += 2;
				else if( m_angularLimits[i].m_currentLimit != 0 ) info.m_numConstraintRows += 1;
				if( m_angularLimits[i].m_enableMotor ) info.m_numConstraintRows += 1;
				if( m_angularLimits[i].m_enableSpring ) info.m_numConstraintRows += 1;
			}
		}
		internal override void getInfo1( ref btConstraintInfo1 info )
		{
			getInfo1NonVirtual( ref info );
		}
		void getInfo1NonVirtual( ref btConstraintInfo1 info )
		{
			info.m_numConstraintRows = 3;
			info.nub = 3;
		}
Esempio n. 4
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(btConstraintInfo1 obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Esempio n. 5
0
	virtual void getInfo1 (btConstraintInfo1* info);
Esempio n. 6
0
		internal override void getInfo1( ref btConstraintInfo1 info )
		{
			if( m_useSolveConstraintObsolete )
			{
				info.m_numConstraintRows = 0;
				info.nub = 0;
			}
			else
			{
				//prepare constraint
				calculateTransforms( ref m_rbA.m_worldTransform, ref m_rbB.m_worldTransform );
				info.m_numConstraintRows = 0;
				info.nub = 6;
				int i;
				//test linear limits
				for( i = 0; i < 3; i++ )
				{
					if( m_linearLimits.needApplyForce( i ) )
					{
						info.m_numConstraintRows++;
						info.nub--;
					}
				}
				//test angular limits
				for( i = 0; i < 3; i++ )
				{
					if( testAngularLimitMotor( i ) )
					{
						info.m_numConstraintRows++;
						info.nub--;
					}
				}
			}
		}
Esempio n. 7
0
		void getInfo1NonVirtual( ref btConstraintInfo1 info )
		{
			if( m_useSolveConstraintObsolete )
			{
				info.m_numConstraintRows = 0;
				info.nub = 0;
			}
			else
			{
				//pre-allocate all 6
				info.m_numConstraintRows = 6;
				info.nub = 0;
			}
		}
Esempio n. 8
0
		internal override void getInfo1( ref btConstraintInfo1 info )
		{
			/*
			if( m_useSolveConstraintObsolete )
			{
				info.m_numConstraintRows = 0;
				info.nub = 0;
			}
			else
			*/
			{
				info.m_numConstraintRows = 5; // Fixed 3 linear + 2 angular
				info.nub = 1;
				//always add the row, to avoid computation (data is not available yet)
				//prepare constraint
				testLimit( ref m_rbA.m_worldTransform, ref m_rbB.m_worldTransform );
				if( getSolveLimit() || getEnableAngularMotor() )
				{
					info.m_numConstraintRows++; // limit 3rd anguar as well
					info.nub--;
				}

			}
		}
Esempio n. 9
0
		public void getInfo1NonVirtual( out btConstraintInfo1 info )
		{
			{
				//always add the 'limit' row, to avoid computation (data is not available yet)
				info.m_numConstraintRows = 6; // Fixed 3 linear + 2 angular
				info.nub = 0;
			}
		}
Esempio n. 10
0
		internal void getInfo1NonVirtual( ref btConstraintInfo1 info )
		{

			info.m_numConstraintRows = 6; // Fixed 2 linear + 2 angular + 1 limit (even if not used)
			info.nub = 0;
		}
Esempio n. 11
0
		void getInfo1( btConstraintInfo1 info )
		{
			//update m_accumulatedAngle
			double curHingeAngle = getHingeAngle();
			m_accumulatedAngle = btShortestAngleUpdate( m_accumulatedAngle, curHingeAngle );
			base.getInfo1( ref info );
		}
Esempio n. 12
0
		internal override void getInfo1( ref btConstraintInfo1 info )
		{
			/*
			if( m_useSolveConstraintObsolete )
			{
				info.m_numConstraintRows = 0;
				info.nub = 0;
			}
			else
			*/
			{
				info.m_numConstraintRows = 4; // Fixed 2 linear + 2 angular
				info.nub = 2;
				//prepare constraint
				calculateTransforms( ref m_rbA.m_worldTransform, ref m_rbB.m_worldTransform );
				testAngLimits();
				testLinLimits();
				if( getSolveLinLimit() || getPoweredLinMotor() )
				{
					info.m_numConstraintRows++; // limit 3rd linear as well
					info.nub--;
				}
				if( getSolveAngLimit() || getPoweredAngMotor() )
				{
					info.m_numConstraintRows++; // limit 3rd angular as well
					info.nub--;
				}
			}
		}
Esempio n. 13
0
		void getInfo1NonVirtual( btConstraintInfo1* info );
Esempio n. 14
0
		///internal method used by the constraint solver, don't use them directly
		internal abstract void getInfo1( ref btConstraintInfo1 info );
Esempio n. 15
0
		void getInfo1NonVirtual( ref btConstraintInfo1 info )
		{
			//always reserve 6 rows: object transform is not available on SPU
			info.m_numConstraintRows = 6;
			info.nub = 0;
		}
Esempio n. 16
0
		internal override void getInfo1( ref btConstraintInfo1 info )
		{
			/*
			if( m_useSolveConstraintObsolete )
			{
				info.m_numConstraintRows = 0;
				info.nub = 0;
			}
			else
			*/
			{
				info.m_numConstraintRows = 3;
				info.nub = 3;
				calcAngleInfo2( ref m_rbA.m_worldTransform, ref m_rbB.m_worldTransform, ref m_rbA.m_invInertiaTensorWorld, ref m_rbB.m_invInertiaTensorWorld );
				if( m_solveSwingLimit )
				{
					info.m_numConstraintRows++;
					info.nub--;
					if( ( m_swingSpan1 < m_fixThresh ) && ( m_swingSpan2 < m_fixThresh ) )
					{
						info.m_numConstraintRows++;
						info.nub--;
					}
				}
				if( m_solveTwistLimit )
				{
					info.m_numConstraintRows++;
					info.nub--;
				}
			}
		}