private void DebugDrawMountPoints(MySlimBlock block)
        {
            if (block.FatBlock is MyCompoundCubeBlock)
            {
                MyCompoundCubeBlock compoundBlock = block.FatBlock as MyCompoundCubeBlock;
                foreach (MySlimBlock componentBlock in compoundBlock.GetBlocks())
                {
                    DebugDrawMountPoints(componentBlock);
                }
            }
            else
            {
                Matrix blockMatrix;
                block.GetLocalMatrix(out blockMatrix);
                MatrixD blockWorldMatrix = blockMatrix * m_cubeGrid.WorldMatrix;

                if (MyFakes.ENABLE_FRACTURE_COMPONENT && block.FatBlock != null && block.FatBlock.Components.Has <MyFractureComponentBase>())
                {
                    var fractureComponent = block.GetFractureComponent();
                    if (fractureComponent != null)
                    {
                        MyCubeBuilder.DrawMountPoints(m_cubeGrid.GridSize, block.BlockDefinition, blockWorldMatrix, fractureComponent.MountPoints.GetInternalArray());
                    }
                }
                else
                {
                    MyCubeBuilder.DrawMountPoints(m_cubeGrid.GridSize, block.BlockDefinition, ref blockWorldMatrix);
                }
            }
        }
Esempio n. 2
0
 private void DebugDrawMountPoints(MySlimBlock block)
 {
     if (block.FatBlock is MyCompoundCubeBlock)
     {
         foreach (MySlimBlock block2 in (block.FatBlock as MyCompoundCubeBlock).GetBlocks())
         {
             this.DebugDrawMountPoints(block2);
         }
     }
     else
     {
         Matrix matrix;
         block.GetLocalMatrix(out matrix);
         MatrixD drawMatrix = matrix * this.m_cubeGrid.WorldMatrix;
         if ((!MyFakes.ENABLE_FRACTURE_COMPONENT || (block.FatBlock == null)) || !block.FatBlock.Components.Has <MyFractureComponentBase>())
         {
             MyCubeBuilder.DrawMountPoints(this.m_cubeGrid.GridSize, block.BlockDefinition, ref drawMatrix);
         }
         else
         {
             MyFractureComponentCubeBlock fractureComponent = block.GetFractureComponent();
             if (fractureComponent != null)
             {
                 MyCubeBuilder.DrawMountPoints(this.m_cubeGrid.GridSize, block.BlockDefinition, drawMatrix, fractureComponent.MountPoints.GetInternalArray <MyCubeBlockDefinition.MountPoint>());
             }
         }
     }
 }
Esempio n. 3
0
        private static void RemoveFractureComponentChildShapes(MySlimBlock block, string[] shapeNames)
        {
            var component = block.GetFractureComponent();

            if (component != null)
            {
                component.RemoveChildShapes(shapeNames);
            }
            else
            {
                Debug.Fail("Cannot remove child shapes from fracture component, fracture component not found in block");
                MyLog.Default.WriteLine("Cannot remove child shapes from fracture component, fracture component not found in block, BlockDefinition: "
                                        + block.BlockDefinition.Id.ToString() + ", Shapes: " + string.Join(", ", shapeNames));
            }
        }