Ejemplo n.º 1
0
 public override void Rotate(idRotation rotation, int id = 1)
 {
     if (this.Disposed == true)
     {
         throw new ObjectDisposedException(this.GetType().Name);
     }
 }
Ejemplo n.º 2
0
        /// <remarks>
        /// Unlinks the clip model.
        /// </remarks>
        /// <param name="rotation"></param>
        public void Rotate(idRotation rotation)
        {
            Unlink();

            _origin *= rotation;
            _axis   *= rotation.ToMatrix();
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        public override TraceResult ClipRotation(idRotation rotation, idClipModel model)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            return(new TraceResult());
        }
Ejemplo n.º 5
0
        public override void Rotate(idRotation rotation, int id = 1)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            idConsole.Warning("TODO: idPhysics_Player.Rotate");
        }
Ejemplo n.º 6
0
        public TraceResult RotationModel(Vector3 start, idRotation rotation, idClipModel model, Matrix traceModelAxis, ContentFlags contentMask, int modelHandle, Vector3 modelOrigin, Matrix modelAxis)
        {
            idConsole.Warning("TODO: idClip.RotationModel");
            // TODO: idTraceModel traceModel = TraceModelForClipModel(model);

            _rotationCount++;

            // TODO: return idR.CollisionModelManager.Rotation(start, rotation, traceModel, traceModelAxis, contentMask, modelHandle, modelOrigin, modelAxis);
            return(new TraceResult());
        }
Ejemplo n.º 7
0
        public override TraceResult ClipRotation(idRotation rotation, idClipModel model)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            if (model != null)
            {
                idConsole.Warning("TODO: return idR.Game.Clip.RotationModel(_clipModel.Origin, rotation, _clipModel, _clipModel.Axis, _clipMask, model, model.Origin, model.Axis);");
            }
            else
            {
                idConsole.Warning("TODO: return idR.Game.Clip.Rotation(_clipModel.Origin, rotation, _clipModel, _clipModel.Axis, _clipMask, _self);");
            }

            return(new TraceResult());
        }
Ejemplo n.º 8
0
        public override TraceResult ClipRotation(idRotation rotation, idClipModel model)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            TraceResult result;

            if (model != null)
            {
                result = idR.Game.Clip.RotationModel(_origin, rotation, _clipModel, _axis, ContentFlags.MaskSolid,
                                                     model.Handle, model.Origin, model.Axis);
            }
            else
            {
                idR.Game.Clip.Rotation(out result, _origin, rotation, _clipModel, _axis, ContentFlags.MaskSolid, _self);
            }

            return(result);
        }
Ejemplo n.º 9
0
		/// <summary>
		/// Rotate the physics object in world space.
		/// </summary>
		/// <param name="rotation"></param>
		/// <param name="id"></param>
		public abstract void Rotate(idRotation rotation, int id = 1);
Ejemplo n.º 10
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);
			}
		}
Ejemplo n.º 11
0
		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);
			}
		}
Ejemplo n.º 12
0
		public override TraceResult ClipRotation(idRotation rotation, idClipModel model)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			if(model != null)
			{
				idConsole.Warning("TODO: return idR.Game.Clip.RotationModel(_clipModel.Origin, rotation, _clipModel, _clipModel.Axis, _clipMask, model, model.Origin, model.Axis);");
			}
			else
			{
				idConsole.Warning("TODO: return idR.Game.Clip.Rotation(_clipModel.Origin, rotation, _clipModel, _clipModel.Axis, _clipMask, _self);");
			}

			return new TraceResult();
		}
Ejemplo n.º 13
0
		public override void Rotate(idRotation rotation, int id = 1)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			idConsole.Warning("TODO: idPhysics_Player.Rotate");
		}
Ejemplo n.º 14
0
 public abstract TraceResult ClipRotation(idRotation rotation, idClipModel model);
Ejemplo n.º 15
0
 /// <summary>
 /// Rotate the physics object in world space.
 /// </summary>
 /// <param name="rotation"></param>
 /// <param name="id"></param>
 public abstract void Rotate(idRotation rotation, int id = 1);
