Esempio n. 1
0
 public void PrepareDebugRendering(PhysicsRenderer renderer)
 {
     foreach (Jitter.Dynamics.RigidBody body in m_World.RigidBodies)
     {
         renderer.Color = body.IsStaticOrInactive ? Color.Red : Color.Green;
         body.DebugDraw(renderer);
     }
 }
Esempio n. 2
0
        public override void Draw(GraphicsDevice device, Camera camera)
        {
            PhysicsRenderer physicsrenderer = PhysicsRenderer.GetInstance(device);

            physicsrenderer.Draw(body, camera);

            SpriteRenderer spriterenderer = SpriteRenderer.GetInstance(device);

            spriterenderer.Begin(null);
            Vector3 proj = camera.Project(new Vector3(target, 0));

            spriterenderer.AddString(Resources.arial10px_font, "x", proj.X, proj.Y);
            spriterenderer.End();
        }
Esempio n. 3
0
        public void Draw2dEntities(GraphicsDevice device, Camera camera)
        {
            if (!is_warm)
            {
                Warm(device);
            }

            Entity entity;

            for (int i = 0; i < entities.Count; i++)
            {
                entity = entities[i];

                if (entity is Bubble || entity is Billboard)
                {
                    entity.Draw(device, camera);
                }

                if (entity is Bubble || entity is Fish)
                {
                    float distance = (entity.position - player.position).Length();
                    if (distance < 10)
                    {
                        hint_logic.entity = entity;
                        hint_logic.Emit();
                    }
                }
            }


            if (!is_debug_visible)
            {
                return;
            }

            // no depth reading
            device.DepthStencilState = DepthStencilState.None;

            PhysicsRenderer physicsrenderer = PhysicsRenderer.GetInstance(device);

            physicsrenderer.Draw(physics, camera);

            // set depth reading to default
            device.DepthStencilState = DepthStencilState.Default;
        }