Class MyEntity
Implements entity features for ModAPI interface
Inheritance
System.Object
MyEntity
Assembly: VRage.Game.dll
Syntax
[MyEntityType]
public class MyEntity : Object, IMyEntity, IMyEntity
Constructors
MyEntity()
Declaration
MyEntity(Boolean)
Declaration
public MyEntity(bool testingPurpouses)
Parameters
Type |
Name |
Description |
System.Boolean |
testingPurpouses |
|
Fields
AddToGamePruningStructureExtCallBack
Declaration
public static Action<MyEntity> AddToGamePruningStructureExtCallBack
Field Value
Type |
Description |
System.Action<MyEntity> |
|
CreateDefaultSyncEntityExtCallback
Declaration
public static MyEntity.CreateDefaultSyncEntityDelegate CreateDefaultSyncEntityExtCallback
Field Value
CreateStandardRenderComponentsExtCallback
Declaration
public static Action<MyEntity> CreateStandardRenderComponentsExtCallback
Field Value
Type |
Description |
System.Action<MyEntity> |
|
DebugAsyncLoading
Declaration
public bool DebugAsyncLoading
Field Value
Type |
Description |
System.Boolean |
|
DefinitionId
Declaration
public Nullable<MyDefinitionId> DefinitionId
Field Value
GamePruningProxyId
Declaration
public int GamePruningProxyId
Field Value
Type |
Description |
System.Int32 |
|
InitComponentsExtCallback
Declaration
public static Action<IMyComponentContainer, MyObjectBuilderType, MyStringHash, MyObjectBuilder_ComponentContainer> InitComponentsExtCallback
Field Value
InstantiateSubpartOverrideFunc
Declaration
public Func<MyModelDummy, MyEntitySubpart.Data, MyEntitySubpart> InstantiateSubpartOverrideFunc
Field Value
IsPreviewChanged
Declaration
public Action<bool> IsPreviewChanged
Field Value
Type |
Description |
System.Action<System.Boolean> |
|
Declaration
protected readonly Sync<MyEntity.ContactPointData, SyncDirection.FromServer> m_contactPoint
Field Value
m_hudParams
Declaration
protected List<MyHudEntityParams> m_hudParams
Field Value
Type |
Description |
System.Collections.Generic.List<VRage.Game.Gui.MyHudEntityParams> |
|
m_modelCollision
Declaration
protected MyModel m_modelCollision
Field Value
Type |
Description |
VRage.Game.Models.MyModel |
|
m_positionResetFromServer
Declaration
public bool m_positionResetFromServer
Field Value
Type |
Description |
System.Boolean |
|
MyEntitiesCreateFromObjectBuilderExtCallback
Declaration
public static Func<MyObjectBuilder_EntityBase, bool, MyEntity> MyEntitiesCreateFromObjectBuilderExtCallback
Field Value
MyEntityFactoryCreateObjectBuilderExtCallback
Declaration
public static MyEntity.MyEntityFactoryCreateObjectBuilderDelegate MyEntityFactoryCreateObjectBuilderExtCallback
Field Value
MyProceduralWorldGeneratorTrackEntityExtCallback
Declaration
public static Action<MyEntity> MyProceduralWorldGeneratorTrackEntityExtCallback
Field Value
Type |
Description |
System.Action<MyEntity> |
|
MyWeldingGroupsAddNodeExtCallback
Declaration
public static Action<MyEntity> MyWeldingGroupsAddNodeExtCallback
Field Value
Type |
Description |
System.Action<MyEntity> |
|
MyWeldingGroupsGetGroupNodesExtCallback
Declaration
public static Action<MyEntity, List<MyEntity>> MyWeldingGroupsGetGroupNodesExtCallback
Field Value
Type |
Description |
System.Action<MyEntity, System.Collections.Generic.List<MyEntity>> |
|
MyWeldingGroupsGroupExistsExtCallback
Declaration
public static MyEntity.MyWeldingGroupsGroupExistsDelegate MyWeldingGroupsGroupExistsExtCallback
Field Value
MyWeldingGroupsRemoveNodeExtCallback
Declaration
public static Action<MyEntity> MyWeldingGroupsRemoveNodeExtCallback
Field Value
Type |
Description |
System.Action<MyEntity> |
|
OnEntityCloseRequest
Declaration
public Action<MyEntity> OnEntityCloseRequest
Field Value
Type |
Description |
System.Action<MyEntity> |
|
PropagateSubpartRotationThroughHieerarchy
Declaration
public bool PropagateSubpartRotationThroughHieerarchy
Field Value
Type |
Description |
System.Boolean |
|
ReadyForReplicationAction
Declaration
public Dictionary<IMyReplicable, Action> ReadyForReplicationAction
Field Value
Type |
Description |
System.Collections.Generic.Dictionary<VRage.Network.IMyReplicable, System.Action> |
|
RemoveFromGamePruningStructureExtCallBack
Declaration
public static Action<MyEntity> RemoveFromGamePruningStructureExtCallBack
Field Value
Type |
Description |
System.Action<MyEntity> |
|
ReplicationEnded
Declaration
public Action ReplicationEnded
Field Value
Type |
Description |
System.Action |
|
ReplicationStarted
Declaration
public Action ReplicationStarted
Field Value
Type |
Description |
System.Action |
|
StaticForPruningStructure
Declaration
public bool StaticForPruningStructure
Field Value
Type |
Description |
System.Boolean |
|
TargetPruningProxyId
Declaration
public int TargetPruningProxyId
Field Value
Type |
Description |
System.Int32 |
|
TopMostPruningProxyId
Declaration
public int TopMostPruningProxyId
Field Value
Type |
Description |
System.Int32 |
|
UpdateGamePruningStructureExtCallBack
Declaration
public static Action<MyEntity> UpdateGamePruningStructureExtCallBack
Field Value
Type |
Description |
System.Action<MyEntity> |
|
Properties
Closed
Declaration
public bool Closed { get; protected set; }
Property Value
Type |
Description |
System.Boolean |
|
Components
Declaration
public IMyEntityComponentContainer Components { get; }
Property Value
Type |
Description |
VRage.Game.Components.Interfaces.IMyEntityComponentContainer |
|
DebugName
Declaration
public string DebugName { get; }
Property Value
Type |
Description |
System.String |
|
DisplayName
Declaration
public string DisplayName { get; set; }
Property Value
Type |
Description |
System.String |
|
DisplayNameText
Display Name for GUI etc. Override in descendant classes. Usually used to display in terminal or inventory controls.
Declaration
public virtual string DisplayNameText { get; set; }
Property Value
Type |
Description |
System.String |
|
EntityId
Entity id, can be set by subclasses (for example when using pool...)
Declaration
public long EntityId { get; set; }
Property Value
Type |
Description |
System.Int64 |
|
EntityStorage
Declaration
public MyEntityStorageComponent EntityStorage { get; set; }
Property Value
Flags
Declaration
public EntityFlags Flags { get; set; }
Property Value
GameLogic
Declaration
public virtual MyGameLogicComponent GameLogic { get; set; }
Property Value
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 GetInventoryBase() != null.
Declaration
public bool HasInventory { get; }
Property Value
Type |
Description |
System.Boolean |
|
Hierarchy
Declaration
public MyHierarchyComponent<MyEntity> Hierarchy { get; set; }
Property Value
InScene
Declaration
public bool InScene { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
InvalidateOnMove
Declaration
public bool InvalidateOnMove { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
InventoryCount
Iterate through inventories and return their count.
Declaration
public int InventoryCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
IsCCDForProjectiles
Declaration
public virtual bool IsCCDForProjectiles { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsPreview
Declaration
public bool IsPreview { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
IsReadyForReplication
Declaration
public bool IsReadyForReplication { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsReplicated
Declaration
public bool IsReplicated { get; }
Property Value
Type |
Description |
System.Boolean |
|
IsVolumetric
Declaration
public virtual bool IsVolumetric { get; }
Property Value
Type |
Description |
System.Boolean |
|
LastSnapshotFlags
Declaration
public MySnapshotFlags LastSnapshotFlags { get; set; }
Property Value
Type |
Description |
VRage.Game.Networking.MySnapshotFlags |
|
LocationForHudMarker
Declaration
public virtual Vector3D LocationForHudMarker { get; }
Property Value
MarkedForClose
Declaration
public bool MarkedForClose { get; protected set; }
Property Value
Type |
Description |
System.Boolean |
|
MaxGlassDistSq
Declaration
public virtual float MaxGlassDistSq { get; }
Property Value
Type |
Description |
System.Single |
|
Model
Declaration
public MyModel Model { get; }
Property Value
Type |
Description |
VRage.Game.Models.MyModel |
|
ModelCollision
Declaration
public MyModel ModelCollision { get; }
Property Value
Type |
Description |
VRage.Game.Models.MyModel |
|
Name
Declaration
public string Name { get; set; }
Property Value
Type |
Description |
System.String |
|
NeedsUpdate
Declaration
public MyEntityUpdateEnum NeedsUpdate { get; set; }
Property Value
NeedsWorldMatrix
Declaration
public bool NeedsWorldMatrix { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Parent
Declaration
public MyEntity Parent { get; }
Property Value
Physics
Declaration
public MyPhysicsComponentBase Physics { get; set; }
Property Value
Pinned
Declaration
public bool Pinned { get; }
Property Value
Type |
Description |
System.Boolean |
|
PositionComp
Declaration
public MyPositionComponentBase PositionComp { get; set; }
Property Value
Render
Declaration
public MyRenderComponentBase Render { get; set; }
Property Value
Save
Declaration
public bool Save { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
StopPhysicsActivation
Declaration
public bool StopPhysicsActivation { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Storage
Declaration
public MyModStorageComponentBase Storage { get; set; }
Property Value
Subparts
Declaration
public Dictionary<string, MyEntitySubpart> Subparts { get; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, MyEntitySubpart> |
|
SyncFlag
Declaration
public bool SyncFlag { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
SyncObject
Declaration
public MySyncComponentBase SyncObject { get; protected set; }
Property Value
UpdateDuration
Declaration
public virtual MyEntity.UpdateDurationType UpdateDuration { get; }
Property Value
WorldMatrix
Declaration
public MatrixD WorldMatrix { get; set; }
Property Value
Methods
AddDebugRenderComponent(MyDebugRenderComponentBase)
Declaration
public void AddDebugRenderComponent(MyDebugRenderComponentBase render)
Parameters
AddToGamePruningStructure()
Declaration
public void AddToGamePruningStructure()
AfterPaste()
Declaration
public virtual void AfterPaste()
ApplyLastControls()
Declaration
public virtual void ApplyLastControls()
BeforeDelete()
Declaration
protected virtual void BeforeDelete()
BeforeGameLogicInit()
Called right before initializing the GameLogic component, during entity Init.
Declaration
protected virtual void BeforeGameLogicInit()
BeforePaste()
Declaration
public virtual void BeforePaste()
BeforeSave()
Called before method GetObjectBuilder, when saving sector
Declaration
public virtual void BeforeSave()
CanBeAddedToRender()
Declaration
protected virtual bool CanBeAddedToRender()
Returns
Type |
Description |
System.Boolean |
|
ClampToWorld()
Declaration
protected virtual void ClampToWorld()
ClearDebugRenderComponents()
Declaration
public void ClearDebugRenderComponents()
Close()
This method marks this entity for close which means, that Close
will be called after all entities are updated
Declaration
Closing()
Declaration
protected virtual void Closing()
Components_ComponentAdded(Type, IMyEntityComponentBase)
Declaration
protected virtual void Components_ComponentAdded(Type t, IMyEntityComponentBase c)
Parameters
Type |
Name |
Description |
System.Type |
t |
|
VRage.Game.Components.Interfaces.IMyEntityComponentBase |
c |
|
Components_ComponentRemoved(Type, IMyEntityComponentBase)
Declaration
protected virtual void Components_ComponentRemoved(Type t, IMyEntityComponentBase c)
Parameters
Type |
Name |
Description |
System.Type |
t |
|
VRage.Game.Components.Interfaces.IMyEntityComponentBase |
c |
|
ContainsDebugRenderComponent(Type)
Declaration
public bool ContainsDebugRenderComponent(Type render)
Parameters
Type |
Name |
Description |
System.Type |
render |
|
Returns
Type |
Description |
System.Boolean |
|
CreateSync()
Declaration
DebugDraw()
Declaration
DebugDrawInvalidTriangles()
Declaration
public void DebugDrawInvalidTriangles()
DebugDrawPhysics()
Draw physical representation of entity
Declaration
public virtual void DebugDrawPhysics()
Delete()
Every object must have this method, but not every phys object must necessarily have something to cleanup
Declaration
DeserializeControls(BitStream, Boolean)
Declaration
public virtual void DeserializeControls(BitStream stream, bool outOfOrder)
Parameters
Type |
Name |
Description |
VRage.Library.Collections.BitStream |
stream |
|
System.Boolean |
outOfOrder |
|
DoOverlapSphereTest(Single, Vector3D)
Declaration
public virtual bool DoOverlapSphereTest(float sphereRadius, Vector3D spherePos)
Parameters
Type |
Name |
Description |
System.Single |
sphereRadius |
|
Vector3D |
spherePos |
|
Returns
Type |
Description |
System.Boolean |
|
GetBaseEntity()
Declaration
public virtual MyEntity GetBaseEntity()
Returns
GetCubeBlockParent(MyEntity)
Declaration
public static IMyCubeBlock GetCubeBlockParent(MyEntity ent)
Parameters
Returns
GetDistanceBetweenCameraAndBoundingSphere()
Declaration
public double GetDistanceBetweenCameraAndBoundingSphere()
Returns
Type |
Description |
System.Double |
|
GetDistanceBetweenCameraAndPosition()
Declaration
public double GetDistanceBetweenCameraAndPosition()
Returns
Type |
Description |
System.Double |
|
GetDistanceBetweenPlayerPositionAndBoundingSphere()
Declaration
public double GetDistanceBetweenPlayerPositionAndBoundingSphere()
Returns
Type |
Description |
System.Double |
|
GetFriendlyName()
Declaration
public virtual string GetFriendlyName()
Returns
Type |
Description |
System.String |
|
GetHudParams(Boolean)
Declaration
public virtual List<MyHudEntityParams> GetHudParams(bool allowBlink)
Parameters
Type |
Name |
Description |
System.Boolean |
allowBlink |
|
Returns
Type |
Description |
System.Collections.Generic.List<VRage.Game.Gui.MyHudEntityParams> |
|
GetIntersectionWithAABB(ref BoundingBoxD)
Declaration
public virtual bool GetIntersectionWithAABB(ref BoundingBoxD aabb)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetIntersectionWithLine(ref LineD, out Nullable<MyIntersectionResultLineTriangleEx>, IntersectionFlags)
Declaration
public virtual bool GetIntersectionWithLine(ref LineD line, out Nullable<MyIntersectionResultLineTriangleEx> t, IntersectionFlags flags)
Parameters
Type |
Name |
Description |
LineD |
line |
|
System.Nullable<VRage.Game.Models.MyIntersectionResultLineTriangleEx> |
t |
|
IntersectionFlags |
flags |
|
Returns
Type |
Description |
System.Boolean |
|
GetIntersectionWithLine(ref LineD, out Nullable<Vector3D>, Boolean, IntersectionFlags)
Declaration
public virtual bool GetIntersectionWithLine(ref LineD line, out Nullable<Vector3D> v, bool useCollisionModel = true, IntersectionFlags flags)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetIntersectionWithLineAndBoundingSphere(ref LineD, Single)
Declaration
public virtual Nullable<Vector3D> GetIntersectionWithLineAndBoundingSphere(ref LineD line, float boundingSphereRadiusMultiplier)
Parameters
Type |
Name |
Description |
LineD |
line |
|
System.Single |
boundingSphereRadiusMultiplier |
|
Returns
Type |
Description |
System.Nullable<Vector3D> |
|
GetIntersectionWithSphere(ref BoundingSphereD)
Declaration
public virtual bool GetIntersectionWithSphere(ref BoundingSphereD sphere)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetInventoryBase()
Simply get the MyInventoryBase component stored in this entity.
Declaration
public MyInventoryBase GetInventoryBase()
Returns
GetInventoryBase(Int32)
Search for inventory component with maching index.
Declaration
public virtual MyInventoryBase GetInventoryBase(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
GetLargestDistanceBetweenCameraAndBoundingSphere()
Declaration
public double GetLargestDistanceBetweenCameraAndBoundingSphere()
Returns
Type |
Description |
System.Double |
|
GetObjectBuilder(Boolean)
Gets object builder from object.
Declaration
public virtual MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false)
Parameters
Type |
Name |
Description |
System.Boolean |
copy |
|
Returns
GetSmallestDistanceBetweenCameraAndBoundingSphere()
Declaration
public double GetSmallestDistanceBetweenCameraAndBoundingSphere()
Returns
Type |
Description |
System.Double |
|
GetSubpart(String)
Declaration
public MyEntitySubpart GetSubpart(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
GetTopMostParent(Type)
Return top most parent of this entity
Declaration
public MyEntity GetTopMostParent(Type type = null)
Parameters
Type |
Name |
Description |
System.Type |
type |
|
Returns
GetTrianglesIntersectingSphere(ref BoundingSphere, Nullable<Vector3>, Nullable<Single>, List<MyTriangle_Vertex_Normals>, Int32)
Declaration
public void GetTrianglesIntersectingSphere(ref BoundingSphere sphere, Nullable<Vector3> referenceNormalVector, Nullable<float> maxAngle, List<MyTriangle_Vertex_Normals> retTriangles, int maxNeighbourTriangles)
Parameters
Type |
Name |
Description |
BoundingSphere |
sphere |
|
System.Nullable<Vector3> |
referenceNormalVector |
|
System.Nullable<System.Single> |
maxAngle |
|
System.Collections.Generic.List<MyTriangle_Vertex_Normals> |
retTriangles |
|
System.Int32 |
maxNeighbourTriangles |
|
GetViewMatrix()
Declaration
public virtual MatrixD GetViewMatrix()
Returns
Init(StringBuilder, String, MyEntity, Nullable<Single>, String)
Declaration
public virtual void Init(StringBuilder displayName, string model, MyEntity parentObject, Nullable<float> scale, string modelCollision = null)
Parameters
Type |
Name |
Description |
System.Text.StringBuilder |
displayName |
|
System.String |
model |
|
MyEntity |
parentObject |
|
System.Nullable<System.Single> |
scale |
|
System.String |
modelCollision |
|
Init(MyObjectBuilder_EntityBase)
Declaration
public virtual void Init(MyObjectBuilder_EntityBase objectBuilder)
Parameters
InitComponents()
Declaration
public virtual void InitComponents()
InitComponentsForTesting()
Declaration
public virtual void InitComponentsForTesting()
InstantiateSubpart(MyModelDummy, ref MyEntitySubpart.Data)
Declaration
protected virtual MyEntitySubpart InstantiateSubpart(MyModelDummy subpartDummy, ref MyEntitySubpart.Data data)
Parameters
Returns
OnAddedToScene(Object)
Called when [activated] which for entity means that was added to scene.
Declaration
public virtual void OnAddedToScene(object source)
Parameters
Type |
Name |
Description |
System.Object |
source |
The source of activation.
|
OnCreateSync()
Declaration
protected virtual MySyncComponentBase OnCreateSync()
Returns
OnInventoryComponentAdded(MyInventoryBase)
Declaration
protected virtual void OnInventoryComponentAdded(MyInventoryBase inventory)
Parameters
OnInventoryComponentRemoved(MyInventoryBase)
Declaration
protected virtual void OnInventoryComponentRemoved(MyInventoryBase inventory)
Parameters
OnRemovedFromScene(Object)
Declaration
public virtual void OnRemovedFromScene(object source)
Parameters
Type |
Name |
Description |
System.Object |
source |
|
OnReplicationEnded()
Declaration
public virtual void OnReplicationEnded()
OnReplicationStarted()
Declaration
public virtual void OnReplicationStarted()
Pin()
Declaration
public MyEntity.EntityPin Pin()
Returns
PrepareForDraw()
Method is called defacto from Update, preparation fo Draw
Declaration
public virtual void PrepareForDraw()
RaisePhysicsChanged()
Declaration
public void RaisePhysicsChanged()
RefreshModels(String, String)
Declaration
public virtual void RefreshModels(string model, string modelCollision)
Parameters
Type |
Name |
Description |
System.String |
model |
|
System.String |
modelCollision |
|
RemoveDebugRenderComponent(Type)
Declaration
public void RemoveDebugRenderComponent(Type t)
Parameters
Type |
Name |
Description |
System.Type |
t |
|
RemoveDebugRenderComponent(MyDebugRenderComponentBase)
Declaration
public void RemoveDebugRenderComponent(MyDebugRenderComponentBase render)
Parameters
RemoveFromGamePruningStructure()
Declaration
public void RemoveFromGamePruningStructure()
ResetControls()
Declaration
public virtual void ResetControls()
SerializeControls(BitStream)
Declaration
public virtual void SerializeControls(BitStream stream)
Parameters
Type |
Name |
Description |
VRage.Library.Collections.BitStream |
stream |
|
SetEmissiveParts(String, Color, Single)
Declaration
public void SetEmissiveParts(string emissiveName, Color emissivePartColor, float emissivity)
Parameters
Type |
Name |
Description |
System.String |
emissiveName |
|
Color |
emissivePartColor |
|
System.Single |
emissivity |
|
SetEmissivePartsForSubparts(String, Color, Single)
Declaration
public void SetEmissivePartsForSubparts(string emissiveName, Color emissivePartColor, float emissivity)
Parameters
Type |
Name |
Description |
System.String |
emissiveName |
|
Color |
emissivePartColor |
|
System.Single |
emissivity |
|
SetFadeOut(Boolean)
Declaration
public void SetFadeOut(bool state)
Parameters
Type |
Name |
Description |
System.Boolean |
state |
|
Simulate()
Declaration
public virtual void Simulate()
Teleport(MatrixD, Object, Boolean)
Declaration
public virtual void Teleport(MatrixD worldMatrix, object source = null, bool ignoreAssert = false)
Parameters
Type |
Name |
Description |
MatrixD |
worldMatrix |
|
System.Object |
source |
|
System.Boolean |
ignoreAssert |
|
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
TryGetDebugRenderComponent<T>(out T)
Declaration
public bool TryGetDebugRenderComponent<T>(out T debugComponent)
Parameters
Type |
Name |
Description |
T |
debugComponent |
|
Returns
Type |
Description |
System.Boolean |
|
Type Parameters
TryGetSubpart(String, out MyEntitySubpart)
Declaration
public bool TryGetSubpart(string name, out MyEntitySubpart subpart)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Unpin()
Declaration
UpdateAfterSimulation()
Declaration
public virtual void UpdateAfterSimulation()
UpdateAfterSimulation10()
Declaration
public virtual void UpdateAfterSimulation10()
UpdateAfterSimulation100()
Declaration
public virtual void UpdateAfterSimulation100()
UpdateBeforeSimulation()
Declaration
public virtual void UpdateBeforeSimulation()
UpdateBeforeSimulation10()
Called each 10th frame if registered for update10
Declaration
public virtual void UpdateBeforeSimulation10()
UpdateBeforeSimulation100()
Called each 100th frame if registered for update100
Declaration
public virtual void UpdateBeforeSimulation100()
UpdateGamePruningStructure()
Declaration
public void UpdateGamePruningStructure()
UpdateNamedEmissiveParts(UInt32, String, Color, Single)
Declaration
protected static void UpdateNamedEmissiveParts(uint renderObjectId, string emissiveName, Color emissivePartColor, float emissivity)
Parameters
Type |
Name |
Description |
System.UInt32 |
renderObjectId |
|
System.String |
emissiveName |
|
Color |
emissivePartColor |
|
System.Single |
emissivity |
|
UpdateOnceBeforeFrame()
Declaration
public virtual void UpdateOnceBeforeFrame()
Declaration
public void UpdateSoundContactPoint(long entityId, Vector3 localPosition, Vector3 normal, Vector3 separatingVelocity, float separatingSpeed)
Parameters
Type |
Name |
Description |
System.Int64 |
entityId |
|
Vector3 |
localPosition |
|
Vector3 |
normal |
|
Vector3 |
separatingVelocity |
|
System.Single |
separatingSpeed |
|
UpdatingStopped()
Declaration
public virtual void UpdatingStopped()
Events
AddedToScene
Declaration
public event Action<MyEntity> AddedToScene
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnClose
Declaration
public event Action<MyEntity> OnClose
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnClosing
Declaration
public event Action<MyEntity> OnClosing
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnDebugDraw
Declaration
public event Action<MyEntity> OnDebugDraw
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnMarkForClose
This event may not be invoked at all, when calling MyEntities.CloseAll, marking is bypassed
Declaration
public event Action<MyEntity> OnMarkForClose
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnModelRefresh
Declaration
public event Action<MyEntity> OnModelRefresh
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnPhysicsChanged
Declaration
public event Action<MyEntity> OnPhysicsChanged
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnPhysicsComponentChanged
Declaration
public event Action<MyPhysicsComponentBase, MyPhysicsComponentBase> OnPhysicsComponentChanged
Event Type
OnTeleported
Declaration
public event Action<MyEntity> OnTeleported
Event Type
Type |
Description |
System.Action<MyEntity> |
|
OnUpdateOnceBeforeNextFrame
Declaration
public event Action<MyEntity> OnUpdateOnceBeforeNextFrame
Event Type
Type |
Description |
System.Action<MyEntity> |
|
RemovedFromScene
Declaration
public event Action<MyEntity> RemovedFromScene
Event Type
Type |
Description |
System.Action<MyEntity> |
|
Explicit Interface Implementations
IMyEntity.Closed
True if the block has been removed from the world.
Declaration
bool IMyEntity.Closed { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.DisplayName
Gets user friendly name of entity. May be null
For block terminal name use DisplayNameText
Declaration
string IMyEntity.DisplayName { get; }
Returns
Type |
Description |
System.String |
|
IMyEntity.GetInventory()
Simply get the MyInventoryBase component stored in this entity.
Declaration
IMyInventory IMyEntity.GetInventory()
Returns
IMyEntity.GetInventory(Int32)
Search for inventory component with maching index.
Declaration
IMyInventory IMyEntity.GetInventory(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
IMyEntity.GetPosition()
Gets position in world coordinates
Declaration
Vector3D IMyEntity.GetPosition()
Returns
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.
Declaration
bool IMyEntity.HasInventory { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.InventoryCount
Returns the count of the number of inventories this entity has.
Declaration
int IMyEntity.InventoryCount { get; }
Returns
Type |
Description |
System.Int32 |
|
IMyEntity.Name
Declaration
string IMyEntity.Name { get; }
Returns
Type |
Description |
System.String |
|
IMyEntity.WorldAABB
Gets world axis-aligned bounding box
Declaration
BoundingBoxD IMyEntity.WorldAABB { get; }
Returns
IMyEntity.WorldAABBHr
Gets world axis-aligned bounding box
Declaration
BoundingBoxD IMyEntity.WorldAABBHr { get; }
Returns
IMyEntity.WorldMatrix
Gets world matrix of this entity
Declaration
MatrixD IMyEntity.WorldMatrix { get; }
Returns
IMyEntity.WorldVolume
Gets bounding sphere of this entity
Declaration
BoundingSphereD IMyEntity.WorldVolume { get; }
Returns
IMyEntity.WorldVolumeHr
Gets bounding sphere of this entity
Declaration
BoundingSphereD IMyEntity.WorldVolumeHr { get; }
Returns
IMyEntity.CastShadows
Declaration
bool IMyEntity.CastShadows { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.Close()
This method marks this entity for close which means, that Close
will be called after all entities are updated
Declaration
IMyEntity.DebugAsyncLoading
Used for internal usage. Modders should not use it. Will be eventually removed
Declaration
bool IMyEntity.DebugAsyncLoading { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.Delete()
Performs real cleaning of entity. Should be called by game. Modders should prefer Close() method.
Declaration
IMyEntity.DisplayName
Gets or sets user friendly name of entity
Declaration
string IMyEntity.DisplayName { get; set; }
Returns
Type |
Description |
System.String |
|
IMyEntity.DoOverlapSphereTest(Single, Vector3D)
Declaration
bool IMyEntity.DoOverlapSphereTest(float sphereRadius, Vector3D spherePos)
Parameters
Type |
Name |
Description |
System.Single |
sphereRadius |
Radius of sphere
|
Vector3D |
spherePos |
World position
|
Returns
Type |
Description |
System.Boolean |
True if intersects
|
IMyEntity.EnableColorMaskForSubparts(Boolean)
Allows subparts have different color than their parent
Declaration
void IMyEntity.EnableColorMaskForSubparts(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
IMyEntity.FastCastShadowResolve
Declaration
bool IMyEntity.FastCastShadowResolve { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.GameLogic
Gets or sets game logic for object.
If there is more than 1 game logic attached it should be wrapped into MyCompositeGameLogicComponent.
Declaration
MyEntityComponentBase IMyEntity.GameLogic { get; set; }
Returns
See Also
IMyEntity.GetChildren(List<IMyEntity>, Func<IMyEntity, Boolean>)
Gets children of entity. Child - entity, who's Parent is this entity
Declaration
void IMyEntity.GetChildren(List<IMyEntity> children, Func<IMyEntity, bool> collect)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<IMyEntity> |
children |
List, that would receive results
|
System.Func<IMyEntity, System.Boolean> |
collect |
When returns true - child added to list
|
IMyEntity.GetDiffuseColor()
Gets render diffuse color
Declaration
Vector3 IMyEntity.GetDiffuseColor()
Returns
Type |
Description |
Vector3 |
Diffuse color
|
IMyEntity.GetDistanceBetweenCameraAndBoundingSphere()
Distance from camera to bounding sphere of this phys object. Result is always positive, even if camera is inside the sphere. (in meters)
Declaration
float IMyEntity.GetDistanceBetweenCameraAndBoundingSphere()
Returns
Type |
Description |
System.Single |
Distance in meters
|
IMyEntity.GetDistanceBetweenCameraAndPosition()
Distance from camera to position of entity.
Declaration
float IMyEntity.GetDistanceBetweenCameraAndPosition()
Returns
Type |
Description |
System.Single |
Distance in meters
|
IMyEntity.GetFriendlyName()
Not used. Actually not a friendly name
Declaration
string IMyEntity.GetFriendlyName()
Returns
Type |
Description |
System.String |
String.Empty or "MyVoxelMap"
|
IMyEntity.GetIntersectionWithLineAndBoundingSphere(ref LineD, Single)
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.
Declaration
Nullable<Vector3D> IMyEntity.GetIntersectionWithLineAndBoundingSphere(ref LineD line, float boundingSphereRadiusMultiplier)
Parameters
Type |
Name |
Description |
LineD |
line |
Line to check
|
System.Single |
boundingSphereRadiusMultiplier |
Bounding sphere radius would be multiplied by this value
|
Returns
Type |
Description |
System.Nullable<Vector3D> |
Position of intersection if of line and bounding sphere
|
IMyEntity.GetIntersectionWithSphere(ref BoundingSphereD)
Return true if object intersects specified sphere.
Declaration
bool IMyEntity.GetIntersectionWithSphere(ref BoundingSphereD sphere)
Parameters
Returns
Type |
Description |
System.Boolean |
True if intersects
|
IMyEntity.GetInventory()
Simply get the MyInventoryBase component stored in this entity.
Declaration
IMyInventory IMyEntity.GetInventory()
Returns
IMyEntity.GetInventory(Int32)
Search for inventory component with matching index.
Declaration
IMyInventory IMyEntity.GetInventory(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
Index of inventory, starting from 0
|
Returns
Type |
Description |
IMyInventory |
Null, or inventory at matching index
|
IMyEntity.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
Declaration
float IMyEntity.GetLargestDistanceBetweenCameraAndBoundingSphere()
Returns
Type |
Description |
System.Single |
Distance in meters
|
IMyEntity.GetObjectBuilder(Boolean)
Returns object builder - object representing block state, and allows restore it. Used in game save, or syncing over network.
Declaration
MyObjectBuilder_EntityBase IMyEntity.GetObjectBuilder(bool copy)
Parameters
Type |
Name |
Description |
System.Boolean |
copy |
When true, Name won't be saved. Copy true comes only from MyGridClipboard/MyFloatingObjectClipboard/MyVoxelClipboard
|
Returns
IMyEntity.GetSmallestDistanceBetweenCameraAndBoundingSphere()
Smallest distance between camera and bounding sphere of this phys object. Result is always positive, even if camera is inside the sphere.
Declaration
float IMyEntity.GetSmallestDistanceBetweenCameraAndBoundingSphere()
Returns
Type |
Description |
System.Single |
Distance in meters
|
IMyEntity.GetTopMostParent(Type)
Gets top most Parent of specified type.
Top most is entity that doesn't have parent (of specified type)
Declaration
IMyEntity IMyEntity.GetTopMostParent(Type type)
Parameters
Type |
Name |
Description |
System.Type |
type |
Type of parent. When type is null, type check disabled
|
Returns
IMyEntity.GetTrianglesIntersectingSphere(ref BoundingSphere, Nullable<Vector3>, Nullable<Single>, List<MyTriangle_Vertex_Normals>, Int32)
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!
Declaration
void IMyEntity.GetTrianglesIntersectingSphere(ref BoundingSphere sphere, Nullable<Vector3> referenceNormalVector, Nullable<float> maxAngle, List<MyTriangle_Vertex_Normals> retTriangles, int maxNeighbourTriangles)
Parameters
Type |
Name |
Description |
BoundingSphere |
sphere |
Sphere to check
|
System.Nullable<Vector3> |
referenceNormalVector |
Used in filtering triangles
|
System.Nullable<System.Single> |
maxAngle |
Max angle between referenceNormalVector and every triangleVertex of model
|
System.Collections.Generic.List<MyTriangle_Vertex_Normals> |
retTriangles |
Triangles would be added here
|
System.Int32 |
maxNeighbourTriangles |
Limit of added triangles
|
IMyEntity.GetViewMatrix()
Declaration
MatrixD IMyEntity.GetViewMatrix()
Returns
IMyEntity.GetWorldMatrixNormalizedInv()
Declaration
MatrixD IMyEntity.GetWorldMatrixNormalizedInv()
Returns
IMyEntity.Hierarchy
Declaration
MyHierarchyComponentBase IMyEntity.Hierarchy { get; set; }
Returns
IMyEntity.InScene
Gets or set if grid is InScene. Objects that are not in scene are not updated and drawn.
Declaration
bool IMyEntity.InScene { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.InvalidateOnMove
Gets if entity is invalidated on move
When visual look of entity depends on position - then InvalidateOnMove should be true
Declaration
bool IMyEntity.InvalidateOnMove { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.IsCCDForProjectiles
Declaration
bool IMyEntity.IsCCDForProjectiles { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.IsVisible()
Declaration
bool IMyEntity.IsVisible()
Returns
Type |
Description |
System.Boolean |
True if entity should be drawn
|
IMyEntity.IsVolumetric
Declaration
bool IMyEntity.IsVolumetric { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.LocalAABB
Declaration
BoundingBox IMyEntity.LocalAABB { get; set; }
Returns
IMyEntity.LocalAABBHr
Declaration
BoundingBox IMyEntity.LocalAABBHr { get; }
Returns
IMyEntity.LocalMatrix
Gets or sets local matrix.
When entity, has parent, it's world coordinates are calculated from localMatrix and parent world matrix
Declaration
Matrix IMyEntity.LocalMatrix { get; set; }
Returns
IMyEntity.LocalVolume
Declaration
BoundingSphere IMyEntity.LocalVolume { get; set; }
Returns
IMyEntity.LocalVolumeOffset
Declaration
Vector3 IMyEntity.LocalVolumeOffset { get; set; }
Returns
IMyEntity.LocationForHudMarker
Declaration
Vector3D IMyEntity.LocationForHudMarker { get; }
Returns
IMyEntity.MarkedForClose
Declaration
bool IMyEntity.MarkedForClose { get; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.MaxGlassDistSq
Declaration
float IMyEntity.MaxGlassDistSq { get; }
Returns
Type |
Description |
System.Single |
|
IMyEntity.Model
Declaration
IMyModel IMyEntity.Model { get; }
Returns
IMyEntity.ModelCollision
Gets collision model of block
Declaration
IMyModel IMyEntity.ModelCollision { get; }
Returns
IMyEntity.Name
Uniq name of entity. Can be used to find entity by name
Declaration
string IMyEntity.Name { get; set; }
Returns
Type |
Description |
System.String |
|
IMyEntity.NearFlag
Declaration
bool IMyEntity.NearFlag { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.NeedsDraw
Declaration
bool IMyEntity.NeedsDraw { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.NeedsDrawFromParent
Declaration
bool IMyEntity.NeedsDrawFromParent { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.NeedsResolveCastShadow
Declaration
bool IMyEntity.NeedsResolveCastShadow { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.NeedsUpdate
Gets or sets how often the entity should be updated.
Declaration
MyEntityUpdateEnum IMyEntity.NeedsUpdate { get; set; }
Returns
IMyEntity.OnClose
Declaration
event Action<IMyEntity> IMyEntity.OnClose
Returns
IMyEntity.OnClosing
Declaration
event Action<IMyEntity> IMyEntity.OnClosing
Returns
IMyEntity.OnMarkForClose
Declaration
event Action<IMyEntity> IMyEntity.OnMarkForClose
Returns
IMyEntity.OnPhysicsChanged
Called when havok rigid body physics are changed: inited, closed, modified.
Declaration
event Action<IMyEntity> IMyEntity.OnPhysicsChanged
Returns
IMyEntity.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.
Declaration
IMyEntity IMyEntity.Parent { get; }
Returns
IMyEntity.PersistentFlags
Gets or sets persistent flags that are used in rendering.
Declaration
MyPersistentEntityFlags2 IMyEntity.PersistentFlags { get; set; }
Returns
IMyEntity.Physics
Declaration
MyPhysicsComponentBase IMyEntity.Physics { get; set; }
Returns
IMyEntity.Save
Gets or sets Save. Entity won't be saved if Save is false
Declaration
bool IMyEntity.Save { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.SetColorMaskForSubparts(Vector3)
Declaration
void IMyEntity.SetColorMaskForSubparts(Vector3 colorMaskHsv)
Parameters
Type |
Name |
Description |
Vector3 |
colorMaskHsv |
Color
|
IMyEntity.SetEmissiveParts(String, Color, Single)
Sets the emissive value of a specific emissive material on entity.
Declaration
void IMyEntity.SetEmissiveParts(string emissiveName, Color emissivePartColor, float emissivity)
Parameters
Type |
Name |
Description |
System.String |
emissiveName |
The name of the emissive material (ie. "Emissive0")
|
Color |
emissivePartColor |
Color to emit
|
System.Single |
emissivity |
Level of emissivity (0 is off, 1 is full brightness)
|
IMyEntity.SetEmissivePartsForSubparts(String, Color, Single)
Sets the emissive value of a specific emissive material on all entity subparts.
Declaration
void IMyEntity.SetEmissivePartsForSubparts(string emissiveName, Color emissivePartColor, float emissivity)
Parameters
Type |
Name |
Description |
System.String |
emissiveName |
The name of the emissive material (ie. "Emissive0")
|
Color |
emissivePartColor |
Color to emit
|
System.Single |
emissivity |
Level of emissivity (0 is off, 1 is full brightness).
|
IMyEntity.SetLocalMatrix(Matrix, Object)
Sets local matrix.
When entity, has parent, it's world coordinates are calculated from localMatrix and parent world matrix
Declaration
void IMyEntity.SetLocalMatrix(Matrix localMatrix, object source)
Parameters
Type |
Name |
Description |
Matrix |
localMatrix |
New matrix
|
System.Object |
source |
Object that caused this event. Not used in anyway
|
IMyEntity.SetPosition(Vector3D)
Declaration
void IMyEntity.SetPosition(Vector3D pos)
Parameters
Type |
Name |
Description |
Vector3D |
pos |
New position of entity
|
IMyEntity.SetTextureChangesForSubparts(Dictionary<String, MyTextureChange>)
This calling is obsolete, use another version.
Declaration
void IMyEntity.SetTextureChangesForSubparts(Dictionary<string, MyTextureChange> textureChanges)
Parameters
Type |
Name |
Description |
System.Collections.Generic.Dictionary<System.String, VRageRender.Messages.MyTextureChange> |
textureChanges |
|
IMyEntity.SetTextureChangesForSubparts(Dictionary<MyStringId, MyTextureChange>)
Declaration
void IMyEntity.SetTextureChangesForSubparts(Dictionary<MyStringId, MyTextureChange> textureChanges)
Parameters
Type |
Name |
Description |
System.Collections.Generic.Dictionary<MyStringId, VRageRender.Messages.MyTextureChange> |
textureChanges |
|
IMyEntity.SetWorldMatrix(MatrixD, Object)
Sets world matrix of entity.
Declaration
void IMyEntity.SetWorldMatrix(MatrixD worldMatrix, object source)
Parameters
Type |
Name |
Description |
MatrixD |
worldMatrix |
New world matrix
|
System.Object |
source |
Object that triggered set of new matrix
|
IMyEntity.ShadowBoxLod
Declaration
bool IMyEntity.ShadowBoxLod { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.SkipIfTooSmall
Declaration
bool IMyEntity.SkipIfTooSmall { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.Storage
Custom storage for mods. Shared with all mods.
Declaration
MyModStorageComponentBase IMyEntity.Storage { get; set; }
Returns
IMyEntity.Synchronized
Gets or sets if the entity should be synced.
Declaration
bool IMyEntity.Synchronized { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.Transparent
Gets or sets Transparency. When setting true entity would be 25% transparent
Declaration
bool IMyEntity.Transparent { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.Visible
Declaration
bool IMyEntity.Visible { get; set; }
Returns
Type |
Description |
System.Boolean |
|
IMyEntity.WorldMatrix
Gets or sets world matrix.
Declaration
MatrixD IMyEntity.WorldMatrix { get; set; }
Returns
See Also
IMyEntity.WorldMatrixInvScaled
Declaration
MatrixD IMyEntity.WorldMatrixInvScaled { get; }
Returns
IMyEntity.WorldMatrixNormalizedInv
Declaration
MatrixD IMyEntity.WorldMatrixNormalizedInv { get; }
Returns
Implements
Extension Methods