예제 #1
0
 public override void RemoveContactEntity(idEntity entity)
 {
     if (this.Disposed == true)
     {
         throw new ObjectDisposedException(this.GetType().Name);
     }
 }
예제 #2
0
        public idClipModel(idClipModel model)
        {
            _id    = model.ID;
            _owner = model.Owner;

            _enabled = model.Enabled;
            _entity  = model.Entity;

            _origin    = model.Origin;
            _axis      = model.Axis;
            _bounds    = model.Bounds;
            _absBounds = model.AbsoluteBounds;

            _material             = model.Material;
            _contents             = model.Contents;
            _collisionModelHandle = model.CollisionModelHandle;
            _traceModelCache      = null;

            if (model.TraceModelCache != null)
            {
                idConsole.Warning("TODO: LoadModel( *GetCachedTraceModel( model->traceModelIndex ) );");
            }

            _renderModelHandle = model.RenderModelHandle;
            _touchCount        = -1;
        }
예제 #3
0
        public override void AddContactEntity(idEntity entity)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            bool found = false;

            for (int i = 0; i < _contactEntities.Count; i++)
            {
                idEntity ent = _contactEntities[i];

                if (ent == null)
                {
                    _contactEntities.RemoveAt(i--);
                }

                if (ent == entity)
                {
                    found = true;
                }
            }

            if (found == false)
            {
                _contactEntities.Add(entity);
            }
        }
예제 #4
0
 public override void SetMaster(idEntity master, bool orientated = true)
 {
     if (this.Disposed == true)
     {
         throw new ObjectDisposedException(this.GetType().Name);
     }
 }
예제 #5
0
        public void Link(idClip clip, idEntity entity, int newID, Vector3 newOrigin, Matrix newAxis, int renderModelHandle)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException("idClipModel");
            }

            _entity = entity;
            _id     = newID;
            _origin = newOrigin;
            _axis   = newAxis;

            if (_renderModelHandle != -1)
            {
                _renderModelHandle = renderModelHandle;

                RenderEntityComponent renderEntity = idR.Game.RenderWorld.GetRenderEntity(renderModelHandle);

                if (renderEntity != null)
                {
                    _bounds = renderEntity.Bounds;
                }
            }

            Link(clip);
        }
예제 #6
0
        public override void AddForce(idEntity entity, int id, Vector3 point, Vector3 force)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            idConsole.Warning("TODO: idAFEntity.AddForce");
        }
예제 #7
0
		public override void Damage(idEntity inflictor, idEntity attacker, Microsoft.Xna.Framework.Vector3 direction, string damageDefName, float damageScale, int location)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			idConsole.Warning("TODO: idAFEntity_Gibbable.Damage");
		}
예제 #8
0
        public override void Damage(idEntity inflictor, idEntity attacker, Vector3 direction, string damageDefName, float damageScale, int location)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            idConsole.Warning("TODO: idActor.Damage");
        }
예제 #9
0
        public override void Teleport(Vector3 origin, idAngles angles, idEntity destination)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            idConsole.Warning("TODO: idActor.Teleport");
        }
예제 #10
0
        public override void SetMaster(idEntity master, bool orientated = true)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            idConsole.Warning("TODO: idPhysics_Player.SetMaster");
        }
예제 #11
0
        public override object GetImpactInfo(idEntity entity, int id, Vector3 point)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            idConsole.Warning("TODO: idAFEntity.GetImpactInfo");

            return(null);
        }
예제 #12
0
        public override bool Pain(idEntity inflictor, idEntity attacker, int damage, Vector3 direction, int location)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            idConsole.Warning("TODO: idActor.Pain");

            return(false);
        }
예제 #13
0
        /// <summary>
        /// Add contact entity links to contact entities.
        /// </summary>
        protected void AddContactEntitiesForContacts()
        {
            int count = _contacts.Count;

            for (int i = 0; i < count; i++)
            {
                idEntity ent = idR.Game.Entities[_contacts[i].EntityIndex];

                if ((ent != null) && (ent != this.Self))
                {
                    ent.AddContactEntity(this.Self);
                }
            }
        }
