Space Engineers
Public Member Functions | Properties | Events | List of all members
VRage.Game.ModAPI.IMyCubeGrid Interface Reference
Inheritance diagram for VRage.Game.ModAPI.IMyCubeGrid:
VRage.ModAPI.IMyEntity VRage.Game.ModAPI.Ingame.IMyCubeGrid VRage.Game.ModAPI.Ingame.IMyEntity VRage.Game.ModAPI.Ingame.IMyEntity Sandbox.Game.Entities.MyCubeGrid

Public Member Functions

void ApplyDestructionDeformation (IMySlimBlock block)
 Applies random deformation to given block More...
 
void ChangeGridOwnership (long playerId, MyOwnershipShareModeEnum shareMode)
 Changes owner of all blocks on grid Call only on server! More...
 
void ClearSymmetries ()
 Clears symmetry planes More...
 
void ColorBlocks (VRageMath.Vector3I min, VRageMath.Vector3I max, VRageMath.Vector3 newHSV)
 Sets given color mask to range of blocks More...
 
void ConvertToDynamic ()
 Converts station to ship More...
 
bool CubeExists (VRageMath.Vector3I pos)
 Returns true if there is any block occupying given position More...
 
void FixTargetCube (out VRageMath.Vector3I cube, VRageMath.Vector3 fractionalGridPosition)
 Clamps fractional grid position to nearest cell (prefers neighboring occupied cell before empty) More...
 
VRageMath.Vector3 GetClosestCorner (VRageMath.Vector3I gridPos, VRageMath.Vector3 position)
 Gets position of closest cell corner More...
 
IMySlimBlock GetCubeBlock (VRageMath.Vector3I pos)
 Get cube block at given position More...
 
VRageMath.Vector3D GetLineIntersectionExactAll (ref VRageMath.LineD line, out double distance, out IMySlimBlock intersectedBlock)
 Returns point of intersection with line More...
 
bool GetLineIntersectionExactGrid (ref VRageMath.LineD line, ref VRageMath.Vector3I position, ref double distanceSquared)
 Same as GetLineIntersectionExactAll just without intersected block More...
 
VRageMath.Vector3D GridIntegerToWorld (VRageMath.Vector3I gridCoords)
 Converts grid coordinates to world space More...
 
bool IsTouchingAnyNeighbor (VRageMath.Vector3I min, VRageMath.Vector3I max)
 Finds out if given area has any neighboring block More...
 
bool IsTrash ()
 Algorithm used by game to define useless grids to be deleted More...
 
bool CanMergeCubes (IMyCubeGrid gridToMerge, VRageMath.Vector3I gridOffset)
 Determines if merge between grids is possible with given offset More...
 
VRageMath.MatrixI CalculateMergeTransform (IMyCubeGrid gridToMerge, VRageMath.Vector3I gridOffset)
 Transformation matrix that has to be applied to grid blocks to correctly merge it used because ie. ships can be turned 90 degrees along X axis when being merged More...
 
IMyCubeGrid MergeGrid_MergeBlock (IMyCubeGrid gridToMerge, VRageMath.Vector3I gridOffset)
 Merge used by merge blocks More...
 
VRageMath.Vector3I RayCastBlocks (VRageMath.Vector3D worldStart, VRageMath.Vector3D worldEnd)
 Returns cell with block intersecting given line More...
 
void RayCastCells (VRageMath.Vector3D worldStart, VRageMath.Vector3D worldEnd, List< VRageMath.Vector3I > outHitPositions, VRageMath.Vector3I?gridSizeInflate=null, bool havokWorld=false)
 Returns list of cells with blocks intersected by line More...
 
void RazeBlock (VRageMath.Vector3I position)
 Remove block at given position More...
 
void RazeBlocks (ref VRageMath.Vector3I pos, ref VRageMath.Vector3UByte size)
 Remove blocks in given area More...
 
void RazeBlocks (List< VRageMath.Vector3I > locations)
 Remove blocks at given positions More...
 
