Пример #1
0
        private void PerformVoxelOperationCapsule_Implementation(MyCapsuleShapeParams capsuleParams, OperationType Type)
        {
            m_capsuleShape.Transformation = capsuleParams.Transformation;
            m_capsuleShape.A      = capsuleParams.A;
            m_capsuleShape.B      = capsuleParams.B;
            m_capsuleShape.Radius = capsuleParams.Radius;
            var amountChanged = UpdateVoxelShape(Type, m_capsuleShape, capsuleParams.Material);

            if (Type == OperationType.Cut || Type == OperationType.Fill)
            {
                MySession.Static.VoxelHandVolumeChanged += amountChanged;
            }
        }
Пример #2
0
        public void RequestVoxelOperationCapsule(Vector3D A, Vector3D B, float radius, MatrixD Transformation, byte material, OperationType Type)
        {
            BeforeContentChanged = true;
            MyCapsuleShapeParams shapeParams = new MyCapsuleShapeParams();

            shapeParams.A              = A;
            shapeParams.B              = B;
            shapeParams.Radius         = radius;
            shapeParams.Transformation = Transformation;
            shapeParams.Material       = material;

            MyMultiplayer.RaiseStaticEvent(s => VoxelOperationCapsule_Implementation, EntityId, shapeParams, Type);
        }
Пример #3
0
        private static void VoxelOperationCapsule_Implementation(long entityId, MyCapsuleShapeParams capsuleParams, OperationType Type)
        {
            m_capsuleShape.Transformation = capsuleParams.Transformation;
            m_capsuleShape.A      = capsuleParams.A;
            m_capsuleShape.B      = capsuleParams.B;
            m_capsuleShape.Radius = capsuleParams.Radius;

            if (CanPlaceInArea(Type, m_capsuleShape))
            {
                MyEntity entity;
                MyEntities.TryGetEntityById(entityId, out entity);
                MyVoxelBase voxel = entity as MyVoxelBase;
                if (voxel != null)
                {
                    voxel.BeforeContentChanged = true;
                    MyMultiplayer.RaiseEvent(voxel.RootVoxel, x => x.PerformVoxelOperationCapsule_Implementation, capsuleParams, Type);
                    var amountChanged = voxel.UpdateVoxelShape(Type, m_capsuleShape, capsuleParams.Material);
                    if (Type == OperationType.Cut || Type == OperationType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                }
            }
        }
Пример #4
0
 private void PerformVoxelOperationCapsule_Implementation(MyCapsuleShapeParams capsuleParams, OperationType Type)
 {
     m_capsuleShape.Transformation = capsuleParams.Transformation;
     m_capsuleShape.A = capsuleParams.A;
     m_capsuleShape.B = capsuleParams.B;
     m_capsuleShape.Radius = capsuleParams.Radius;
     var amountChanged = UpdateVoxelShape(Type, m_capsuleShape, capsuleParams.Material);
     if (Type == OperationType.Cut || Type == OperationType.Fill)
     {
         MySession.Static.VoxelHandVolumeChanged += amountChanged;
     }
 }
Пример #5
0
        private static void VoxelOperationCapsule_Implementation(long entityId, MyCapsuleShapeParams capsuleParams, OperationType Type)
        {
            m_capsuleShape.Transformation = capsuleParams.Transformation;
            m_capsuleShape.A = capsuleParams.A;
            m_capsuleShape.B = capsuleParams.B;
            m_capsuleShape.Radius = capsuleParams.Radius;

            if (CanPlaceInArea(Type, m_capsuleShape))
            {
                MyEntity entity;
                MyEntities.TryGetEntityById(entityId, out entity);
                MyVoxelBase voxel = entity as MyVoxelBase;
                if (voxel != null)
                {
                    voxel.BeforeContentChanged = true;
                    MyMultiplayer.RaiseEvent(voxel.RootVoxel, x => x.PerformVoxelOperationCapsule_Implementation, capsuleParams, Type);
                    var amountChanged = voxel.UpdateVoxelShape(Type, m_capsuleShape, capsuleParams.Material);
                    if (Type == OperationType.Cut || Type == OperationType.Fill)
                    {
                        MySession.Static.VoxelHandVolumeChanged += amountChanged;
                    }
                }
            }
        }
Пример #6
0
        public void RequestVoxelOperationCapsule(Vector3D A, Vector3D B, float radius, MatrixD Transformation, byte material, OperationType Type)
        {
            BeforeContentChanged = true;
            MyCapsuleShapeParams shapeParams = new MyCapsuleShapeParams();
            shapeParams.A = A;
            shapeParams.B = B;
            shapeParams.Radius = radius;
            shapeParams.Transformation = Transformation;
            shapeParams.Material = material;

            MyMultiplayer.RaiseStaticEvent(s => VoxelOperationCapsule_Implementation, EntityId, shapeParams, Type);
        }