Show / Hide Table of Contents

Interface IMyVoxelMaps

Namespace: VRage.Game.ModAPI
Assembly: VRage.Game.dll
Syntax
public interface IMyVoxelMaps

Properties

VoxelMaterialCount

Declaration
int VoxelMaterialCount { get; }
Property Value
Type Description
System.Int32

Methods

Clear()

Resets all voxels over whole world

Declaration
void Clear()

CreatePredefinedVoxelMap(String, String, MatrixD, Boolean)

Creates an voxel map with some additional options.

Declaration
IMyVoxelMap CreatePredefinedVoxelMap(string storageName, string voxelMaterial, MatrixD matrix, bool useVoxelOffset)
Parameters
Type Name Description
System.String storageName

SubtypeId of a VoxelMap Definition

System.String voxelMaterial

If provided with a Voxel Material SubtypeId, the entire voxel map will be converted to that material. Otherwise, if this value is Empty or Null, the default materials for the voxel map will be used.

MatrixD matrix

World Matrix used for positioning voxel map

System.Boolean useVoxelOffset

If set to true, the voxel will be placed using the center of the voxel bounding box, instead of using PositionLeftBottomCorner

Returns
Type Description
IMyVoxelMap

A voxel map (eg: asteroid) as IMyVoxelMap

CreateProceduralVoxelMap(Int32, Single, MatrixD)

Declaration
IMyVoxelMap CreateProceduralVoxelMap(int seed, float radius, MatrixD matrix)
Parameters
Type Name Description
System.Int32 seed
System.Single radius
MatrixD matrix
Returns
Type Description
IMyVoxelMap

CreateStorage(Byte[])

Creates storage from GZipped bytes.

Declaration
IMyStorage CreateStorage(byte[] data)
Parameters
Type Name Description
System.Byte[] data

Voxels data

Returns
Type Description
IMyStorage

Created storage

CreateStorage(Vector3I)

Creates voxels storage

Declaration
IMyStorage CreateStorage(Vector3I size)
Parameters
Type Name Description
Vector3I size

Size of storage in voxel coordinates

Returns
Type Description
IMyStorage

Created storage

CreateVoxelMap(String, IMyStorage, Vector3D, Int64)

Creates voxels map

Declaration
IMyVoxelMap CreateVoxelMap(string storageName, IMyStorage storage, Vector3D position, long voxelMapId)
Parameters
Type Name Description
System.String storageName

Name of storage

IMyStorage storage

Voxels storage

Vector3D position

World coordinates

System.Int64 voxelMapId

Id of voxel map

Returns
Type Description
IMyVoxelMap

Voxels map

CreateVoxelMapFromStorageName(String, String, Vector3D)

Adds a prefab voxel to the game world.

Declaration
IMyVoxelMap CreateVoxelMapFromStorageName(string storageName, string prefabVoxelMapName, Vector3D position)
Parameters
Type Name Description
System.String storageName

The name of which the voxel storage will be called within the world.

System.String prefabVoxelMapName

The prefab voxel to add.

Vector3D position

The Min corner position of the voxel within the world.

Returns
Type Description
IMyVoxelMap

The newly added voxel map. Returns null if the prefabVoxelMapName does not exist.

CutOutShape(IMyVoxelBase, IMyVoxelShape)

Will cut out given shape

Declaration
void CutOutShape(IMyVoxelBase voxelMap, IMyVoxelShape voxelShape)
Parameters
Type Name Description
IMyVoxelBase voxelMap
IMyVoxelShape voxelShape

Exist(IMyVoxelBase)

Returns if voxel registered

Declaration
bool Exist(IMyVoxelBase voxelMap)
Parameters
Type Name Description
IMyVoxelBase voxelMap

Voxel map

Returns
Type Description
System.Boolean

True if registered

FillInShape(IMyVoxelBase, IMyVoxelShape, Byte)

Will fill given material with given shape

Declaration
void FillInShape(IMyVoxelBase voxelMap, IMyVoxelShape voxelShape, byte materialIdx)
Parameters
Type Name Description
IMyVoxelBase voxelMap
IMyVoxelShape voxelShape
System.Byte materialIdx

GetBoxVoxelHand()

Gets box voxel hand. Can be used in PaintInShape(IMyVoxelBase, IMyVoxelShape, Byte), CutOutShape(IMyVoxelBase, IMyVoxelShape), FillInShape(IMyVoxelBase, IMyVoxelShape, Byte), RevertShape(IMyVoxelBase, IMyVoxelShape)

Declaration
IMyVoxelShapeBox GetBoxVoxelHand()
Returns
Type Description
IMyVoxelShapeBox

Box voxel hand

GetCapsuleVoxelHand()