예제 #14
0
        /// <summary>
        /// Active all contact entities.
        /// </summary>
        protected void ActivateContactEntities()
        {
            for (int i = 0; i < _contactEntities.Count; i++)
            {
                idEntity ent = _contactEntities[i];

                if (ent != null)
                {
                    ent.ActivatePhysics(this.Self);
                }
                else
                {
                    _contactEntities.RemoveAt(i--);
                }
            }
        }
예제 #15
0
        public idAnimator(idEntity entity)
        {
            _entity            = entity;
            _lastTransformTime = -1;

            idConsole.Warning("TODO: ClearAFPose();");

            for (int i = (int)AnimationChannel.All; i < (int)AnimationChannel.Count; i++)
            {
                for (int j = 0; j < idR.AnimationCountPerChannel; j++)
                {
                    _channels[i, j] = new idAnimBlend();
                    _channels[i, j].Reset(null);
                }
            }
        }
예제 #16
0
		public idAnimator(idEntity entity)
		{
			_entity = entity;
			_lastTransformTime = -1;

			idConsole.Warning("TODO: ClearAFPose();");

			for(int i = (int) AnimationChannel.All; i < (int) AnimationChannel.Count; i++)
			{
				for(int j = 0; j < idR.AnimationCountPerChannel; j++)
				{
					_channels[i, j] = new idAnimBlend();
					_channels[i, j].Reset(null);
				}
			}
		}
예제 #17
0
        public override void ClearContacts()
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            int count = _contacts.Count;

            for (int i = 0; i < count; i++)
            {
                idEntity ent = idR.Game.Entities[_contacts[i].EntityIndex];

                if (ent != null)
                {
                    ent.RemoveContactEntity(_self);
                }
            }

            _contacts.Clear();
        }
예제 #18
0
        public override void RemoveContactEntity(idEntity entity)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            for (int i = 0; i < _contactEntities.Count; i++)
            {
                idEntity ent = _contactEntities[i];

                if (ent == null)
                {
                    _contactEntities.RemoveAt(i--);
                }
                else if (ent == entity)
                {
                    _contactEntities.RemoveAt(i--);
                    return;
                }
            }
        }
예제 #19
0
        public override void SetMaster(idEntity master, bool orientated = true)
        {
            if (this.Disposed == true)
            {
                throw new ObjectDisposedException(this.GetType().Name);
            }

            Vector3 masterOrigin;
            Matrix  masterAxis;

            if (master != null)
            {
                if (_hasMaster == false)
                {
                    // transform from world space to master space
                    _self.GetMasterPosition(out masterOrigin, out masterAxis);
                    _localOrigin = Vector3.Transform(_origin - masterOrigin, Matrix.Transpose(masterAxis));

                    if (orientated == true)
                    {
                        _localAxis = _axis * Matrix.Transpose(masterAxis);
                    }
                    else
                    {
                        _localAxis = _axis;
                    }

                    _hasMaster    = true;
                    _isOrientated = orientated;
                }
            }
            else
            {
                if (_hasMaster == true)
                {
                    _hasMaster = false;
                }
            }
        }
예제 #20
0
		public override void SetMaster(idEntity master, bool orientated = true)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			idConsole.Warning("TODO: idPhysics_Player.SetMaster");
		}
예제 #21
0
		public idClipModel(idClipModel model)
		{
			_id = model.ID;
			_owner = model.Owner;
			
			_enabled = model.Enabled;
			_entity = model.Entity;

			_origin = model.Origin;
			_axis = model.Axis;
			_bounds = model.Bounds;
			_absBounds = model.AbsoluteBounds;

			_material = model.Material;
			_contents = model.Contents;
			_collisionModelHandle = model.CollisionModelHandle;
			_traceModelCache = null;

			if(model.TraceModelCache != null)
			{
				idConsole.Warning("TODO: LoadModel( *GetCachedTraceModel( model->traceModelIndex ) );");
			}

			_renderModelHandle = model.RenderModelHandle;
			_touchCount = -1;
		}
