Exemplo n.º 1
0
 private void DrawSolidModel(SurfaceModelMesh model, MaterialInfo material)
 {
     RenderHelper.BeginDrawModel(VertexBuffer, model.Transform, material);
     RenderHelper.ModelShader.IsSelected.Set(model.IsSelected);
     DrawModelElements(model);
     RenderHelper.EndDrawModel(VertexBuffer);
 }
Exemplo n.º 2
0
        private void DrawBoxCollision()
        {
            var wireColor = IsSelected ? RenderHelper.WireframeColorAlt : RenderHelper.WireframeColor;

            RenderHelper.RenderWithStencil(IsSelected,
                                           () =>
            {
                RenderHelper.BeginDrawModel(ModelManager.CubeModel, ScaleTransform * Transform, RenderHelper.CollisionMaterial);
                RenderHelper.ModelShader.IsSelected.Set(IsSelected);

                ModelManager.CubeModel.DrawElements();

                RenderHelper.EndDrawModel(ModelManager.CubeModel);

                RenderHelper.DrawBoundingBox(Transform, BoundingBox, wireColor, 1.5f);
            },
                                           () =>
            {
                RenderHelper.DrawBoundingBox(Transform, BoundingBox, RenderHelper.SelectionOutlineColor, 4f);
            });
        }
Exemplo n.º 3
0
        private void DrawSphereCollision()
        {
            RenderHelper.RenderWithStencil(
                () =>
            {
                RenderHelper.BeginDrawModel(ModelManager.SphereModel, ScaleTransform * Transform, RenderHelper.CollisionMaterial);
                RenderHelper.ModelShader.IsSelected.Set(IsSelected);
                ModelManager.SphereModel.DrawElements();
                RenderHelper.EndDrawModel(ModelManager.SphereModel);
            },
                () =>
            {
                var wireColor = IsSelected ? RenderHelper.SelectionOutlineColor : RenderHelper.WireframeColor;

                RenderHelper.ApplyStencilMask();

                RenderHelper.BeginDrawWireframe(ModelManager.SphereModel.VertexBuffer, ScaleTransform * Transform,
                                                IsSelected ? 4f : 2.5f, wireColor);
                ModelManager.SphereModel.DrawElements();
                RenderHelper.EndDrawWireframe(ModelManager.SphereModel.VertexBuffer);
            });
        }