VRage.ModAPI
IMyEntity
Assembly: VRage.Game.dll
public interface IMyEntity: IMyEntity
Events
| Member | Description |
|---|---|
| OnClose | Called when Close() is called. Order 1) OnMarkForClose 2) OnClosing 3) OnClose . |
| OnClosing | Called when Close() is called. Order 1) OnMarkForClose 2) OnClosing 3) OnClose . |
| OnMarkForClose | Called when Close() is called. Order 1) OnMarkForClose 2) OnClosing 3) OnClose . |
| OnPhysicsChanged | Called when havok rigid body physics are changed: inited, closed, modified. |
Properties
| Member | Description |
|---|---|
| CastShadows | Gets or sets flag CastShadows |
| DebugAsyncLoading | Used for internal usage. Modders should not use it. Will be eventually removed |
| DisplayName | Gets or sets user friendly name of entity |
| EntityId | Uniq id of entity. |
| FastCastShadowResolve | Gets or sets flag CastShadows |
| Flags | Gets or set some behavior of entity. EntityFlags |
| GameLogic | Gets or sets game logic for object. If there is more than 1 game logic attached it should be wrapped into. |
| Hierarchy | Gets or sets Hierarchy component |
| InScene | Gets or set if grid is InScene. Objects that are not in scene are not updated and drawn. |
| InvalidateOnMove | Gets if entity is invalidated on move When visual look of entity depends on position - then InvalidateOnMove should be true |
| IsVolumetric | Always returns false |
| LocalAABB | Gets or sets local axis aligned bounding box. Same as LocalAABBHr , LocalAABB |
| LocalAABBHr | Gets local axis aligned bounding box. Same as LocalAABB , LocalAABB |
| LocalMatrix | Gets or sets local matrix. When entity, has parent, it's world coordinates are calculated from localMatrix and parent world matrix |
| LocalVolume | Gets or sets local volume. Same as LocalVolume |
| LocalVolumeOffset | Gets or sets local volume offset. Same as LocalVolumeOffset |
| MarkedForClose | Checked if Close() was called |
| MaxGlassDistSq | Not used in game anymore |
| Model | Gets model of block |
| ModelCollision | Gets collision model of block |
| Name | Uniq name of entity. Can be used to find entity by name |
| NearFlag | Gets or sets flag Near |
| NeedsDraw | Gets or sets flag NeedsDraw |
| NeedsDrawFromParent | Gets or sets flag NeedsDrawFromParent |
| NeedsResolveCastShadow | Gets or sets flag NeedsResolveCastShadow |
| NeedsUpdate | Gets or sets how often the entity should be updated. |
| NeedsWorldMatrix | Gets or sets if WorldMatrix should be calculated when parent WorldMatrix is changed. |
| Parent | Gets parent of entity or null, if this entity doesn't have parent. Ex: character sitting in cockpit, has parent - cockpit, cockpit has parent - cube grid, connected grids also has main grid, which would be parent for other grids. |
| PersistentFlags | Gets or sets persistent flags that are used in rendering. |
| Physics | Gets or sets physics for object |
| PositionComp | Gets or sets position provider logic |
| Render | Gets or sets render logic |
| Save | Gets or sets Save . Entity won't be saved if Save is false |
| ShadowBoxLod | Gets or sets flag ShadowBoxLod |
| SkipIfTooSmall | Gets or sets flag SkipIfTooSmall |
| StopPhysicsActivation | |
| Storage | Custom storage for mods. Shared with all mods. |
| Synchronized | Gets or sets if the entity should be synced. |
| SyncObject | Gets SyncObject used for synchronizing data over network with |
| Transparent | Gets or sets Transparency . When setting true entity would be 25% transparent |
| Visible | Gets or sets flag Visible |
| WorldMatrix | Gets or sets world matrix. |
| WorldMatrixInvScaled | Get scaled, inverted world matrix. Same as GetViewMatrix() , GetWorldMatrixNormalizedInv() , WorldMatrixNormalizedInv , but not normalized |
| WorldMatrixNormalizedInv | Get normalized, inverted world matrix. Same as GetViewMatrix() , WorldMatrixNormalizedInv |
| Closed | True if the block has been removed from the world. Inherited from IMyEntity |
| Components | Gets blocks component logic container Inherited from IMyEntity |
| DisplayName | Gets user friendly name of entity. May be null For block terminal name use DisplayNameText Inherited from IMyEntity |
| EntityId | Id of entity Inherited from IMyEntity |
| HasInventory | 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 |
| InventoryCount | Returns the count of the number of inventories this entity has. Inherited from IMyEntity |
| Name | Some entities can have uniq name, and game can find them by name TryGetEntityByName(string, out IMyEntity) Inherited from IMyEntity |
| WorldAABB | Gets world axis-aligned bounding box Inherited from IMyEntity |
| WorldAABBHr | Gets world axis-aligned bounding box Inherited from IMyEntity |
| WorldMatrix | Gets world matrix of this entity Inherited from IMyEntity |
| WorldVolume | Gets bounding sphere of this entity Inherited from IMyEntity |
| WorldVolumeHr | Gets bounding sphere of this entity Inherited from IMyEntity |
| IsCCDForProjectiles | Obsolete |
| LocationForHudMarker | Obsolete |
Methods
| Member | Description |
|---|---|
| BeforeSave() | Called before method GetObjectBuilder, when saving sector |
| Close() | This method marks this entity for close which means, that Close will be called after all entities are updated |
| DebugDraw() | Calls debug draw of entity |
| DebugDrawInvalidTriangles() | Calls special debug draw, that highlighting invalid triangles in model |
| Delete() | Performs real cleaning of entity. Should be called by game. Modders should prefer Close() method. |
| DoOverlapSphereTest(float, Vector3D) | Checks if intersects Works only with IMyVoxelBase |
| EnableColorMaskForSubparts(bool) | Allows subparts have different color than their parent |
| GetChildren(List |
Gets children of entity. Child - entity, who's Parent is this entity |
| GetDiffuseColor() | Gets render diffuse color |
| GetDistanceBetweenCameraAndBoundingSphere() | Distance from camera to bounding sphere of this phys object. Result is always positive, even if camera is inside the sphere. (in meters) |
| GetDistanceBetweenCameraAndPosition() | Distance from camera to position of entity. |
| GetFriendlyName() | Not used. Actually not a friendly name |
| GetIntersectionWithAABB(ref BoundingBoxD) | Return true if object intersects specified bounding box. |
| GetIntersectionWithLine(ref LineD, out MyIntersectionResultLineTriangleEx?, IntersectionFlags) | Get intersection of model with provided line |
| GetIntersectionWithLineAndBoundingSphere(ref LineD, float) | Calculates intersection of line with any bounding sphere in this model instance. Center of the bounding sphere will be returned. It takes boundingSphereRadiusMultiplier argument which serves for extending the influence (radius) for interaction with line. |
| GetIntersectionWithSphere(ref BoundingSphereD) | Return true if object intersects specified sphere. |
| GetInventory() | Simply get the MyInventoryBase component stored in this entity. |
| GetInventory(int) | Search for inventory component with matching index. |
| GetLargestDistanceBetweenCameraAndBoundingSphere() | Largest distance from camera to bounding sphere of this phys object. Result is always positive, even if camera is inside the sphere. It's actually distance between camera and opposite side of the sphere |
| GetObjectBuilder(bool) | Returns object builder - object representing block state, and allows restore it. Used in game save, or syncing over network. |
| GetSmallestDistanceBetweenCameraAndBoundingSphere() | Smallest distance between camera and bounding sphere of this phys object. Result is always positive, even if camera is inside the sphere. |
| GetSubpart(string) | Gets subpart by subpart name |
| GetTopMostParent(Type) | Gets top most Parent of specified type. Top most is entity that doesn't have parent (of specified type) |
| GetTrianglesIntersectingSphere(ref BoundingSphere, Vector3?, float?, List<MyTriangle_Vertex_Normals>, int) | Return list of triangles intersecting specified sphere. Angle between every triangleVertexes normal vector and 'referenceNormalVector' is calculated, and if more than 'maxAngle', we ignore such triangleVertexes. Triangles are returned in 'retTriangles', and this list must be preallocated! IMPORTANT: Sphere must be in model space, so don't transform it! |
| GetViewMatrix() | Get normalized, inverted world matrix. Same as GetWorldMatrixNormalizedInv() , WorldMatrixNormalizedInv |
| GetWorldMatrixNormalizedInv() | Get normalized, inverted world matrix. Same as GetViewMatrix() , WorldMatrixNormalizedInv |
| IsVisible() | Gets or result of function IsVisible() . Function inside check for IsVisible(IMyEntity) |
| OnAddedToScene(object) | Adds entity to scene: init updates, render physics |
| OnRemovedFromScene(object) | Remove entity and it's children from scene: stops updates and render, deactivates physics. Usually called when entity deleted |
| SetColorMaskForSubparts(Vector3) | Sets subparts custom col |
| SetEmissiveParts(string, Color, float) | Sets the emissive value of a specific emissive material on entity. |
| SetEmissivePartsForSubparts(string, Color, float) | Sets the emissive value of a specific emissive material on all entity subparts. |
| SetLocalMatrix(Matrix, object) | Sets local matrix. When entity, has parent, it's world coordinates are calculated from localMatrix and parent world matrix |
| SetPosition(Vector3D) | Set WorldMatrix's Translation . Moves entity. |
| SetTextureChangesForSubparts(Dictionary<MyStringId, MyTextureChange>) | Sets subparts custom skinning. Copy values from TextureChanges , then change needed keys. You can retrieve values for exact skin with following code:csharp<br />MyDefinitionManager.Static.GetAssetModifierDefinitionForRender(skinId);<br /><br /> |
| SetWorldMatrix(MatrixD, object) | Sets world matrix of entity. |
| Teleport(MatrixD, object, bool) | When moving entity over large distances or when entity has children, using this method preferred over SetPosition(Vector3D) |
| TryGetSubpart(string, out MyEntitySubpart) | Gets subpart by subpart name |
| UpdateGamePruningStructure() | Update position of entity in MyGamePruningStructure. Calls:csharp<br />MyGamePruningStructure.Move(this)<br /><br /> |
| GetInventory() | Simply get the MyInventoryBase component stored in this entity. Inherited from IMyEntity |
| GetInventory(int) | Search for inventory component with maching index. Inherited from IMyEntity |
| GetPosition() | Gets position in world coordinates Inherited from IMyEntity |
| AddToGamePruningStructure() | Obsolete: Only used during Sandbox removal. |
| RemoveFromGamePruningStructure() | Obsolete: Only used during Sandbox removal. |
| SetTextureChangesForSubparts(Dictionary<string, MyTextureChange>) | Obsolete This calling is obsolete, use another version. |
Implements:
Inheritors:
- IMyAdvancedDoor
- IMyAirtightDoorBase
- IMyAirtightHangarDoor
- IMyAirtightSlideDoor
- IMyAirVent
- IMyAngleGrinder
- IMyArtificialMassBlock
- IMyAssembler
- IMyAttachableTopBlock
- IMyAutomaticRifleGun
- IMyBasicMissionBlock
- IMyBatteryBlock
- IMyBeacon
- IMyBlockPlacerBase
- IMyBroadcastController
- IMyButtonPanel
- IMyCameraBlock
- IMyCargoContainer
- IMyCharacter
- IMyCockpit
- IMyCollector
- IMyControlPanel
- IMyConveyor
- IMyConveyorSorter
- IMyConveyorTube
- IMyCryoChamber
- IMyCubeBlock
- IMyCubeGrid
- IMyDecoy
- IMyDefensiveCombatBlock
- IMyDoor
- IMyEmotionControllerBlock
- IMyEngineerToolBase
- IMyEventControllerBlock
- IMyExhaustBlock
- IMyExtendedPistonBase
- IMyFlightMovementBlock
- IMyFloatingObject
- IMyFunctionalBlock
- IMyGasGenerator
- IMyGasTank
- IMyGravityGenerator
- IMyGravityGeneratorBase
- IMyGravityGeneratorSphere
- IMyGyro
- IMyHandDrill
- IMyHeatVent
- IMyInteriorLight
- IMyInventoryBag
- IMyJumpDrive
- IMyLandingGear
- IMyLargeConveyorTurretBase
- IMyLargeGatlingTurret
- IMyLargeInteriorTurret
- IMyLargeMissileTurret
- IMyLargeTurretBase
- IMyLaserAntenna
- IMyLightingBlock
- IMyMechanicalConnectionBlock
- IMyMedicalRoom
- IMyMeteor
- IMyMissile
- IMyMotorAdvancedRotor
- IMyMotorAdvancedStator
- IMyMotorBase
- IMyMotorRotor
- IMyMotorStator
- IMyMotorSuspension
- IMyOffensiveCombatBlock
- IMyOreDetector
- IMyOxygenFarm
- IMyParachute
- IMyParallelUpdateable
- IMyPassage
- IMyPathRecorderBlock
- IMyPistonBase
- IMyPistonTop
- IMyPowerProducer
- IMyProductionBlock
- IMyProgrammableBlock
- IMyProjector
- IMyRadioAntenna
- IMyReactor
- IMyRefinery
- IMyReflectorLight
- IMyRemoteControl
- IMySafeZoneBlock
- IMySearchlight
- IMySensorBlock
- IMyShipConnector
- IMyShipController
- IMyShipDrill
- IMyShipGrinder
- IMyShipMergeBlock
- IMyShipToolBase
- IMyShipWelder
- IMySmallGatlingGun
- IMySmallMissileLauncher
- IMySmallMissileLauncherReload
- IMySolarPanel
- IMySoundBlock
- IMySpaceBall
- IMyStoreBlock
- IMyTargetDummyBlock
- IMyTargetLockingCapableEntity
- IMyTerminalBlock
- IMyTextPanel
- IMyThrust
- IMyTimerBlock
- IMyTransponder
- IMyTurretControlBlock
- IMyUpgradableBlock
- IMyUpgradeModule
- IMyUserControllableGun
- IMyVendingMachine
- IMyVirtualMass
- IMyVoxelBase
- IMyVoxelMap
- IMyWarhead
- IMyWelder
- IMyWheel
- IMyWindTurbine
- MyAdvancedDoor
- MyAirtightDoorGeneric
- MyAirtightHangarDoor
- MyAirtightSlideDoor
- MyAmmoBase
- MyBatteryBlock
- MyCameraBlock
- MyCargoContainer
- MyCargoContainerInventoryBagEntity
- MyCockpit
- MyConveyor
- MyConveyorConnector
- MyConveyorSorter
- MyCubeBlock
- MyCubeGrid
- MyCustomRenderEntitySubpart
- MyDoor
- MyDoorBase
- MyEmissiveBlock
- MyEntity
- MyEntitySubpart
- MyEnvironmentSector
- MyFloatingObject
- MyForageableEntity
- MyFueledPowerProducer
- MyGyro
- MyHandToolBase
- MyInventoryBagEntity
- MyJumpDrive
- MyKitchen
- MyMeteor
- MyModifiableEntity
- MyPlanet
- MyPlanter
- MyReactor
- MyReflectorLight
- MyRemoteControl
- MySafeZone
- MyShipController
- MySkinnedEntity
- MyThrust
- MyVoxelBase
- MyVoxelMap
- MyWaypoint
- PropellerSubpart