示例#1
0
        public void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera)
        {
            if (ParentMoved)
            {
                HasMoved = true;
            }
            ParentMoved = false;

            if (AnimationQueue.Count > 0)
            {
                HasMoved = true;
                MotionAnimation anim = AnimationQueue[0];
                anim.Update(gameTime);

                LocalTransform = anim.GetTransform();

                if (anim.IsDone())
                {
                    AnimationQueue.RemoveAt(0);
                }
            }

            if (firstIter || propogateTransforms || HasMoved)
            {
                PropogateTransforms();
                firstIter           = false;
                propogateTransforms = false;
            }
        }
示例#2
0
        public override void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera)
        {
            IsAboveCullPlane = GlobalTransform.Translation.Y - GetBoundingBox().Extents().Y > (chunks.ChunkData.MaxViewingLevel + 5);
            if (DrawScreenRect)
            {
                Drawer2D.DrawRect(GetScreenRect(camera), Color.Transparent, Color.White, 1);
            }

            if (DrawBoundingBox)
            {
                Drawer3D.DrawBox(BoundingBox, Color.White, 0.02f);
                Drawer3D.DrawBox(GetRotatedBoundingBox(), Color.Red, 0.02f);
            }

            if (DrawReservation && IsReserved)
            {
                Drawer3D.DrawBox(BoundingBox, Color.White, 0.02f);
            }

            if (AnimationQueue.Count > 0)
            {
                MotionAnimation anim = AnimationQueue[0];
                anim.Update(gameTime);

                LocalTransform = anim.GetTransform();

                if (anim.IsDone())
                {
                    AnimationQueue.RemoveAt(0);
                }
            }

            base.Update(gameTime, chunks, camera);
        }
示例#3
0
        public void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera)
        {
            //if (MathFunctions.HasNan(Position))
            //{
            //    Die();
            //}

            IsAboveCullPlane = GlobalTransform.Translation.Y - GetBoundingBox().Extents().Y > (chunks.ChunkData.MaxViewingLevel + 5);

            //if(DrawScreenRect) // Never true.
            //{
            //    Drawer2D.DrawRect(GetScreenRect(camera), Color.Transparent, Color.White, 1);
            //}

            //if(DrawBoundingBox) // Only used by TrapSensor
            //{
            //    Drawer3D.DrawBox(BoundingBox, Color.White, 0.02f);
            //    Drawer3D.DrawBox(GetRotatedBoundingBox(), Color.Red, 0.02f);
            //}

            //if (DrawReservation && IsReserved) // Never true.
            //{
            //    Drawer3D.DrawBox(BoundingBox, Color.White, 0.02f);
            //}

            if (AnimationQueue.Count > 0)
            {
                MotionAnimation anim = AnimationQueue[0];
                anim.Update(gameTime);

                LocalTransform = anim.GetTransform();

                if (anim.IsDone())
                {
                    AnimationQueue.RemoveAt(0);
                }
            }
        }