void RemoveBlock (IMySlimBlock block, bool updatePhysics=false)
 Removes given block More...
 
void RemoveDestroyedBlock (IMySlimBlock block)
 Removes block and deformates neighboring blocks More...
 
void UpdateBlockNeighbours (IMySlimBlock block)
 Refreshes block neighbors (checks connections) More...
 
VRageMath.Vector3I WorldToGridInteger (VRageMath.Vector3 coords)
 Converts world coordinates to grid space cell coordinates More...
 
void GetBlocks (List< IMySlimBlock > blocks, Func< IMySlimBlock, bool > collect=null)
 Returns blocks in grid More...
 
List< IMySlimBlockGetBlocksInsideSphere (ref VRageMath.BoundingSphereD sphere)
 Returns blocks inside given sphere (world space) More...
 
void UpdateOwnership (long ownerId, bool isFunctional)
 
VRageMath.Vector3I WorldToGridInteger (VRageMath.Vector3D coords)
 Converts world coordinates to grid space cell coordinates More...
 
IMySlimBlock AddBlock (MyObjectBuilder_CubeBlock objectBuilder, bool testMerge)
 Add a cubeblock to the grid More...
 
bool WillRemoveBlockSplitGrid (IMySlimBlock testBlock)
 Checks if removing a block will cause the grid to split More...
 
- Public Member Functions inherited from VRage.ModAPI.IMyEntity
string GetFriendlyName ()
 
void Close ()
 
void Delete ()
 
MyObjectBuilder_EntityBase GetObjectBuilder (bool copy=false)
 
void BeforeSave ()
 
IMyEntity GetTopMostParent (Type type=null)
 
void SetLocalMatrix (VRageMath.Matrix localMatrix, object source=null)
 
void GetChildren (List< IMyEntity > children, Func< IMyEntity, bool > collect=null)
 
MyEntitySubpart GetSubpart (string name)
 
bool TryGetSubpart (string name, out MyEntitySubpart subpart)
 
VRageMath.Vector3 GetDiffuseColor ()
 
bool IsVisible ()
 
void DebugDraw ()
 
void DebugDrawInvalidTriangles ()
 
void EnableColorMaskForSubparts (bool enable)
 
void SetColorMaskForSubparts (VRageMath.Vector3 colorMaskHsv)
 
void SetEmissiveParts (string emissiveName, Color emissivePartColor, float emissivity)
 Sets the emissive value of a specific emissive material on entity. More...
 
void SetEmissivePartsForSubparts (string emissiveName, Color emissivePartColor, float emissivity)
 Sets the emissive value of a specific emissive material on all entity subparts. More...
 
float GetDistanceBetweenCameraAndBoundingSphere ()
 
float GetDistanceBetweenCameraAndPosition ()
 
float GetLargestDistanceBetweenCameraAndBoundingSphere ()
 
float GetSmallestDistanceBetweenCameraAndBoundingSphere ()
 
void OnRemovedFromScene (object source)
 
void OnAddedToScene (object source)
 
MatrixD GetViewMatrix ()
 
MatrixD GetWorldMatrixNormalizedInv ()
 
void SetWorldMatrix (VRageMath.MatrixD worldMatrix, object source=null)
 
void SetPosition (VRageMath.Vector3D pos)
 
bool GetIntersectionWithLine (ref LineD line, out VRage.Game.Models.MyIntersectionResultLineTriangleEx?tri, IntersectionFlags flags)
 
Vector3 GetIntersectionWithLineAndBoundingSphere (ref LineD line, float boundingSphereRadiusMultiplier)
 
bool GetIntersectionWithSphere (ref BoundingSphereD sphere)
 
void GetTrianglesIntersectingSphere (ref BoundingSphereD sphere, Vector3?referenceNormalVector, float?maxAngle, System.Collections.Generic.List< MyTriangle_Vertex_Normals > retTriangles, int maxNeighbourTriangles)
 
