Exemple #1
0
        public void BecomeInactive(EntityThinkFlags flags)
        {
            if ((flags & EntityThinkFlags.Physics) == EntityThinkFlags.Physics)
            {
                // may only disable physics on a team master if no team members are running physics or bound to a joints
                if (_teamMaster == this)
                {
                    idConsole.Warning("TODO: teamMaster");

                    /*for ( idEntity *ent = teamMaster->teamChain; ent; ent = ent->teamChain ) {
                     *      if ( ( ent->thinkFlags & TH_PHYSICS ) || ( ( ent->bindMaster == this ) && ( ent->bindJoint != INVALID_JOINT ) ) ) {
                     *              flags &= ~TH_PHYSICS;
                     *              break;
                     *      }
                     * }*/
                }
            }

            if (_thinkFlags != 0)
            {
                _thinkFlags &= ~flags;

                if ((_thinkFlags == 0) && (this.IsActive == true))
                {
                    idR.Game.EntitiesToDeactivate++;
                }
            }

            if ((flags & EntityThinkFlags.Physics) == EntityThinkFlags.Physics)
            {
                // if this entity has a team master
                if ((_teamMaster != null) && (_teamMaster != this))
                {
                    // if the team master is at rest
                    if (_teamMaster.IsAtRest == true)
                    {
                        _teamMaster.BecomeInactive(EntityThinkFlags.Physics);
                    }
                }
            }
        }
Exemple #2
0
        public void BecomeActive(EntityThinkFlags flags)
        {
            if ((flags & EntityThinkFlags.Physics) == EntityThinkFlags.Physics)
            {
                // enable the team master if this entity is part of a physics team
                if ((_teamMaster != null) && (_teamMaster != this))
                {
                    _teamMaster.BecomeActive(EntityThinkFlags.Physics);
                }
                else if ((_thinkFlags & EntityThinkFlags.Physics) == 0)
                {
                    // if this is a pusher
                    if ((_physics is idPhysics_Parametric) || (_physics is idPhysics_Actor))
                    {
                        idR.Game.SortPushers = true;
                    }
                }
            }

            EntityThinkFlags oldFlags = _thinkFlags;

            _thinkFlags |= flags;

            if (_thinkFlags != 0)
            {
                if (this.IsActive == false)
                {
                    idR.Game.ActiveEntities.Add(this);
                }
                else if (oldFlags == 0)
                {
                    // we became inactive this frame, so we have to decrease the count of entities to deactivate
                    idR.Game.EntitiesToDeactivate--;
                }
            }
        }
Exemple #3
0
		public void BecomeInactive(EntityThinkFlags flags)
		{
			if((flags & EntityThinkFlags.Physics) == EntityThinkFlags.Physics)
			{
				// may only disable physics on a team master if no team members are running physics or bound to a joints
				if(_teamMaster == this)
				{
					idConsole.Warning("TODO: teamMaster");
		
					/*for ( idEntity *ent = teamMaster->teamChain; ent; ent = ent->teamChain ) {
						if ( ( ent->thinkFlags & TH_PHYSICS ) || ( ( ent->bindMaster == this ) && ( ent->bindJoint != INVALID_JOINT ) ) ) {
							flags &= ~TH_PHYSICS;
							break;
						}
					}*/
				}
			}

			if(_thinkFlags != 0)
			{
				_thinkFlags &= ~flags;

				if((_thinkFlags == 0) && (this.IsActive == true))
				{
					idR.Game.EntitiesToDeactivate++;
				}
			}

			if((flags & EntityThinkFlags.Physics) == EntityThinkFlags.Physics)
			{
				// if this entity has a team master
				if((_teamMaster != null) && (_teamMaster != this))
				{
					// if the team master is at rest
					if(_teamMaster.IsAtRest == true)
					{
						_teamMaster.BecomeInactive(EntityThinkFlags.Physics);
					}
				}
			}
		}
Exemple #4
0
		public void BecomeActive(EntityThinkFlags flags)
		{
			if((flags & EntityThinkFlags.Physics) == EntityThinkFlags.Physics)
			{
				// enable the team master if this entity is part of a physics team
				if((_teamMaster != null) && (_teamMaster != this))
				{
					_teamMaster.BecomeActive(EntityThinkFlags.Physics);
				}
				else if((_thinkFlags & EntityThinkFlags.Physics) == 0)
				{
					// if this is a pusher
					if((_physics is idPhysics_Parametric) || (_physics is idPhysics_Actor))
					{
						idR.Game.SortPushers = true;
					}
				}
			}

			EntityThinkFlags oldFlags = _thinkFlags;

			_thinkFlags |= flags;

			if(_thinkFlags != 0)
			{
				if(this.IsActive == false)
				{
					idR.Game.ActiveEntities.Add(this);
				}
				else if(oldFlags == 0)
				{
					// we became inactive this frame, so we have to decrease the count of entities to deactivate
					idR.Game.EntitiesToDeactivate--;
				}
			}
		}