예제 #22
0
		/// <summary>
		/// 
		/// </summary>
		/// <remarks>
		/// an ent will be excluded from testing if:
		/// cm->entity == passEntity (don't clip against the pass entity)
		/// cm->entity == passOwner (missiles don't clip with owner)
		/// cm->owner == passEntity (don't interact with your own missiles)
		/// cm->owner == passOwner (don't interact with other missiles from same owner)
		/// </remarks>
		/// <param name="bounds"></param>
		/// <param name="contentMask"></param>
		/// <param name="passEntity"></param>
		/// <returns></returns>
		private idClipModel[] GetTraceClipModels(idBounds bounds, ContentFlags contentMask, idEntity passEntity)
		{
			idConsole.Warning("TODO: idClip.GetTraceClipModels");
			// TODO
			/*int i, num;
			idClipModel	*cm;
			idEntity *passOwner;

			num = ClipModelsTouchingBounds( bounds, contentMask, clipModelList, MAX_GENTITIES );

			if ( !passEntity ) {
				return num;
			}

			if ( passEntity->GetPhysics()->GetNumClipModels() > 0 ) {
				passOwner = passEntity->GetPhysics()->GetClipModel()->GetOwner();
			} else {
				passOwner = NULL;
			}

			for ( i = 0; i < num; i++ ) {

				cm = clipModelList[i];

				// check if we should ignore this entity
				if ( cm->entity == passEntity ) {
					clipModelList[i] = NULL;			// don't clip against the pass entity
				} else if ( cm->entity == passOwner ) {
					clipModelList[i] = NULL;			// missiles don't clip with their owner
				} else if ( cm->owner ) {
					if ( cm->owner == passEntity ) {
						clipModelList[i] = NULL;		// don't clip against own missiles
					} else if ( cm->owner == passOwner ) {
						clipModelList[i] = NULL;		// don't clip against other missiles from same owner
					}
				}
			}

			return num;*/

			return null;
		}
예제 #23
0
		public override void SetMaster(idEntity master, bool orientated = true)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			Vector3 masterOrigin;
			Matrix masterAxis;

			if(master != null)
			{
				if(_hasMaster == false)
				{
					// transform from world space to master space
					_self.GetMasterPosition(out masterOrigin, out masterAxis);
					_localOrigin = Vector3.Transform(_origin - masterOrigin, Matrix.Transpose(masterAxis));

					if(orientated == true)
					{
						_localAxis = _axis * Matrix.Transpose(masterAxis);
					}
					else
					{
						_localAxis = _axis;
					}

					_hasMaster = true;
					_isOrientated = orientated;
				}
			}
			else
			{
				if(_hasMaster == true)
				{
					_hasMaster = false;
				}
			}
		}
예제 #24
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);
        }