bool DoOverlapSphereTest (float sphereRadius, Vector3D spherePos)
 
void AddToGamePruningStructure ()
 
void RemoveFromGamePruningStructure ()
 
void UpdateGamePruningStructure ()
 
- Public Member Functions inherited from VRage.Game.ModAPI.Ingame.IMyEntity
VRageMath.Vector3D GetPosition ()
 

Properties

List< long > BigOwners [get]
 List of players with majority of blocks on grid More...
 
List< long > SmallOwners [get]
 List of players with any blocks on grid More...
 
float GridSize [get]
 Grid size in meters More...
 
MyCubeSize GridSizeEnum [get, set]
 Grid size enumeration More...
 
bool IsStatic [get]
 Station = static More...
 
VRageMath.Vector3I Max [get]
 Maximum coordinates of blocks in grid More...
 
VRageMath.Vector3I Min [get]
 Minimum coordinates of blocks in grid More...
 
- Properties inherited from VRage.ModAPI.IMyEntity
MyEntityComponentContainer Components [get]
 
MyPhysicsComponentBase Physics [get, set]
 
MyPositionComponentBase PositionComp [get, set]
 
MyRenderComponentBase Render [get, set]
 
MyEntityComponentBase GameLogic [get, set]
 
MyHierarchyComponentBase Hierarchy [get, set]
 
MySyncComponentBase SyncObject [get]
 
MyModStorageComponentBase Storage [get, set]
 Custom storage for mods. Shared with all mods. More...
 
EntityFlags Flags [get, set]
 
long EntityId [get, set]
 
string Name [get, set]
 
bool MarkedForClose [get]
 
bool Closed [get]
 
bool DebugAsyncLoading [get]
 
bool Save [get, set]
 
MyPersistentEntityFlags2 PersistentFlags [get, set]
 
MyEntityUpdateEnum NeedsUpdate [get, set]
 
IMyEntity Parent [get]
 
Matrix LocalMatrix [get, set]
 
bool NearFlag [get, set]
 
bool CastShadows [get, set]
 
bool FastCastShadowResolve [get, set]
 
bool NeedsResolveCastShadow [get, set]
 
float MaxGlassDistSq [get]
 
bool NeedsDraw [get, set]
 
bool NeedsDrawFromParent [get, set]
 
bool Transparent [get, set]
 
bool ShadowBoxLod [get, set]
 
bool SkipIfTooSmall [get, set]
 
bool Visible [get, set]
 
bool InScene [get, set]
 
bool InvalidateOnMove [get]
 
new VRageMath.MatrixD WorldMatrix [get, set]
 
VRageMath.MatrixD WorldMatrixInvScaled [get]
 
VRageMath.MatrixD WorldMatrixNormalizedInv [get]
 
bool IsVolumetric [get]
 
BoundingBox LocalAABB [get, set]
 
BoundingBox LocalAABBHr [get]
 
BoundingSphere LocalVolume [get, set]
 
Vector3 LocalVolumeOffset [get, set]
 
Vector3 LocationForHudMarker [get]
 
bool IsCCDForProjectiles [get]
 
string DisplayName [get, set]
 
- Properties inherited from VRage.Game.ModAPI.Ingame.IMyEntity
MyEntityComponentContainer Components [get]
 
long EntityId [get]
 
VRageMath.BoundingBoxD WorldAABB [get]
 
VRageMath.BoundingBoxD WorldAABBHr [get]
 
VRageMath.MatrixD WorldMatrix [get]
 
VRageMath.BoundingSphereD WorldVolume [get]
 
VRageMath.BoundingSphereD WorldVolumeHr [get]
 
- Properties inherited from VRage.Game.ModAPI.Ingame.IMyCubeGrid
float GridSize [get]
 Grid size in meters More...
 
MyCubeSize GridSizeEnum [get]
 Grid size enum More...
 
bool IsStatic [get]
 Station = static More...
 
VRageMath.Vector3I Max [get]
 Maximum coordinates of blocks in grid More...
 
