Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

VRage.Game.ModAPI.Ingame.IMyCubeGrid

Morten Aune Lyrstad edited this page Sep 2, 2023 · 43 revisions

IndexNamespace Index

IMyCubeGrid Interface

public interface IMyCubeGrid: IMyEntity

Grid interface

Namespace: VRage.Game.ModAPI.Ingame
Assembly: VRage.Game.dll

Implements:

Properties

string CustomName { get; set; }

Getter and setter for display name of the grid (as seen in Info terminal tab)

float GridSize { get; }

Getter of grid size in meters

MyCubeSize GridSizeEnum { get; }

Getter for grid size enum

bool IsStatic { get; }

Determines if the grid is static (unmoveable)

Vector3 LinearVelocity { get; }

Gets linear velocity of the grid

Vector3I Max { get; }

Maximum coordinates of blocks in grid

Vector3I Min { get; }

Minimum coordinates of blocks in grid

float Speed { get; }

Gets speed of the grid calculated from Linear Velocity. Rounded to two decimal places.

bool Closed { get; }

True if the block has been removed from the world.

Inherited from IMyEntity

IMyEntityComponentContainer Components { get; }

Gets blocks component logic container

Inherited from IMyEntity

string DisplayName { get; }

Gets user friendly name of entity. May be null For block terminal name use DisplayNameText

Inherited from IMyEntity

long EntityId { get; }

Id of entity

Inherited from IMyEntity

bool HasInventory { get; }

Returns true if this entity has got at least one inventory. Note that one aggregate inventory can contain zero simple inventories => zero will be returned even if GetInventory() != null.

Inherited from IMyEntity

int InventoryCount { get; }

Returns the count of the number of inventories this entity has.

Inherited from IMyEntity

string Name { get; }

Some entities can have uniq name, and game can find them by name VRage.ModAPI.IMyEntities.TryGetEntityByName(System.String,VRage.ModAPI.IMyEntity@)

Inherited from IMyEntity

BoundingBoxD WorldAABB { get; }

Gets world axis-aligned bounding box

Inherited from IMyEntity

BoundingBoxD WorldAABBHr { get; }

Gets world axis-aligned bounding box

Inherited from IMyEntity

MatrixD WorldMatrix { get; }

Gets world matrix of this entity

Inherited from IMyEntity

BoundingSphereD WorldVolume { get; }

Gets bounding sphere of this entity

Inherited from IMyEntity

BoundingSphereD WorldVolumeHr { get; }

Gets bounding sphere of this entity

Inherited from IMyEntity

Methods

bool CubeExists(Vector3I pos)

Returns true if there is any block occupying given position

IMySlimBlock GetCubeBlock(Vector3I pos)

Get cube block at given position

Vector3D GridIntegerToWorld(Vector3I gridCoords)

Converts grid coordinates to world space

bool IsSameConstructAs(IMyCubeGrid other)

Determines whether this grid is VRage.Game.ModAPI.GridLinkTypeEnum.Mechanical connected to the other. This is any grid connected with rotors or pistons or other mechanical devices, but not things like connectors. This will in most cases constitute your complete construct.

Be aware that using merge blocks combines grids into one, so this function will not filter out grids connected that way. Also be aware that detaching the heads of pistons and rotors will cause this connection to change.

Vector3I WorldToGridInteger(Vector3D coords)

Converts world coordinates to grid space cell coordinates

IMyInventory GetInventory()

Simply get the MyInventoryBase component stored in this entity.

Inherited from IMyEntity

IMyInventory GetInventory(int index)

Search for inventory component with maching index.

Inherited from IMyEntity

Vector3D GetPosition()

Gets position in world coordinates

Inherited from IMyEntity

Clone this wiki locally