예제 #25
0
        public bool Translation(out TraceResult result, Vector3 start, Vector3 end, idClipModel model, Matrix traceModelAxis, ContentFlags contentMask, idEntity passEntity)
        {
            idConsole.Warning("TODO: idClip.Translation");
            // TODO

            /*if(TestHugeTranslation(result, model, start, end, traceModelAxis) == true)
             * {
             *      return true;
             * }*/

            // TODO

            /*idTraceModel traceModel = TraceModelForClipModel(model);
             * idBounds traceBounds = new idBounds();
             * TraceResult traceResult;
             * float radius = 0;
             *
             * if((passEntity == null) || (passEntity.Index != idR.EntityIndexWorld))
             * {
             *      // test world
             *      _translationCount++;
             *
             *      // TODO: idR.CollisionModelManager.Translation(out result, start, end, 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 = end;
             *      result.EndAxis = traceModelAxis;
             * }
             *
             * if(traceModel == null)
             * {
             *      traceBounds = idBounds.FromPointTranslation(start, result.EndPosition - start);
             *      radius = 0.0f;
             * }
             * else
             * {
             *      traceBounds = idBounds.FromBoundsTranslation(traceModel.Bounds, start, traceModelAxis, result.EndPosition - start);
             *      radius = traceModel.Bounds.GetRadius();
             * }
             *
             * idClipModel[] clipModelList = GetTraceClipModels(traceBounds, contentMask, passEntity);
             *
             * foreach(idClipModel touch in clipModelList)
             * {
             *      if(touch == null)
             *      {
             *              continue;
             *      }
             *
             *      if(touch.RenderModelHandle != -1)
             *      {
             *              _renderModelTraceCount++;
             *              traceResult = TraceRenderModel(start, end, radius, traceModelAxis, touch);
             *      }
             *      else
             *      {
             *              _translationCount++;
             *              // TODO: traceResult = idR.CollisionModelManager.Translation(start, end, 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);
        }
예제 #26
0
		public void Link(idClip clip, idEntity entity, int newID, Vector3 newOrigin, Matrix newAxis)
		{
			Link(clip, entity, newID, newOrigin, newAxis, -1);
		}
예제 #27
0
		public override bool Pain(idEntity inflictor, idEntity attacker, int damage, Vector3 direction, int location)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			idConsole.Warning("TODO: idActor.Pain");

			return false;
		}
예제 #28
0
		public override void SetMaster(idEntity master, bool orientated = true)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}
		}
예제 #29
0
		public override void RemoveContactEntity(idEntity entity)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			for(int i = 0; i < _contactEntities.Count; i++)
			{
				idEntity ent = _contactEntities[i];

				if(ent == null)
				{
					_contactEntities.RemoveAt(i--);
				}
				else if(ent == entity)
				{
					_contactEntities.RemoveAt(i--);
					return;
				}
			}				
		}
예제 #30
0
		public override void AddContactEntity(idEntity entity)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			bool found = false;

			for(int i = 0; i < _contactEntities.Count; i++)
			{
				idEntity ent = _contactEntities[i];

				if(ent == null)
				{
					_contactEntities.RemoveAt(i--);
				}

				if(ent == entity)
				{
					found = true;
				}
			}

			if(found == false)
			{
				_contactEntities.Add(entity);
			}
		}
예제 #31
0
		public void Link(idClip clip, idEntity entity, int newID, Vector3 newOrigin, Matrix newAxis, int renderModelHandle)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException("idClipModel");
			}

			_entity = entity;
			_id = newID;
			_origin = newOrigin;
			_axis = newAxis;

			if(_renderModelHandle != -1)
			{
				_renderModelHandle = renderModelHandle;

				RenderEntityComponent renderEntity = idR.Game.RenderWorld.GetRenderEntity(renderModelHandle);

				if(renderEntity != null)
				{
					_bounds = renderEntity.Bounds;
				}
			}

			Link(clip);
		}
예제 #32
0
		public override void Teleport(Vector3 origin, idAngles angles, idEntity destination)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			idConsole.Warning("TODO: idActor.Teleport");
		}
예제 #33
0
        public ContentFlags Contents(Vector3 start, idClipModel model, Matrix traceModelAxis, ContentFlags contentMask, idEntity passEntity)
        {
            idConsole.Warning("TODO: idClip.Contents");
            ContentFlags contents         = ContentFlags.None;
            idBounds     traceModelBounds = new idBounds();

            // TODO

            /*idTraceModel traceModel = TraceModelForClipModel(model);
             *
             * if((passEntity == null) || (passEntity.Index != idR.EntityIndexWorld))
             * {
             *      // test world
             *      _contentCount++;
             *      // TODO: NEED ENGINE SOURCE contents = idR.CollisionModelManager.Contents(start, traceModel, traceModelAxis, contentMask, 0, Vector3.Zero, Matrix.Identity);
             * }
             * else
             * {
             *      contents = ContentFlags.None;
             * }
             *
             * if(traceModel == null)
             * {
             *      traceModelBounds.Min = start;
             *      traceModelBounds.Max = start;
             * }
             * else if(traceModelAxis != Matrix.Identity)
             * {
             *      traceModelBounds = idBounds.FromTransformedBounds(traceModel.Bounds, start, traceModelAxis);
             * }
             * else
             * {
             *      traceModelBounds.Min = traceModel.Bounds.Min + start;
             *      traceModelBounds.Max = traceModel.Bounds.Max + start;
             * }
             *
             * idClipModel[] traceModelList = GetTraceClipModels(traceModelBounds, -1, passEntity);
             *
             * foreach(idClipModel touch in traceModelList)
             * {
             *      if(touch == null)
             *      {
             *              continue;
             *      }
             *
             *      // no contents test with render models
             *      if(touch.RenderModelHandle != -1)
             *      {
             *              continue;
             *      }
             *
             *      // if the entity does not have any contents we are looking for
             *      if((touch.Contents & contentMask) == ContentFlags.None)
             *      {
             *              continue;
             *      }
             *
             *      // if the entity has no new contents flags
             *      if((touch.Contents & contents) == touch.Contents)
             *      {
             *              continue;
             *      }
             *
             *      _contentCount++;
             *
             *      // TODO
             *      /*if(idR.CollisionModelManager.Contents(start, traceModel, traceModelAxis, contentMask, touch.Handle, touch.Origin, touch.Axis) > 0)
             *      {
             *              contents |= (touch.Contents & contentMask);
             *      }*/
            /*}*/

            return(contents);
        }