Ejemplo n.º 16
0
		public override TraceResult ClipRotation(idRotation rotation, idClipModel model)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			return new TraceResult();
		}
Ejemplo n.º 17
0
		public override void Rotate(idRotation rotation, int id = 1)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}
		}
Ejemplo n.º 18
0
		/// <remarks>
		/// Unlinks the clip model.
		/// </remarks>
		/// <param name="rotation"></param>
		public void Rotate(idRotation rotation)
		{
			Unlink();

			_origin *= rotation;
			_axis *= rotation.ToMatrix();
		}
Ejemplo n.º 19
0
		public abstract TraceResult ClipRotation(idRotation rotation, idClipModel model);
Ejemplo n.º 20
0
		public override TraceResult ClipRotation(idRotation rotation, idClipModel model)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			TraceResult result;

			if(model != null)
			{
				result = idR.Game.Clip.RotationModel(_origin, rotation, _clipModel, _axis, ContentFlags.MaskSolid,
					model.Handle, model.Origin, model.Axis);
			}
			else
			{
				idR.Game.Clip.Rotation(out result, _origin, rotation, _clipModel, _axis, ContentFlags.MaskSolid, _self);
			}

			return result;
		}
Ejemplo n.º 21
0
        public bool Rotation(out TraceResult result, Vector3 start, idRotation rotation, idClipModel model, Matrix traceModelAxis, ContentFlags contentMask, idEntity passEntity)
        {
            idConsole.Warning("TODO: idClip.Rotation");

            /*idTraceModel traceModel = TraceModelForClipModel(model);
             * idBounds traceBounds = new idBounds();
             * TraceResult traceResult;
             *
             * if((passEntity == null) || (passEntity.Index != idR.EntityIndexWorld))
             * {
             *      // test world
             *      _rotationCount++;
             *
             *      // TODO: NEED ENGINE SOURCE idR.CollisionModelManager.Rotation(out result, start, rotation, traceModel, traceModelAxis, contentMask, 0, Vector3.Zero, Matrix.Identity);
             *      result.ContactInformation.EntityIndex = (result.Fraction != 1.0f) ? idR.EntityIndexWorld : idR.EntityIndexNone;
             *
             *      if(result.Fraction == 0.0f)
             *      {
             *              return true; // blocked immediately by the world
             *      }
             * }
             * else
             * {
             *      result = new TraceResult();
             *      result.Fraction = 1.0f;
             *      result.EndPosition = start;
             *      result.EndAxis = traceModelAxis * rotation.ToMatrix();
             * }
             *
             * if(traceModel == null)
             * {
             *      traceBounds = idBounds.FromPointRotation(start, rotation);
             * }
             * else
             * {
             *      traceBounds = idBounds.FromBoundsRotation(traceModel.Bounds, start, traceModelAxis, rotation);
             * }
             *
             * idClipModel[] clipModelList = GetTraceClipModels(traceBounds, contentMask, passEntity);
             *
             * foreach(idClipModel touch in clipModelList)
             * {
             *      if(touch == null)
             *      {
             *              continue;
             *      }
             *
             *      if(touch.RenderModelHandle != -1)
             *      {
             *              continue;
             *      }
             *
             *      _rotationCount++;
             *      // TODO: traceResult = idR.CollisionModelManager.Rotation(start, rotation, traceModel, traceModelAxis, contentMask, touch.Handle, touch.Origin, touch.Axis);
             *
             *      if(traceResult.Fraction < result.Fraction)
             *      {
             *              result = traceResult;
             *              result.ContactInformation.EntityIndex = touch.Entity.Index;
             *              result.ContactInformation.ID = touch.ID;
             *
             *              if(result.Fraction == 0.0f)
             *              {
             *                      break;
             *              }
             *      }
             * }
             *
             * return (result.Fraction < 1.0f);*/
            result = new TraceResult();
            return(false);
        }