Пример #1
0
        public override bool Draw(MyRenderObject renderObject)
        {
            bool drawDebug           = MyRender.IsModuleEnabled(MyRenderStage.DebugDraw, MyRenderModuleEnum.InfluenceSpheres);
            var  isEditorOrDebugDraw = MyGuiScreenGamePlay.Static.IsEditorActive() || drawDebug;

            if (isEditorOrDebugDraw && MyRender.GetCurrentLodDrawPass() == MyLodTypeEnum.LOD0 && !MyEntities.IsTypeHidden(typeof(MyInfluenceSphere)))
            {
                Matrix worldMatrix = WorldMatrix;

                var innerColor  = Color.White.ToVector4();
                var innerSphere = new BoundingSphere(worldMatrix.Translation, RadiusMin);
                MySimpleObjectDraw.DrawTransparentSphere(ref worldMatrix, innerSphere.Radius, ref innerColor, true, 12,
                                                         MyTransparentMaterialEnum.ObjectiveDummyFace,
                                                         MyTransparentMaterialEnum.ObjectiveDummyLine);

                var outerColor  = 0.5f * innerColor;
                var outerSphere = new BoundingSphere(worldMatrix.Translation, RadiusMax);
                MySimpleObjectDraw.DrawTransparentSphere(ref worldMatrix, outerSphere.Radius, ref outerColor, true, 12,
                                                         MyTransparentMaterialEnum.ObjectiveDummyFace,
                                                         MyTransparentMaterialEnum.ObjectiveDummyLine);
            }

            return(true);
        }