예제 #34
0
 public abstract void AddContactEntity(idEntity entity);
예제 #35
0
        /// <summary>
        ///
        /// </summary>
        /// <remarks>
        /// an ent will be excluded from testing if:
        /// cm->entity == passEntity (don't clip against the pass entity)
        /// cm->entity == passOwner (missiles don't clip with owner)
        /// cm->owner == passEntity (don't interact with your own missiles)
        /// cm->owner == passOwner (don't interact with other missiles from same owner)
        /// </remarks>
        /// <param name="bounds"></param>
        /// <param name="contentMask"></param>
        /// <param name="passEntity"></param>
        /// <returns></returns>
        private idClipModel[] GetTraceClipModels(idBounds bounds, ContentFlags contentMask, idEntity passEntity)
        {
            idConsole.Warning("TODO: idClip.GetTraceClipModels");
            // TODO

            /*int i, num;
            *  idClipModel	*cm;
            *  idEntity *passOwner;
            *
            *  num = ClipModelsTouchingBounds( bounds, contentMask, clipModelList, MAX_GENTITIES );
            *
            *  if ( !passEntity ) {
            *       return num;
            *  }
            *
            *  if ( passEntity->GetPhysics()->GetNumClipModels() > 0 ) {
            *       passOwner = passEntity->GetPhysics()->GetClipModel()->GetOwner();
            *  } else {
            *       passOwner = NULL;
            *  }
            *
            *  for ( i = 0; i < num; i++ ) {
            *
            *       cm = clipModelList[i];
            *
            *       // check if we should ignore this entity
            *       if ( cm->entity == passEntity ) {
            *               clipModelList[i] = NULL;			// don't clip against the pass entity
            *       } else if ( cm->entity == passOwner ) {
            *               clipModelList[i] = NULL;			// missiles don't clip with their owner
            *       } else if ( cm->owner ) {
            *               if ( cm->owner == passEntity ) {
            *                       clipModelList[i] = NULL;		// don't clip against own missiles
            *               } else if ( cm->owner == passOwner ) {
            *                       clipModelList[i] = NULL;		// don't clip against other missiles from same owner
            *               }
            *       }
            *  }
            *
            *  return num;*/

            return(null);
        }
예제 #36
0
		public abstract void SetMaster(idEntity master, bool orientated = true);
예제 #37
0
		public abstract void AddContactEntity(idEntity entity);
예제 #38
0
		public abstract void RemoveContactEntity(idEntity entity);
예제 #39
0
		public override object GetImpactInfo(idEntity entity, int id, Vector3 point)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			idConsole.Warning("TODO: idAFEntity.GetImpactInfo");

			return null;
		}
예제 #40
0
 public abstract void SetMaster(idEntity master, bool orientated = true);
예제 #41
0
 public void Link(idClip clip, idEntity entity, int newID, Vector3 newOrigin, Matrix newAxis)
 {
     Link(clip, entity, newID, newOrigin, newAxis, -1);
 }
