Contains settings for motors which act on two entities' relative orientation.
Inheritance: MotorSettings
        /// <summary>
        /// Constructs a new constraint which attempts to restrict the relative angular velocity of two entities to some value.
        /// </summary>
        /// <param name="entity">Affected entity.</param>
        public SingleEntityAngularMotor(Entity entity)
        {
            Entity = entity;

            settings = new MotorSettingsOrientation(this) {servo = {goal = base.entity.orientation}};
            //Since no target relative orientation was specified, just use the current relative orientation.  Prevents any nasty start-of-sim 'snapping.'

            //mySettings.myServo.springSettings.stiffnessConstant *= .5f;
        }
        /// <summary>
        /// Constructs a new constraint which attempts to restrict the relative angular motion of two entities.
        /// </summary>
        /// <param name="connectionA">First connection of the pair.</param>
        /// <param name="connectionB">Second connection of the pair.</param>
        public AngularMotor(Entity connectionA, Entity connectionB)
        {
            ConnectionA = connectionA;
            ConnectionB = connectionB;

            settings = new MotorSettingsOrientation(this);

            //Compute the rotation from A to B in A's local space.
            Quaternion orientationAConjugate;
            Quaternion.Conjugate(ref connectionA.orientation, out orientationAConjugate);
            Quaternion.Concatenate(ref connectionB.orientation, ref orientationAConjugate, out settings.servo.goal);
        }
Exemple #3
0
        /// <summary>
        /// Constructs a new constraint which attempts to restrict the relative angular motion of two entities.
        /// </summary>
        /// <param name="connectionA">First connection of the pair.</param>
        /// <param name="connectionB">Second connection of the pair.</param>
        public AngularMotor(Entity connectionA, Entity connectionB)
        {
            ConnectionA = connectionA;
            ConnectionB = connectionB;

            settings = new MotorSettingsOrientation(this);

            //Compute the rotation from A to B in A's local space.
            System.Numerics.Quaternion orientationAConjugate;
            QuaternionEx.Conjugate(ref connectionA.orientation, out orientationAConjugate);
            QuaternionEx.Concatenate(ref connectionB.orientation, ref orientationAConjugate, out settings.servo.goal);
        }
Exemple #4
0
        /// <summary>
        /// Constructs a new constraint which attempts to restrict the relative angular motion of two entities.
        /// </summary>
        /// <param name="connectionA">First connection of the pair.</param>
        /// <param name="connectionB">Second connection of the pair.</param>
        public AngularMotor(Entity connectionA, Entity connectionB)
        {
            ConnectionA = connectionA;
            ConnectionB = connectionB;

            settings = new MotorSettingsOrientation(this);

            //Since no target relative orientation was specified, just use the current relative orientation.  Prevents any nasty start-of-sim 'snapping.'
            Quaternion orientationBConjugate;

            Quaternion.Conjugate(ref this.connectionB.orientation, out orientationBConjugate);
            Quaternion.Multiply(ref this.connectionA.orientation, ref orientationBConjugate, out settings.servo.goal);
        }
 /// <summary>
 /// Constructs a new constraint which attempts to restrict the relative angular velocity of two entities to some value.
 /// This constructor will make the angular motor start with isActive set to false.
 /// </summary>
 public SingleEntityAngularMotor()
 {
     settings = new MotorSettingsOrientation(this);
     IsActive = false;
 }
 /// <summary>
 /// Constructs a new constraint which attempts to restrict the relative angular motion of two entities.
 /// To finish the initialization, specify the connections (ConnectionA and ConnectionB).
 /// This constructor sets the constraint's IsActive property to false by default.
 /// </summary>
 public AngularMotor()
 {
     IsActive = false;
     settings = new MotorSettingsOrientation(this);
 }
Exemple #7
0
 /// <summary>
 /// Constructs a new constraint which attempts to restrict the relative angular motion of two entities.
 /// To finish the initialization, specify the connections (ConnectionA and ConnectionB).
 /// This constructor sets the constraint's IsActive property to false by default.
 /// </summary>
 public AngularMotor()
 {
     IsActive = false;
     settings = new MotorSettingsOrientation(this);
 }