VRageMath.Vector3I Min [get]
 Minimum coordinates of blocks in grid More...
 

Events

Action< IMySlimBlockOnBlockAdded
 
Action< IMySlimBlockOnBlockRemoved
 
Action< IMyCubeGridOnBlockOwnershipChanged
 
Action< IMyCubeGridOnGridChanged
 
- Events inherited from VRage.ModAPI.IMyEntity
Action< IMyEntityOnClose
 
Action< IMyEntityOnClosing
 
Action< IMyEntityOnMarkForClose
 
Action< IMyEntityOnPhysicsChanged
 

Detailed Description

Definition at line 9 of file IMyCubeGrid.cs.

Member Function Documentation

IMySlimBlock VRage.Game.ModAPI.IMyCubeGrid.AddBlock ( MyObjectBuilder_CubeBlock  objectBuilder,
bool  testMerge 
)

Add a cubeblock to the grid

Parameters
objectBuilderObject builder of cube to add
testMergetest for grid merging
Returns
void VRage.Game.ModAPI.IMyCubeGrid.ApplyDestructionDeformation ( IMySlimBlock  block)

Applies random deformation to given block

Parameters
blockblock to be deformed
VRageMath.MatrixI VRage.Game.ModAPI.IMyCubeGrid.CalculateMergeTransform ( IMyCubeGrid  gridToMerge,
VRageMath.Vector3I  gridOffset 
)

Transformation matrix that has to be applied to grid blocks to correctly merge it used because ie. ships can be turned 90 degrees along X axis when being merged

Parameters
gridToMerge
gridOffset
Returns
bool VRage.Game.ModAPI.IMyCubeGrid.CanMergeCubes ( IMyCubeGrid  gridToMerge,
VRageMath.Vector3I  gridOffset 
)

Determines if merge between grids is possible with given offset

Parameters
gridToMerge
gridOffsetoffset to merged grid (in grid space)
Returns
void VRage.Game.ModAPI.IMyCubeGrid.ChangeGridOwnership ( long  playerId,
MyOwnershipShareModeEnum  shareMode 
)

Changes owner of all blocks on grid Call only on server!

Parameters
playerIdnew owner id
shareModenew share mode

Implemented in Sandbox.Game.Entities.MyCubeGrid.

void VRage.Game.ModAPI.IMyCubeGrid.ClearSymmetries ( )

Clears symmetry planes

Implemented in Sandbox.Game.Entities.MyCubeGrid.

void VRage.Game.ModAPI.IMyCubeGrid.ColorBlocks ( VRageMath.Vector3I  min,
VRageMath.Vector3I  max,
VRageMath.Vector3  newHSV 
)

Sets given color mask to range of blocks

Parameters
minStarting coordinates of collored area
maxEnd coordinates of collored area
newHSVnew color mask (Saturation and Value are offsets)
void VRage.Game.ModAPI.IMyCubeGrid.ConvertToDynamic ( )

Converts station to ship

Implemented in Sandbox.Game.Entities.MyCubeGrid.

bool VRage.Game.ModAPI.IMyCubeGrid.CubeExists ( VRageMath.Vector3I  pos)

Returns true if there is any block occupying given position

Implements VRage.Game.ModAPI.Ingame.IMyCubeGrid.

Implemented in Sandbox.Game.Entities.MyCubeGrid.

void VRage.Game.ModAPI.IMyCubeGrid.FixTargetCube ( out VRageMath.Vector3I  cube,
VRageMath.Vector3  fractionalGridPosition 
)

Clamps fractional grid position to nearest cell (prefers neighboring occupied cell before empty)

Parameters
cubeReturn value
fractionalGridPositionFractional position in grid space
void VRage.Game.ModAPI.IMyCubeGrid.GetBlocks ( List< IMySlimBlock blocks,
Func< IMySlimBlock, bool >  collect = null 
)

Returns blocks in grid

