Class MyVoxelBase
Inheritance
System.Object
MyVoxelBase
Assembly: Sandbox.Game.dll
Syntax
public abstract class MyVoxelBase : MyEntity, IMyVoxelDrawable, IMyVoxelBase, IMyEntity, IMyEntity, IMyDecalProxy, IMyEventProxy, IMyEventOwner
Constructors
MyVoxelBase()
Declaration
Fields
BoulderInfo
Declaration
public Nullable<MyBoulderInformation> BoulderInfo
Field Value
CreateStorageCopyOnWrite
Declaration
public bool CreateStorageCopyOnWrite
Field Value
Type |
Description |
System.Boolean |
|
IsSeedOpen
Declaration
public Nullable<bool> IsSeedOpen
Field Value
Type |
Description |
System.Nullable<System.Boolean> |
|
m_storageMax
Declaration
protected Vector3I m_storageMax
Field Value
m_storageMin
Declaration
protected Vector3I m_storageMin
Field Value
m_tempStorage
Declaration
protected static MyStorageData m_tempStorage
Field Value
VoxelMapPruningProxyId
Declaration
public int VoxelMapPruningProxyId
Field Value
Type |
Description |
System.Int32 |
|
Properties
AsteroidName
Declaration
public string AsteroidName { get; set; }
Property Value
Type |
Description |
System.String |
|
BeforeContentChanged
Declaration
public bool BeforeContentChanged { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
ContentChanged
Declaration
public bool ContentChanged { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
CreatedByUser
Declaration
public bool CreatedByUser { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
DelayRigidBodyCreation
Declaration
public bool DelayRigidBodyCreation { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
IsGlobalEncounterAsteroid
Declaration
public bool IsGlobalEncounterAsteroid { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
m_storage
Declaration
protected IMyStorage m_storage { get; set; }
Property Value
Type |
Description |
VRage.Game.Voxels.IMyStorage |
|
Orientation
Declaration
public Matrix Orientation { get; }
Property Value
PositionLeftBottomCorner
Position of left/bottom corner of this voxel map, in world space (not relative to sector)
Declaration
public virtual Vector3D PositionLeftBottomCorner { get; set; }
Property Value
RootVoxel
Gets root voxel, for asteroids and planets itself.
For MyVoxelPhysics, should return owning planet.
Declaration
public abstract MyVoxelBase RootVoxel { get; }
Property Value
ScaleGroup
Declaration
public virtual MyClipmapScaleEnum ScaleGroup { get; }
Property Value
Size
Size of voxel map (in voxels)
Declaration
public Vector3I Size { get; }
Property Value
SizeInMetres
Size of voxel map (in metres)
Declaration
public Vector3 SizeInMetres { get; protected set; }
Property Value
SizeInMetresHalf
Declaration
public Vector3 SizeInMetresHalf { get; protected set; }
Property Value
SizeMinusOne
Declaration
public Vector3I SizeMinusOne { get; }
Property Value
Storage
Declaration
public virtual IMyStorage Storage { get; set; }
Property Value
Type |
Description |
VRage.Game.Voxels.IMyStorage |
|
StorageMax
Declaration
public Vector3I StorageMax { get; }
Property Value
StorageMin
Declaration
public Vector3I StorageMin { get; }
Property Value
StorageName
Declaration
public string StorageName { get; protected set; }
Property Value
Type |
Description |
System.String |
|
VoxelSize
Declaration
public float VoxelSize { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
add_RangeChanged(MyVoxelBase.StorageChanged)
Declaration
public void add_RangeChanged(MyVoxelBase.StorageChanged value)
Parameters
AreAllAabbCornersInside(ref MatrixD, BoundingBoxD)
Declaration
public bool AreAllAabbCornersInside(ref MatrixD aabbWorldTransform, BoundingBoxD aabb)
Parameters
Returns
Type |
Description |
System.Boolean |
|
BeforeDelete()
Declaration
protected override void BeforeDelete()
Overrides
BroadcastShipCutout(in MyShipMiningSystem.NetworkCutoutData)
Declaration
public void BroadcastShipCutout(in MyShipMiningSystem.NetworkCutoutData data)
Parameters
Type |
Name |
Description |
Sandbox.Game.GameSystems.MyShipMiningSystem.NetworkCutoutData |
data |
|
CountPointsInside(Vector3D*, Int32, Boolean)
Declaration
public int CountPointsInside(Vector3D*worldPoints, int pointCount, bool stopWhenFound = false)
Parameters
Type |
Name |
Description |
Vector3D* |
worldPoints |
|
System.Int32 |
pointCount |
|
System.Boolean |
stopWhenFound |
|
Returns
Type |
Description |
System.Int32 |
|
CreateVoxelMeteorCrater(Vector3D, Single, Vector3, MyVoxelMaterialDefinition)
Declaration
public void CreateVoxelMeteorCrater(Vector3D center, float radius, Vector3 direction, MyVoxelMaterialDefinition material)
Parameters
CutOutShapeWithProperties(MyShape, out Single, out MyVoxelMaterialDefinition, Dictionary<MyVoxelMaterialDefinition, Int32>, Boolean, Boolean, Boolean, Boolean)
Declaration
public void CutOutShapeWithProperties(MyShape shape, out float voxelsCountInPercent, out MyVoxelMaterialDefinition voxelMaterial, Dictionary<MyVoxelMaterialDefinition, int> exactCutOutMaterials = null, bool updateSync = false, bool onlyCheck = false, bool applyDamageMaterial = false, bool onlyApplyMaterial = false)
Parameters
Type |
Name |
Description |
Sandbox.Engine.Voxels.MyShape |
shape |
|
System.Single |
voxelsCountInPercent |
|
MyVoxelMaterialDefinition |
voxelMaterial |
|
System.Collections.Generic.Dictionary<MyVoxelMaterialDefinition, System.Int32> |
exactCutOutMaterials |
|
System.Boolean |
updateSync |
|
System.Boolean |
onlyCheck |
|
System.Boolean |
applyDamageMaterial |
|
System.Boolean |
onlyApplyMaterial |
|
CutOutShapeWithPropertiesAsync(MyVoxelBase.OnCutOutResults, MyShape, Boolean, Boolean, Boolean, Boolean, Boolean)
Declaration
public void CutOutShapeWithPropertiesAsync(MyVoxelBase.OnCutOutResults results, MyShape shape, bool updateSync = false, bool onlyCheck = false, bool applyDamageMaterial = false, bool onlyApplyMaterial = false, bool skipCache = true)
Parameters
Type |
Name |
Description |
MyVoxelBase.OnCutOutResults |
results |
|
Sandbox.Engine.Voxels.MyShape |
shape |
|
System.Boolean |
updateSync |
|
System.Boolean |
onlyCheck |
|
System.Boolean |
applyDamageMaterial |
|
System.Boolean |
onlyApplyMaterial |
|
System.Boolean |
skipCache |
|
DoOverlapSphereTest(Single, Vector3D)
Declaration
public override bool DoOverlapSphereTest(float sphereRadius, Vector3D spherePos)
Parameters
Type |
Name |
Description |
System.Single |
sphereRadius |
|
Vector3D |
spherePos |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
FindOutsidePosition(Vector3D, Single)
Find a storage local position that is outside of voxel content within a given radius.
Declaration
public virtual Vector3D FindOutsidePosition(Vector3D localPosition, float radius)
Parameters
Type |
Name |
Description |
Vector3D |
localPosition |
|
System.Single |
radius |
|
Returns
GetContainedVoxelCoords(ref BoundingBoxD, out Vector3I, out Vector3I)
Declaration
public bool GetContainedVoxelCoords(ref BoundingBoxD worldAabb, out Vector3I min, out Vector3I max)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetFilledStorageBounds(out Vector3I, out Vector3I)
Declaration
public void GetFilledStorageBounds(out Vector3I min, out Vector3I max)
Parameters
GetIntersectionWithLine(ref LineD, out Nullable<MyIntersectionResultLineTriangleEx>, IntersectionFlags)
Declaration
public override bool GetIntersectionWithLine(ref LineD worldLine, out Nullable<MyIntersectionResultLineTriangleEx> t, IntersectionFlags flags)
Parameters
Type |
Name |
Description |
LineD |
worldLine |
|
System.Nullable<VRage.Game.Models.MyIntersectionResultLineTriangleEx> |
t |
|
IntersectionFlags |
flags |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
GetIntersectionWithLine(ref LineD, out Nullable<Vector3D>, Boolean, IntersectionFlags)
Declaration
public override bool GetIntersectionWithLine(ref LineD worldLine, out Nullable<Vector3D> v, bool useCollisionModel = true, IntersectionFlags flags)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
GetMaterialAt(ref Vector3D)
Declaration
public MyVoxelMaterialDefinition GetMaterialAt(ref Vector3D worldPosition)
Parameters
Type |
Name |
Description |
Vector3D |
worldPosition |
|
Returns
GetMaterialsInShape(MyShape, Int32)
Declaration
public HashSet<byte> GetMaterialsInShape(MyShape shape, int lod = 0)
Parameters
Type |
Name |
Description |
Sandbox.Engine.Voxels.MyShape |
shape |
|
System.Int32 |
lod |
|
Returns
Type |
Description |
System.Collections.Generic.HashSet<System.Byte> |
|
GetObjectBuilder(Boolean)
Declaration
public override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false)
Parameters
Type |
Name |
Description |
System.Boolean |
copy |
|
Returns
Overrides
GetOrePriority()
Declaration
public virtual int GetOrePriority()
Returns
Type |
Description |
System.Int32 |
|
GetVoxelContentInBoundingBox_Fast(BoundingBoxD, MatrixD, Boolean, Single)
Calculates amount of volume of a bounding box in voxels.
Declaration
public MyTuple<float, float> GetVoxelContentInBoundingBox_Fast(BoundingBoxD localAabb, MatrixD worldMatrix, bool stopIfFindAtLeastOneContent = false, float threshold = 0.1F)
Parameters
Type |
Name |
Description |
BoundingBoxD |
localAabb |
Local bounding box to query for.
|
MatrixD |
worldMatrix |
World matrix of the bounding box.
|
System.Boolean |
stopIfFindAtLeastOneContent |
|
System.Single |
threshold |
Wipes out TOO small voxels
|
Returns
Type |
Description |
VRage.MyTuple<System.Single, System.Single> |
Pair of floats where 1st value is Volume amount and 2nd value is ratio of Volume amount to Whole volume.
|
GetVoxelRangeTypeInBoundingBox(BoundingBoxD)
Declaration
public MyVoxelContentConstitution GetVoxelRangeTypeInBoundingBox(BoundingBoxD worldAabb)
Parameters
Returns
Init(String, IMyStorage, MatrixD, Boolean)
Declaration
public virtual void Init(string storageName, IMyStorage storage, MatrixD worldMatrix, bool useVoxelOffset = true)
Parameters
Type |
Name |
Description |
System.String |
storageName |
|
VRage.Game.Voxels.IMyStorage |
storage |
|
MatrixD |
worldMatrix |
|
System.Boolean |
useVoxelOffset |
|
Init(String, IMyStorage, Vector3D)
Declaration
public void Init(string storageName, IMyStorage storage, Vector3D positionMinCorner)
Parameters
Type |
Name |
Description |
System.String |
storageName |
|
VRage.Game.Voxels.IMyStorage |
storage |
|
Vector3D |
positionMinCorner |
|
Init(MyObjectBuilder_EntityBase, IMyStorage)
Declaration
public abstract void Init(MyObjectBuilder_EntityBase builder, IMyStorage storage)
Parameters
InitVoxelMap(MatrixD, Vector3I, Boolean)
Declaration
protected virtual void InitVoxelMap(MatrixD worldMatrix, Vector3I size, bool useOffset = true)
Parameters
Type |
Name |
Description |
MatrixD |
worldMatrix |
|
Vector3I |
size |
|
System.Boolean |
useOffset |
|
IntersectStorage(ref BoundingBox, Boolean)
Declaration
public ContainmentType IntersectStorage(ref BoundingBox box, bool lazy = true)
Parameters
Type |
Name |
Description |
BoundingBox |
box |
|
System.Boolean |
lazy |
|
Returns
IsAnyAabbCornerInside(ref MatrixD, BoundingBoxD)
Declaration
public bool IsAnyAabbCornerInside(ref MatrixD aabbWorldTransform, BoundingBoxD aabb)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsAnyOfPointInside(Vector3D[])
Declaration
public bool IsAnyOfPointInside(Vector3D[] worldPoints)
Parameters
Type |
Name |
Description |
Vector3D[] |
worldPoints |
|
Returns
Type |
Description |
System.Boolean |
|
IsBoxIntersectingBoundingBoxOfThisVoxelMap(ref BoundingBoxD)
Declaration
public bool IsBoxIntersectingBoundingBoxOfThisVoxelMap(ref BoundingBoxD boundingBox)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsForbiddenEntity(MyEntity)
Declaration
public static bool IsForbiddenEntity(MyEntity entity)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsOverlapOverThreshold(BoundingBoxD, Single)
Declaration
public virtual bool IsOverlapOverThreshold(BoundingBoxD worldAabb, float thresholdPercentage = 0.9F)
Parameters
Type |
Name |
Description |
BoundingBoxD |
worldAabb |
|
System.Single |
thresholdPercentage |
|
Returns
Type |
Description |
System.Boolean |
|
OnRangeChanged(Vector3I, Vector3I, MyStorageDataTypeFlags)
Declaration
protected void OnRangeChanged(Vector3I voxelRangeMin, Vector3I voxelRangeMax, MyStorageDataTypeFlags changedData)
Parameters
OnReplicationEnded()
Declaration
public override void OnReplicationEnded()
Overrides
OnReplicationStarted()
Declaration
public override void OnReplicationStarted()
Overrides
OverlapsSphereLocal(Single, Vector3D)
Declaration
protected bool OverlapsSphereLocal(float sphereRadius, Vector3D spherePos)
Parameters
Type |
Name |
Description |
System.Single |
sphereRadius |
|
Vector3D |
spherePos |
|
Returns
Type |
Description |
System.Boolean |
|
Declaration
[Event(null, 1156)]
[Reliable]
[Broadcast]
public void PerformCutOutSphereFast(Vector3D center, float radius, bool notify)
Parameters
Type |
Name |
Description |
Vector3D |
center |
|
System.Single |
radius |
|
System.Boolean |
notify |
|
remove_RangeChanged(MyVoxelBase.StorageChanged)
Declaration
public void remove_RangeChanged(MyVoxelBase.StorageChanged value)
Parameters
RequestVoxelCutoutSphere(Vector3D, Single, Boolean, Boolean)
Declaration
public void RequestVoxelCutoutSphere(Vector3D center, float radius, bool createDebris, bool damage)
Parameters
Type |
Name |
Description |
Vector3D |
center |
|
System.Single |
radius |
|
System.Boolean |
createDebris |
|
System.Boolean |
damage |
|
RequestVoxelOperationBox(BoundingBoxD, MatrixD, Byte, MyVoxelBase.OperationType)
Declaration
public void RequestVoxelOperationBox(BoundingBoxD box, MatrixD Transformation, byte material, MyVoxelBase.OperationType Type)
Parameters
RequestVoxelOperationCapsule(Vector3D, Vector3D, Single, MatrixD, Byte, MyVoxelBase.OperationType)
Declaration
public void RequestVoxelOperationCapsule(Vector3D A, Vector3D B, float radius, MatrixD Transformation, byte material, MyVoxelBase.OperationType Type)
Parameters
RequestVoxelOperationElipsoid(Vector3, MatrixD, Byte, MyVoxelBase.OperationType)
Declaration
public void RequestVoxelOperationElipsoid(Vector3 radius, MatrixD Transformation, byte material, MyVoxelBase.OperationType Type)
Parameters
RequestVoxelOperationRamp(BoundingBoxD, Vector3D, Double, MatrixD, Byte, MyVoxelBase.OperationType)
Declaration
public void RequestVoxelOperationRamp(BoundingBoxD box, Vector3D rampNormal, double rampNormalW, MatrixD Transformation, byte material, MyVoxelBase.OperationType Type)
Parameters
RequestVoxelOperationSphere(Vector3D, Single, Byte, MyVoxelBase.OperationType)
Declaration
public void RequestVoxelOperationSphere(Vector3D center, float radius, byte material, MyVoxelBase.OperationType Type)
Parameters
RevertVoxelAccess(Vector3I, MyStorageDataTypeFlags)
Declaration
[Event(null, 1137)]
[Reliable]
[ServerInvoked]
[BroadcastExcept]
public void RevertVoxelAccess(Vector3I key, MyStorageDataTypeFlags flags)
Parameters
WorldPositionChanged(Object)
Declaration
protected void WorldPositionChanged(object source)
Parameters
Type |
Name |
Description |
System.Object |
source |
|
Events
RangeChanged
Declaration
public event MyVoxelBase.StorageChanged RangeChanged
Event Type
Explicit Interface Implementations
IMyDecalProxy.AddDecals(ref MyHitInfo, MyStringHash, Vector3, Object, IMyDecalHandler, MyStringHash, MyStringHash, Boolean, MyDecalFlags, Int32, List<UInt32>)
Declaration
void IMyDecalProxy.AddDecals(ref MyHitInfo hitInfo, MyStringHash source, Vector3 forwardDirection, object customdata, IMyDecalHandler decalHandler, MyStringHash physicalMaterial, MyStringHash voxelMaterial, bool isTrail, MyDecalFlags flags, int aliveUntil, List<uint> decals)
Parameters
IMyVoxelBase.Storage
Declaration
IMyStorage IMyVoxelBase.Storage { get; }
Returns
IMyVoxelBase.StorageName
Declaration
string IMyVoxelBase.StorageName { get; }
Returns
Type |
Description |
System.String |
|
Implements
Extension Methods