public override void Rotate(idRotation rotation, int id = -1)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            Vector3 masterOrigin;
            Matrix  masterAxis;

            _origin *= rotation;
            _axis   *= rotation.ToMatrix();

            if (_hasMaster == true)
            {
                _self.GetMasterPosition(out masterOrigin, out masterAxis);

                _localAxis  *= rotation.ToMatrix();
                _localOrigin = Vector3.Transform(_origin - masterOrigin, Matrix.Transpose(masterAxis));
            }
            else
            {
                _localAxis   = _axis;
                _localOrigin = _origin;
            }

            if (_clipModel != null)
            {
                _clipModel.Link(idR.Game.Clip, _self, 0, _origin, _axis);
            }
        }
Exemple #2
0
        /// <remarks>
        /// Unlinks the clip model.
        /// </remarks>
        /// <param name="rotation"></param>
        public void Rotate(idRotation rotation)
        {
            Unlink();

            _origin *= rotation;
            _axis   *= rotation.ToMatrix();
        }
Exemple #3
0
		/// <remarks>
		/// Unlinks the clip model.
		/// </remarks>
		/// <param name="rotation"></param>
		public void Rotate(idRotation rotation)
		{
			Unlink();

			_origin *= rotation;
			_axis *= rotation.ToMatrix();
		}
		public override void Rotate(idRotation rotation, int id = -1)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			Vector3 masterOrigin;
			Matrix masterAxis;

			_origin *= rotation;
			_axis *= rotation.ToMatrix();

			if(_hasMaster == true)
			{
				_self.GetMasterPosition(out masterOrigin, out masterAxis);

				_localAxis *= rotation.ToMatrix();
				_localOrigin = Vector3.Transform(_origin - masterOrigin, Matrix.Transpose(masterAxis));
			}
			else
			{
				_localAxis = _axis;
				_localOrigin = _origin;
			}

			if(_clipModel != null)
			{
				_clipModel.Link(idR.Game.Clip, _self, 0, _origin, _axis);
			}
		}
Exemple #5
0
		private void SetupTransforms(float x, float y)
		{
			Matrix transform = Matrix.Identity;
			Vector3 origin = new Vector3(_origin.X + x, _origin.Y + y, 0);

			if(_rotate.X > 0)
			{
				idRotation rot = new idRotation(origin, new Vector3(0, 0, 1), _rotate.X);

				transform = rot.ToMatrix();
			}

			if((_shear.X > 0) || (_shear.Y > 0))
			{
				Matrix mat = Matrix.Identity;
				mat.M12 = _shear.X;
				mat.M21 = _shear.Y;

				transform *= mat;
			}

			if(transform != Matrix.Identity)
			{
				_context.SetTransformInformation(origin, transform);
			}
		}