Gets capsule voxel hand. Can be used in PaintInShape(IMyVoxelBase, IMyVoxelShape, Byte), CutOutShape(IMyVoxelBase, IMyVoxelShape), FillInShape(IMyVoxelBase, IMyVoxelShape, Byte), RevertShape(IMyVoxelBase, IMyVoxelShape)

Declaration
IMyVoxelShapeCapsule GetCapsuleVoxelHand()
Returns
Type Description
IMyVoxelShapeCapsule

Capsule voxel hand

GetInstances(List<IMyVoxelBase>, Func<IMyVoxelBase, Boolean>)

Gets all instances of IMyVoxelBase

Declaration
void GetInstances(List<IMyVoxelBase> outInstances, Func<IMyVoxelBase, bool> collect = null)
Parameters
Type Name Description
System.Collections.Generic.List<IMyVoxelBase> outInstances

List, that would receive results

System.Func<IMyVoxelBase, System.Boolean> collect

When function is null or returns true, item would be added to list

GetOverlappingWithSphere(ref BoundingSphereD)

Get first found IMyVoxelBase that intersects with sphere

Declaration
IMyVoxelBase GetOverlappingWithSphere(ref BoundingSphereD sphere)
Parameters
Type Name Description
BoundingSphereD sphere

Sphere to intersect

Returns
Type Description
IMyVoxelBase

Null or first found IMyVoxelBase

GetRampVoxelHand()

Gets ramp voxel hand. Can be used in PaintInShape(IMyVoxelBase, IMyVoxelShape, Byte), CutOutShape(IMyVoxelBase, IMyVoxelShape), FillInShape(IMyVoxelBase, IMyVoxelShape, Byte), RevertShape(IMyVoxelBase, IMyVoxelShape)

Declaration
IMyVoxelShapeRamp GetRampVoxelHand()
Returns
Type Description
IMyVoxelShapeRamp

Ramp voxel hand

GetSphereVoxelHand()

Gets sphere voxel hand. Can be used in PaintInShape(IMyVoxelBase, IMyVoxelShape, Byte), CutOutShape(IMyVoxelBase, IMyVoxelShape), FillInShape(IMyVoxelBase, IMyVoxelShape, Byte), RevertShape(IMyVoxelBase, IMyVoxelShape)

Declaration
IMyVoxelShapeSphere GetSphereVoxelHand()
Returns
Type Description
IMyVoxelShapeSphere

Sphere voxel hand

GetVoxelMapWhoseBoundingBoxIntersectsBox(ref BoundingBoxD, IMyVoxelBase)

Get first found IMyVoxelBase that intersects with bounding box, ordered by distance to box center

Declaration
IMyVoxelBase GetVoxelMapWhoseBoundingBoxIntersectsBox(ref BoundingBoxD boundingBox, IMyVoxelBase ignoreVoxelMap)
Parameters
Type Name Description
BoundingBoxD boundingBox

Box to intersect

IMyVoxelBase ignoreVoxelMap

Can't be return value

Returns
Type Description
IMyVoxelBase

IMyVoxelBase

MakeCrater(IMyVoxelBase, BoundingSphereD, Vector3, Byte)

Declaration
void MakeCrater(IMyVoxelBase voxelMap, BoundingSphereD sphere, Vector3 direction, byte materialIdx)
Parameters
Type Name Description
IMyVoxelBase voxelMap
BoundingSphereD sphere
Vector3 direction
System.Byte materialIdx

PaintInShape(IMyVoxelBase, IMyVoxelShape, Byte)

Will paint given material with given shape

Declaration
void PaintInShape(IMyVoxelBase voxelMap, IMyVoxelShape voxelShape, byte materialIdx)
Parameters
Type Name Description
IMyVoxelBase voxelMap
IMyVoxelShape voxelShape
System.Byte materialIdx

RevertShape(IMyVoxelBase, IMyVoxelShape)

Declaration
void RevertShape(IMyVoxelBase voxelMap, IMyVoxelShape voxelShape)
Parameters
Type Name Description
IMyVoxelBase voxelMap
IMyVoxelShape voxelShape

SpawnPlanet(String, Single, Int32, Vector3D)

Creates a Planet Entity

Declaration
IMyVoxelBase SpawnPlanet(string planetName, float size, int seed, Vector3D position)
Parameters
Type Name Description
System.String planetName

SubtypeId of the Planet (eg: Earthlike, Moon, Mars, etc)

System.Single size

Diameter (in meters) of the planet

System.Int32 seed

Voxel generation seed (similar to the slider you would set in Shift+F10 menu)

Vector3D position

Position of where the planet is placed (placed using PositionLeftBottomCorner)

Returns
Type Description
IMyVoxelBase

Planet as IMyVoxelBase

☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