コード例 #1
0
ファイル: idAnimator.cs プロジェクト: iainmckay/idtech4.net
		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);
				}
			}
		}
コード例 #2
0
ファイル: idAnimator.cs プロジェクト: PEMantis/idtech4.net
        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);
                }
            }
        }
コード例 #3
0
ファイル: idAnimator.cs プロジェクト: PEMantis/idtech4.net
        public bool GetBounds(int currentTime, out idBounds bounds)
        {
            bounds = idBounds.Zero;

            if ((_modelDef == null) || (_modelDef.Model == null))
            {
                return(false);
            }

            int count = 0;

            if (_afPoseJoints.Count > 0)
            {
                bounds = _afPoseBounds;
                count  = 1;
            }

            for (int i = (int)AnimationChannel.All; i < (int)AnimationChannel.Count; i++)
            {
                for (int j = 0; j < idR.AnimationCountPerChannel; j++)
                {
                    idAnimBlend blend = _channels[i, j];

                    if (blend.AddBounds(currentTime, ref bounds, _removeOriginOffset) == true)
                    {
                        count++;
                    }
                }
            }

            if (count == 0)
            {
                if (_frameBounds.IsCleared == false)
                {
                    bounds = _frameBounds;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            bounds.Translate(_modelDef.VisualOffset);

            if (idR.CvarSystem.GetBool("g_debugBounds") == true)
            {
                idConsole.Warning("TODO: g_debugBounds");

                /*if ( bounds[1][0] - bounds[0][0] > 2048 || bounds[1][1] - bounds[0][1] > 2048 ) {
                 *      if ( entity ) {
                 *              gameLocal.Warning( "big frameBounds on entity '%s' with model '%s': %f,%f", entity->name.c_str(), modelDef->ModelHandle()->Name(), bounds[1][0] - bounds[0][0], bounds[1][1] - bounds[0][1] );
                 *      } else {
                 *              gameLocal.Warning( "big frameBounds on model '%s': %f,%f", modelDef->ModelHandle()->Name(), bounds[1][0] - bounds[0][0], bounds[1][1] - bounds[0][1] );
                 *      }
                 * }*/
            }

            _frameBounds = bounds;

            return(true);
        }