Parameters
blocksList of returned blocks
collectFilter - function called on each block telling if it should be added to result
List<IMySlimBlock> VRage.Game.ModAPI.IMyCubeGrid.GetBlocksInsideSphere ( ref VRageMath.BoundingSphereD  sphere)

Returns blocks inside given sphere (world space)

VRageMath.Vector3 VRage.Game.ModAPI.IMyCubeGrid.GetClosestCorner ( VRageMath.Vector3I  gridPos,
VRageMath.Vector3  position 
)

Gets position of closest cell corner

Parameters
gridPosCell coordinates
positionPosition to find nearest corner to. Grid space
Returns
Fractional position of corner in grid space
IMySlimBlock VRage.Game.ModAPI.IMyCubeGrid.GetCubeBlock ( VRageMath.Vector3I  pos)

Get cube block at given position

Parameters
posBlock position
Returns
Block or null if none is present at given position

Implements VRage.Game.ModAPI.Ingame.IMyCubeGrid.

Implemented in Sandbox.Game.Entities.MyCubeGrid.

VRageMath.Vector3D VRage.Game.ModAPI.IMyCubeGrid.GetLineIntersectionExactAll ( ref VRageMath.LineD  line,
out double  distance,
out IMySlimBlock  intersectedBlock 
)

Returns point of intersection with line

Parameters
lineIntersecting line
distanceDistance of intersection
intersectedBlock
Returns
Point of intersection
bool VRage.Game.ModAPI.IMyCubeGrid.GetLineIntersectionExactGrid ( ref VRageMath.LineD  line,
ref VRageMath.Vector3I  position,
ref double  distanceSquared 
)

Same as GetLineIntersectionExactAll just without intersected block

Implemented in Sandbox.Game.Entities.MyCubeGrid.

VRageMath.Vector3D VRage.Game.ModAPI.IMyCubeGrid.GridIntegerToWorld ( VRageMath.Vector3I  gridCoords)

Converts grid coordinates to world space

Implements VRage.Game.ModAPI.Ingame.IMyCubeGrid.

Implemented in Sandbox.Game.Entities.MyCubeGrid.

bool VRage.Game.ModAPI.IMyCubeGrid.IsTouchingAnyNeighbor ( VRageMath.Vector3I  min,
VRageMath.Vector3I  max 
)

Finds out if given area has any neighboring block

Parameters
min
max
Returns

Implemented in Sandbox.Game.Entities.MyCubeGrid.

bool VRage.Game.ModAPI.IMyCubeGrid.IsTrash ( )

Algorithm used by game to define useless grids to be deleted

Implemented in Sandbox.Game.Entities.MyCubeGrid.

IMyCubeGrid VRage.Game.ModAPI.IMyCubeGrid.MergeGrid_MergeBlock ( IMyCubeGrid  gridToMerge,
VRageMath.Vector3I  gridOffset 
)

Merge used by merge blocks

Parameters
gridToMerge
gridOffset
Returns
VRageMath.Vector3I VRage.Game.ModAPI.IMyCubeGrid.RayCastBlocks ( VRageMath.Vector3D  worldStart,
VRageMath.Vector3D  worldEnd 
)

Returns cell with block intersecting given line

Parameters
worldStart
worldEnd
Returns
void VRage.Game.ModAPI.IMyCubeGrid.RayCastCells ( VRageMath.Vector3D  worldStart,
VRageMath.Vector3D  worldEnd,
List< VRageMath.Vector3I outHitPositions,
VRageMath.Vector3I gridSizeInflate = null,
bool  havokWorld = false 
)

Returns list of cells with blocks intersected by line

Parameters
worldStart
worldEnd
outHitPositions
gridSizeInflate
havokWorlduse physics intersection
void VRage.Game.ModAPI.IMyCubeGrid.RazeBlock ( VRageMath.Vector3I  position)

Remove block at given position

Implemented in Sandbox.Game.Entities.MyCubeGrid.

void VRage.Game.ModAPI.IMyCubeGrid.RazeBlocks ( ref VRageMath.Vector3I  pos,
ref VRageMath.Vector3UByte  size 
)

