/*
		void setAxis( ref btVector3 axis1, ref btVector3 axis2 );

		void setBounce( int index, double bounce );

		void enableMotor( int index, bool onOff );
		void setServo( int index, bool onOff ); // set the type of the motor (servo or not) (the motor has to be turned on for servo also)
		void setTargetVelocity( int index, double velocity );
		void setServoTarget( int index, double target );
		void setMaxMotorForce( int index, double force );

		void enableSpring( int index, bool onOff );
		void setStiffness( int index, double stiffness, bool limitIfNeeded = true ); // if limitIfNeeded is true the system will automatically limit the stiffness in necessary situations where otherwise the spring would move unrealistically too widely
		void setDamping( int index, double damping, bool limitIfNeeded = true ); // if limitIfNeeded is true the system will automatically limit the damping in necessary situations where otherwise the spring would blow up
		void setEquilibriumPoint(); // set the current constraint position/orientation as an equilibrium point for all DOF
		void setEquilibriumPoint( int index );  // set the current constraint position/orientation as an equilibrium point for given DOF
		void setEquilibriumPoint( int index, double val );
		*/

		//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.


		internal btGeneric6DofSpring2Constraint( btRigidBody rbA, btRigidBody rbB, ref btTransform frameInA, ref btTransform frameInB, RotateOrder rotOrder )
			: base( btObjectTypes.D6_SPRING_2_CONSTRAINT_TYPE, rbA, rbB )
		{
			m_frameInA = ( frameInA );
			m_frameInB = ( frameInB );
			m_rotateOrder = ( rotOrder );
			m_flags = ( 0 );
			calculateTransforms();
		}
		internal btGeneric6DofSpring2Constraint( btRigidBody rbB, ref btTransform frameInB, RotateOrder rotOrder )
			: base( btObjectTypes.D6_SPRING_2_CONSTRAINT_TYPE, getFixedBody(), rbB )
		{
			m_frameInB = ( frameInB );
			m_rotateOrder = ( rotOrder );
			m_flags = ( 0 );
			///not providing rigidbody A means implicitly using worldspace for body A
			rbB.m_worldTransform.Apply( ref m_frameInB, out m_frameInA );
			calculateTransforms();
		}
		//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 )
		{
			if( ( axis >= 0 ) && ( axis < 3 ) )
			{
				switch( num )
				{
					case btConstraintParams.BT_CONSTRAINT_STOP_ERP:
						m_linearLimits.m_stopERP[axis] = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_ERP_STOP2[axis];
						break;
					case btConstraintParams.BT_CONSTRAINT_STOP_CFM:
						m_linearLimits.m_stopCFM[axis] = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_CFM_STOP2[axis];
						break;
					case btConstraintParams.BT_CONSTRAINT_ERP:
						m_linearLimits.m_motorERP[axis] = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_ERP_MOTO2[axis];
						break;
					case btConstraintParams.BT_CONSTRAINT_CFM:
						m_linearLimits.m_motorCFM[axis] = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_CFM_MOTO2[axis];
						break;
					default:
						btAssertConstrParams( false );
						break;
				}
			}
			else if( ( axis >= 3 ) && ( axis < 6 ) )
			{
				switch( num )
				{
					case btConstraintParams.BT_CONSTRAINT_STOP_ERP:
						m_angularLimits[axis - 3].m_stopERP = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_ERP_STOP2[axis];
						break;
					case btConstraintParams.BT_CONSTRAINT_STOP_CFM:
						m_angularLimits[axis - 3].m_stopCFM = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_CFM_STOP2[axis];
						break;
					case btConstraintParams.BT_CONSTRAINT_ERP:
						m_angularLimits[axis - 3].m_motorERP = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_ERP_MOTO2[axis];
						break;
					case btConstraintParams.BT_CONSTRAINT_CFM:
						m_angularLimits[axis - 3].m_motorCFM = value;
						m_flags |= bt6DofFlagsIndexed.BT_6DOF_FLAGS_CFM_MOTO2[axis];
						break;
					default:
						btAssertConstrParams( false );
						break;
				}
			}
			else
			{
				btAssertConstrParams( false );
			}
		}