Esempio n. 1
0
		void init()
		{
			m_angularOnly = false;
			m_solveTwistLimit = false;
			m_solveSwingLimit = false;
			m_bMotorEnabled = false;
			m_maxMotorImpulse = btScalar.BT_NEG_ONE;


			setLimit( ( btScalar.BT_LARGE_FLOAT ), ( btScalar.BT_LARGE_FLOAT ), btScalar.BT_LARGE_FLOAT );
			m_damping = (double)( 0.01 );
			m_fixThresh = CONETWIST_DEF_FIX_THRESH;
			m_flags = 0;
			m_linCFM = (double)( 0 );
			m_linERP = (double)( 0.7f );
			m_angCFM = (double)( 0 );
		}
Esempio n. 2
0
		///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 
		///If no axis is provided, it uses the default axis for this constraint.
		public override void setParam( btConstraintParams num, double value, int axis = -1 )
		{
			switch( num )
			{
				case btConstraintParams.BT_CONSTRAINT_ERP:
				case btConstraintParams.BT_CONSTRAINT_STOP_ERP:
					if( ( axis >= 0 ) && ( axis < 3 ) )
					{
						m_linERP = value;
						m_flags |= btConeTwistFlags.BT_CONETWIST_FLAGS_LIN_ERP;
					}
					else
					{
						m_biasFactor = value;
					}
					break;
				case btConstraintParams.BT_CONSTRAINT_CFM:
				case btConstraintParams.BT_CONSTRAINT_STOP_CFM:
					if( ( axis >= 0 ) && ( axis < 3 ) )
					{
						m_linCFM = value;
						m_flags |= btConeTwistFlags.BT_CONETWIST_FLAGS_LIN_CFM;
					}
					else
					{
						m_angCFM = value;
						m_flags |= btConeTwistFlags.BT_CONETWIST_FLAGS_ANG_CFM;
					}
					break;
				default:
					btAssertConstrParams( false );
					break;
			}
		}