示例#1
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);
            });
        }
示例#2
0
 private void DrawWireframeModel(SurfaceModelMesh model, Vector4 color, float thickness)
 {
     RenderHelper.BeginDrawWireframe(VertexBuffer, model.Transform, thickness, color);
     DrawModelElements(model);
     RenderHelper.EndDrawWireframe(VertexBuffer);
 }