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; } }
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); }
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; } } } }
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; } }
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; } } } }
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); }