예제 #42
0
		public bool Translation(out TraceResult result, Vector3 start, Vector3 end, idClipModel model, Matrix traceModelAxis, ContentFlags contentMask, idEntity passEntity)
		{
			idConsole.Warning("TODO: idClip.Translation");
			// TODO
			/*if(TestHugeTranslation(result, model, start, end, traceModelAxis) == true)
			{
				return true;
			}*/

			// TODO
			/*idTraceModel traceModel = TraceModelForClipModel(model);
			idBounds traceBounds = new idBounds();
			TraceResult traceResult;
			float radius = 0;

			if((passEntity == null) || (passEntity.Index != idR.EntityIndexWorld))
			{
				// test world
				_translationCount++;

				// TODO: idR.CollisionModelManager.Translation(out result, start, end, 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 = end;
				result.EndAxis = traceModelAxis;
			}

			if(traceModel == null)
			{
				traceBounds = idBounds.FromPointTranslation(start, result.EndPosition - start);
				radius = 0.0f;
			}
			else
			{
				traceBounds = idBounds.FromBoundsTranslation(traceModel.Bounds, start, traceModelAxis, result.EndPosition - start);
				radius = traceModel.Bounds.GetRadius();
			}

			idClipModel[] clipModelList = GetTraceClipModels(traceBounds, contentMask, passEntity);

			foreach(idClipModel touch in clipModelList)
			{
				if(touch == null)
				{
					continue;
				}

				if(touch.RenderModelHandle != -1)
				{
					_renderModelTraceCount++;
					traceResult = TraceRenderModel(start, end, radius, traceModelAxis, touch);
				}
				else
				{
					_translationCount++;
					// TODO: traceResult = idR.CollisionModelManager.Translation(start, end, 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;
		}
예제 #43
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;
		}
예제 #44
0
		public override void AddForce(idEntity entity, int id, Vector3 point, Vector3 force)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			idConsole.Warning("TODO: idAFEntity.AddForce");
		}
예제 #45
0
		public ContentFlags Contents(Vector3 start, idClipModel model, Matrix traceModelAxis, ContentFlags contentMask, idEntity passEntity)
		{
			idConsole.Warning("TODO: idClip.Contents");
			ContentFlags contents = ContentFlags.None;
			idBounds traceModelBounds = new idBounds();
			
			// TODO
			/*idTraceModel traceModel = TraceModelForClipModel(model);

			if((passEntity == null) || (passEntity.Index != idR.EntityIndexWorld))
			{
				// test world
				_contentCount++;
				// TODO: NEED ENGINE SOURCE contents = idR.CollisionModelManager.Contents(start, traceModel, traceModelAxis, contentMask, 0, Vector3.Zero, Matrix.Identity);
			}
			else
			{
				contents = ContentFlags.None;
			}

			if(traceModel == null)
			{
				traceModelBounds.Min = start;
				traceModelBounds.Max = start;
			}
			else if(traceModelAxis != Matrix.Identity)
			{
				traceModelBounds = idBounds.FromTransformedBounds(traceModel.Bounds, start, traceModelAxis);
			}
			else
			{
				traceModelBounds.Min = traceModel.Bounds.Min + start;
				traceModelBounds.Max = traceModel.Bounds.Max + start;
			}

			idClipModel[] traceModelList = GetTraceClipModels(traceModelBounds, -1, passEntity);

			foreach(idClipModel touch in traceModelList)
			{
				if(touch == null)
				{
					continue;
				}

				// no contents test with render models
				if(touch.RenderModelHandle != -1)
				{
					continue;
				}

				// if the entity does not have any contents we are looking for
				if((touch.Contents & contentMask) == ContentFlags.None)
				{
					continue;
				}

				// if the entity has no new contents flags
				if((touch.Contents & contents) == touch.Contents)
				{
					continue;
				}

				_contentCount++;

				// TODO
				/*if(idR.CollisionModelManager.Contents(start, traceModel, traceModelAxis, contentMask, touch.Handle, touch.Origin, touch.Axis) > 0)
				{
					contents |= (touch.Contents & contentMask);
				}*/
			/*}*/

			return contents;
		}
예제 #46
0
 public abstract void RemoveContactEntity(idEntity entity);
예제 #47
0
		public override void RemoveContactEntity(idEntity entity)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}
		}