Remove blocks in given area

Parameters
posStarting position
sizeArea extents

Implemented in Sandbox.Game.Entities.MyCubeGrid.

void VRage.Game.ModAPI.IMyCubeGrid.RazeBlocks ( List< VRageMath.Vector3I locations)

Remove blocks at given positions

Implemented in Sandbox.Game.Entities.MyCubeGrid.

void VRage.Game.ModAPI.IMyCubeGrid.RemoveBlock ( IMySlimBlock  block,
bool  updatePhysics = false 
)

Removes given block

Parameters
block
updatePhysicsUpdate grid physics
void VRage.Game.ModAPI.IMyCubeGrid.RemoveDestroyedBlock ( IMySlimBlock  block)

Removes block and deformates neighboring blocks

Parameters
block
void VRage.Game.ModAPI.IMyCubeGrid.UpdateBlockNeighbours ( IMySlimBlock  block)

Refreshes block neighbors (checks connections)

Parameters
block
void VRage.Game.ModAPI.IMyCubeGrid.UpdateOwnership ( long  ownerId,
bool  isFunctional 
)
bool VRage.Game.ModAPI.IMyCubeGrid.WillRemoveBlockSplitGrid ( IMySlimBlock  testBlock)

Checks if removing a block will cause the grid to split

Parameters
testBlock
Returns
VRageMath.Vector3I VRage.Game.ModAPI.IMyCubeGrid.WorldToGridInteger ( VRageMath.Vector3  coords)

Converts world coordinates to grid space cell coordinates

Parameters
coords
Returns
VRageMath.Vector3I VRage.Game.ModAPI.IMyCubeGrid.WorldToGridInteger ( VRageMath.Vector3D  coords)

Converts world coordinates to grid space cell coordinates

Implements VRage.Game.ModAPI.Ingame.IMyCubeGrid.

Property Documentation

List<long> VRage.Game.ModAPI.IMyCubeGrid.BigOwners
get

List of players with majority of blocks on grid

Definition at line 20 of file IMyCubeGrid.cs.

float VRage.Game.ModAPI.IMyCubeGrid.GridSize
get

Grid size in meters

Definition at line 103 of file IMyCubeGrid.cs.

MyCubeSize VRage.Game.ModAPI.IMyCubeGrid.GridSizeEnum
getset

Grid size enumeration

Definition at line 108 of file IMyCubeGrid.cs.

bool VRage.Game.ModAPI.IMyCubeGrid.IsStatic
get

Station = static

Definition at line 113 of file IMyCubeGrid.cs.

VRageMath.Vector3I VRage.Game.ModAPI.IMyCubeGrid.Max
get

Maximum coordinates of blocks in grid

Definition at line 131 of file IMyCubeGrid.cs.

VRageMath.Vector3I VRage.Game.ModAPI.IMyCubeGrid.Min
get

Minimum coordinates of blocks in grid

Definition at line 162 of file IMyCubeGrid.cs.

List<long> VRage.Game.ModAPI.IMyCubeGrid.SmallOwners
get

List of players with any blocks on grid

Definition at line 24 of file IMyCubeGrid.cs.

Event Documentation

Action<IMySlimBlock> VRage.Game.ModAPI.IMyCubeGrid.OnBlockAdded

Definition at line 241 of file IMyCubeGrid.cs.

Action<IMyCubeGrid> VRage.Game.ModAPI.IMyCubeGrid.OnBlockOwnershipChanged

Definition at line 243 of file IMyCubeGrid.cs.

Action<IMySlimBlock> VRage.Game.ModAPI.IMyCubeGrid.OnBlockRemoved

Definition at line 242 of file IMyCubeGrid.cs.

Action<IMyCubeGrid> VRage.Game.ModAPI.IMyCubeGrid.OnGridChanged

Definition at line 244 of file IMyCubeGrid.cs.


The documentation for this interface was generated from the following file: