Class MyEntities
Inheritance
System.Object
MyEntities
Assembly: Sandbox.Game.dll
Syntax
[StaticEventOwner]
public static class MyEntities : Object
Fields
CloseAllowed
Declaration
public static bool CloseAllowed
Field Value
| Type |
Description |
| System.Boolean |
|
DetectorsHidden
Declaration
public static bool DetectorsHidden
Field Value
| Type |
Description |
| System.Boolean |
|
DetectorsSelectable
Declaration
public static bool DetectorsSelectable
Field Value
| Type |
Description |
| System.Boolean |
|
EntityCloseLock
Declaration
public static FastResourceLock EntityCloseLock
Field Value
| Type |
Description |
| VRage.FastResourceLock |
|
EntityMarkForCloseLock
Declaration
public static FastResourceLock EntityMarkForCloseLock
Field Value
| Type |
Description |
| VRage.FastResourceLock |
|
IgnoreMemoryLimits
Declaration
public static bool IgnoreMemoryLimits
Field Value
| Type |
Description |
| System.Boolean |
|
IsClosingAll
Declaration
public static bool IsClosingAll
Field Value
| Type |
Description |
| System.Boolean |
|
m_entityNameDictionary
Declaration
public static ConcurrentDictionary<string, MyEntity> m_entityNameDictionary
Field Value
| Type |
Description |
| System.Collections.Concurrent.ConcurrentDictionary<System.String, MyEntity> |
|
Orchestrator
Declaration
public static IMyUpdateOrchestrator Orchestrator
Field Value
ParticleEffectsHidden
Declaration
public static bool ParticleEffectsHidden
Field Value
| Type |
Description |
| System.Boolean |
|
ParticleEffectsSelectable
Declaration
public static bool ParticleEffectsSelectable
Field Value
| Type |
Description |
| System.Boolean |
|
SafeAreasHidden
Declaration
public static bool SafeAreasHidden
Field Value
| Type |
Description |
| System.Boolean |
|
SafeAreasSelectable
Declaration
public static bool SafeAreasSelectable
Field Value
| Type |
Description |
| System.Boolean |
|
UnloadDataLock
Declaration
public static FastResourceLock UnloadDataLock
Field Value
| Type |
Description |
| VRage.FastResourceLock |
|
UpdateInProgress
Declaration
public static bool UpdateInProgress
Field Value
| Type |
Description |
| System.Boolean |
|
Properties
IsAsyncUpdateInProgress
Declaration
public static bool IsAsyncUpdateInProgress { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
IsLoaded
Declaration
public static bool IsLoaded { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
MemoryLimitAddFailure
Declaration
public static bool MemoryLimitAddFailure { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Methods
Add(MyEntity, Boolean)
Declaration
public static void Add(MyEntity entity, bool insertIntoScene = true)
Parameters
| Type |
Name |
Description |
| MyEntity |
entity |
|
| System.Boolean |
insertIntoScene |
|
AddRenderObjectToMap(UInt32, IMyEntity)
Declaration
public static void AddRenderObjectToMap(uint id, IMyEntity entity)
Parameters
| Type |
Name |
Description |
| System.UInt32 |
id |
|
| IMyEntity |
entity |
|
CallAsync(Action)
Declaration
public static void CallAsync(Action doneHandler)
Parameters
| Type |
Name |
Description |
| System.Action |
doneHandler |
|
CallAsync(MyEntity, Action<MyEntity>)
Declaration
public static void CallAsync(MyEntity entity, Action<MyEntity> doneHandler)
Parameters
Close(MyEntity)
Declaration
public static void Close(MyEntity entity)
Parameters
CloseAll()
Declaration
public static void CloseAll()
CreateAsync(MyObjectBuilder_EntityBase, Boolean, Action<MyEntity>)
Creates object asynchronously and adds it into scene.
DoneHandler is invoked from update thread when the object is added into scene.
Declaration
public static void CreateAsync(MyObjectBuilder_EntityBase objectBuilder, bool addToScene, Action<MyEntity> doneHandler = null)
Parameters
CreateEntity(MyDefinitionId, Boolean, Boolean, Nullable<Vector3>, Nullable<Vector3>, Nullable<Vector3>)
Declaration
public static MyEntity CreateEntity(MyDefinitionId entityContainerId, bool fadeIn, bool setPosAndRot = false, Nullable<Vector3> position = null, Nullable<Vector3> up = null, Nullable<Vector3> forward = null)
Parameters
| Type |
Name |
Description |
| MyDefinitionId |
entityContainerId |
|
| System.Boolean |
fadeIn |
|
| System.Boolean |
setPosAndRot |
|
| System.Nullable<Vector3> |
position |
|
| System.Nullable<Vector3> |
up |
|
| System.Nullable<Vector3> |
forward |
|
Returns
CreateEntityAndAdd(MyDefinitionId, Boolean, Boolean, Nullable<Vector3>, Nullable<Vector3>, Nullable<Vector3>)
This method will try to retrieve a definition of components container of the entity and create the type of the entity.
Declaration
public static MyEntity CreateEntityAndAdd(MyDefinitionId entityContainerId, bool fadeIn, bool setPosAndRot = false, Nullable<Vector3> position = null, Nullable<Vector3> up = null, Nullable<Vector3> forward = null)
Parameters
| Type |
Name |
Description |
| MyDefinitionId |
entityContainerId |
This is the id of container definition
|
| System.Boolean |
fadeIn |
|
| System.Boolean |
setPosAndRot |
Set true if want to set entity position, orientation
|
| System.Nullable<Vector3> |
position |
|
| System.Nullable<Vector3> |
up |
|
| System.Nullable<Vector3> |
forward |
|
Returns
CreateFromComponentContainerDefinitionAndAdd(MyDefinitionId, Boolean, Boolean)
Declaration
public static MyEntity CreateFromComponentContainerDefinitionAndAdd(MyDefinitionId entityContainerDefinitionId, bool fadeIn, bool insertIntoScene = true)
Parameters
| Type |
Name |
Description |
| MyDefinitionId |
entityContainerDefinitionId |
|
| System.Boolean |
fadeIn |
|
| System.Boolean |
insertIntoScene |
|
Returns
CreateFromObjectBuilder(MyObjectBuilder_EntityBase, Boolean)
Declaration
public static MyEntity CreateFromObjectBuilder(MyObjectBuilder_EntityBase objectBuilder, bool fadeIn)
Parameters
Returns
CreateFromObjectBuilderAndAdd(MyObjectBuilder_EntityBase, Boolean)
Declaration
public static MyEntity CreateFromObjectBuilderAndAdd(MyObjectBuilder_EntityBase objectBuilder, bool fadeIn)
Parameters
Returns
CreateFromObjectBuilderNoinit(MyObjectBuilder_EntityBase)
Declaration
public static MyEntity CreateFromObjectBuilderNoinit(MyObjectBuilder_EntityBase objectBuilder)
Parameters
Returns
CreateFromObjectBuilderParallel(MyObjectBuilder_EntityBase, Boolean, Action<MyEntity>, MyEntity, MyEntity, Nullable<Vector3D>, Boolean, Boolean)
Create and asynchronously initialize and entity.
Declaration
public static MyEntity CreateFromObjectBuilderParallel(MyObjectBuilder_EntityBase objectBuilder, bool addToScene = false, Action<MyEntity> completionCallback = null, MyEntity entity = null, MyEntity relativeSpawner = null, Nullable<Vector3D> relativeOffset = null, bool checkPosition = false, bool fadeIn = false)
Parameters
| Type |
Name |
Description |
| MyObjectBuilder_EntityBase |
objectBuilder |
|
| System.Boolean |
addToScene |
|
| System.Action<MyEntity> |
completionCallback |
Callback when the entity is initialized
|
| MyEntity |
entity |
Already created entity you only want to init
|
| MyEntity |
relativeSpawner |
|
| System.Nullable<Vector3D> |
relativeOffset |
|
| System.Boolean |
checkPosition |
|
| System.Boolean |
fadeIn |
|
Returns
DebugDraw()
Declaration
public static void DebugDraw()
DebugDrawGridStatistics()
Declaration
public static void DebugDrawGridStatistics()
DebugDrawStatistics()
Declaration
public static void DebugDrawStatistics()
DeleteRememberedEntities()
Declaration
public static void DeleteRememberedEntities()
Draw()
Declaration
public static void Draw()
EnableEntityBoundingBoxDraw(MyEntity, Boolean, Nullable<Vector4>, Single, Nullable<Vector3>, Nullable<MyStringId>, Boolean)
Declaration
public static void EnableEntityBoundingBoxDraw(MyEntity entity, bool enable, Nullable<Vector4> color = null, float lineWidth = 0.01F, Nullable<Vector3> inflateAmount = null, Nullable<MyStringId> lineMaterial = null, bool withAxis = false)
Parameters
| Type |
Name |
Description |
| MyEntity |
entity |
|
| System.Boolean |
enable |
|
| System.Nullable<Vector4> |
color |
|
| System.Single |
lineWidth |
|
| System.Nullable<Vector3> |
inflateAmount |
|
| System.Nullable<MyStringId> |
lineMaterial |
|
| System.Boolean |
withAxis |
|
EntityExists(Int64)
Declaration
public static bool EntityExists(long entityId)
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
Returns
| Type |
Description |
| System.Boolean |
|
EntityExists(String)
Declaration
public static bool EntityExists(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.Boolean |
|
EntityNameExists(String)
Declaration
public static bool EntityNameExists(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.Boolean |
|
Exist(MyEntity)
Checks if entity exists in scene already
Declaration
public static bool Exist(MyEntity entity)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
FindFreePlace(ref MatrixD, Vector3, Single, Int32, Int32, Single, Boolean)
Finds free place for objects defined by position and radius.
StepSize is how fast to increase radius, 0.5f means by half radius.
Declaration
public static Nullable<Vector3D> FindFreePlace(ref MatrixD matrix, Vector3 axis, float radius, int maxTestCount = 20, int testsPerDistance = 5, float stepSize = 1F, bool allowSafezones = false)
Parameters
| Type |
Name |
Description |
| MatrixD |
matrix |
Reference frame from which search for a free place
|
| Vector3 |
axis |
Axis where to perform a rotation searching for a free place
|
| System.Single |
radius |
|
| System.Int32 |
maxTestCount |
|
| System.Int32 |
testsPerDistance |
|
| System.Single |
stepSize |
|
| System.Boolean |
allowSafezones |
|
Returns
| Type |
Description |
| System.Nullable<Vector3D> |
|
FindFreePlace(Vector3D, Single, Int32, Int32, Single, MyEntity, Boolean)
Finds free place for objects defined by position and radius.
StepSize is how fast to increase radius, 0.5f means by half radius.
NOTE: Following method may have the following problems:
CorrectSpawnLocation() should be always followed by a second test for
IsShapePenetrating()
First overlapping test may result in returning a colliding test sphere with a
physics voxel map (case overlappedVoxelmap != null and not a planet)
In second overlapping test, CorrectSpawnLocation() is testing from basePos.
It should probably test from currentPos cause it's the one that is
modified by external cycle
In second overlapping test, CorrectSpawnLocation() may have found
a safe position but that won't be spotted and the result will
be corrupted by the external cycle
Declaration
public static Nullable<Vector3D> FindFreePlace(Vector3D basePos, float radius, int maxTestCount = 20, int testsPerDistance = 5, float stepSize = 1F, MyEntity ignoreEnt = null, bool allowSafezones = false)
Parameters
| Type |
Name |
Description |
| Vector3D |
basePos |
|
| System.Single |
radius |
|
| System.Int32 |
maxTestCount |
|
| System.Int32 |
testsPerDistance |
|
| System.Single |
stepSize |
|
| MyEntity |
ignoreEnt |
|
| System.Boolean |
allowSafezones |
|
Returns
| Type |
Description |
| System.Nullable<Vector3D> |
|
FindFreePlaceCustom(Vector3D, Single, Int32, Int32, Single, Single, MyEntity, Boolean)
Declaration
public static Nullable<Vector3D> FindFreePlaceCustom(Vector3D basePos, float radius, int maxTestCount = 20, int testsPerDistance = 5, float stepSize = 1F, float radiusIncrement = 0F, MyEntity ignoreEnt = null, bool allowSafezones = false)
Parameters
| Type |
Name |
Description |
| Vector3D |
basePos |
|
| System.Single |
radius |
|
| System.Int32 |
maxTestCount |
|
| System.Int32 |
testsPerDistance |
|
| System.Single |
stepSize |
|
| System.Single |
radiusIncrement |
|
| MyEntity |
ignoreEnt |
|
| System.Boolean |
allowSafezones |
|
Returns
| Type |
Description |
| System.Nullable<Vector3D> |
|
ForceCloseEntityOnClients(Int64)
Declaration
[Event(null, 2901)]
[Reliable]
[Broadcast]
public static void ForceCloseEntityOnClients(long entityId)
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
GetElementsInBox(ref BoundingBoxD, List<MyEntity>)
Declaration
public static void GetElementsInBox(ref BoundingBoxD boundingBox, List<MyEntity> foundElements)
Parameters
| Type |
Name |
Description |
| BoundingBoxD |
boundingBox |
|
| System.Collections.Generic.List<MyEntity> |
foundElements |
|
GetEntities()
Declaration
public static MyConcurrentHashSet<MyEntity> GetEntities()
Returns
GetEntitiesInAABB(ref BoundingBox)
Get all rigid body elements touching a bounding box.
Clear() the result list after you're done with it!
Declaration
public static List<MyEntity> GetEntitiesInAABB(ref BoundingBox boundingBox)
Parameters
Returns
| Type |
Description |
| System.Collections.Generic.List<MyEntity> |
The list of results.
|
GetEntitiesInAABB(ref BoundingBoxD, Boolean)
Returns list of entities that intersects with BoundingBox.
If you are modder, you better use IMyEntities method. It is safe to use.
Declaration
public static List<MyEntity> GetEntitiesInAABB(ref BoundingBoxD boundingBox, bool exact = false)
Parameters
| Type |
Name |
Description |
| BoundingBoxD |
boundingBox |
Bounding box in world coordinates
|
| System.Boolean |
exact |
When true more accurate
|
Returns
GetEntitiesInOBB(ref MyOrientedBoundingBoxD)
Returns list of entities that intersects with oriented bounding box.
If you are modder, you better use IMyEntities method. It is safe to use.
Declaration
public static List<MyEntity> GetEntitiesInOBB(ref MyOrientedBoundingBoxD obb)
Parameters
Returns
GetEntitiesInSphere(ref BoundingSphereD)
Returns list of entities that intersects with boundingSphere.
If you are modder, you better use IMyEntities method. It is safe to use.
Declaration
public static List<MyEntity> GetEntitiesInSphere(ref BoundingSphereD boundingSphere)
Parameters
| Type |
Name |
Description |
| BoundingSphereD |
boundingSphere |
Bounding sphere in world coordinates
|
Returns
GetEntityById(Int64, Boolean)
Declaration
public static MyEntity GetEntityById(long entityId, bool allowClosed = false)
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
| System.Boolean |
allowClosed |
|
Returns
GetEntityByIdOrDefault(Int64, MyEntity, Boolean)
Declaration
public static MyEntity GetEntityByIdOrDefault(long entityId, MyEntity defaultValue = null, bool allowClosed = false)
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
| MyEntity |
defaultValue |
|
| System.Boolean |
allowClosed |
|
Returns
GetEntityByIdOrDefault<T>(Int64, T, Boolean)
Declaration
public static T GetEntityByIdOrDefault<T>(long entityId, T defaultValue = null, bool allowClosed = false)
where T : MyEntity
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
| T |
defaultValue |
|
| System.Boolean |
allowClosed |
|
Returns
Type Parameters
GetEntityByName(String)
Declaration
public static MyEntity GetEntityByName(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
GetEntityFromRenderObjectID(UInt32)
Declaration
public static IMyEntity GetEntityFromRenderObjectID(uint renderObjectID)
Parameters
| Type |
Name |
Description |
| System.UInt32 |
renderObjectID |
|
Returns
GetInflatedPlayerBoundingBox(ref BoundingBoxD, Single)
Declaration
public static void GetInflatedPlayerBoundingBox(ref BoundingBoxD playerBox, float inflation)
Parameters
| Type |
Name |
Description |
| BoundingBoxD |
playerBox |
|
| System.Single |
inflation |
|
GetIntersectionWithLine(ref LineD, MyEntity, MyEntity, Boolean, Boolean, Boolean, IntersectionFlags, Single, Boolean, Boolean, Boolean, Boolean)
Declaration
public static Nullable<MyIntersectionResultLineTriangleEx> GetIntersectionWithLine(ref LineD line, MyEntity ignoreEntity0, MyEntity ignoreEntity1, bool ignoreChildren = false, bool ignoreFloatingObjects = true, bool ignoreHandWeapons = true, IntersectionFlags flags, float timeFrame = 0F, bool ignoreObjectsWithoutPhysics = true, bool ignoreSubgridsOfIgnoredEntities = false, bool ignoreCharacters = false, bool ignoreProjections = false)
Parameters
| Type |
Name |
Description |
| LineD |
line |
|
| MyEntity |
ignoreEntity0 |
|
| MyEntity |
ignoreEntity1 |
|
| System.Boolean |
ignoreChildren |
|
| System.Boolean |
ignoreFloatingObjects |
|
| System.Boolean |
ignoreHandWeapons |
|
| IntersectionFlags |
flags |
|
| System.Single |
timeFrame |
|
| System.Boolean |
ignoreObjectsWithoutPhysics |
|
| System.Boolean |
ignoreSubgridsOfIgnoredEntities |
|
| System.Boolean |
ignoreCharacters |
|
| System.Boolean |
ignoreProjections |
|
Returns
| Type |
Description |
| System.Nullable<VRage.Game.Models.MyIntersectionResultLineTriangleEx> |
|
GetIntersectionWithSphere(ref BoundingSphereD)
Declaration
public static MyEntity GetIntersectionWithSphere(ref BoundingSphereD sphere)
Parameters
Returns
GetIntersectionWithSphere(ref BoundingSphereD, MyEntity, MyEntity)
Declaration
public static MyEntity GetIntersectionWithSphere(ref BoundingSphereD sphere, MyEntity ignoreEntity0, MyEntity ignoreEntity1)
Parameters
Returns
GetIntersectionWithSphere(ref BoundingSphereD, MyEntity, MyEntity, Boolean, Boolean, Boolean, Boolean, Boolean)
Declaration
public static MyEntity GetIntersectionWithSphere(ref BoundingSphereD sphere, MyEntity ignoreEntity0, MyEntity ignoreEntity1, bool ignoreVoxelMaps, bool volumetricTest, bool excludeEntitiesWithDisabledPhysics = false, bool ignoreFloatingObjects = true, bool ignoreHandWeapons = true)
Parameters
| Type |
Name |
Description |
| BoundingSphereD |
sphere |
|
| MyEntity |
ignoreEntity0 |
|
| MyEntity |
ignoreEntity1 |
|
| System.Boolean |
ignoreVoxelMaps |
|
| System.Boolean |
volumetricTest |
|
| System.Boolean |
excludeEntitiesWithDisabledPhysics |
|
| System.Boolean |
ignoreFloatingObjects |
|
| System.Boolean |
ignoreHandWeapons |
|
Returns
GetIntersectionWithSphere(ref BoundingSphereD, MyEntity, MyEntity, Boolean, Boolean, ref List<MyEntity>)
Declaration
public static void GetIntersectionWithSphere(ref BoundingSphereD sphere, MyEntity ignoreEntity0, MyEntity ignoreEntity1, bool ignoreVoxelMaps, bool volumetricTest, ref List<MyEntity> result)
Parameters
| Type |
Name |
Description |
| BoundingSphereD |
sphere |
|
| MyEntity |
ignoreEntity0 |
|
| MyEntity |
ignoreEntity1 |
|
| System.Boolean |
ignoreVoxelMaps |
|
| System.Boolean |
volumetricTest |
|
| System.Collections.Generic.List<MyEntity> |
result |
|
GetTopMostEntitiesInBox(ref BoundingBoxD, List<MyEntity>, MyEntityQueryType)
Declaration
public static void GetTopMostEntitiesInBox(ref BoundingBoxD boundingBox, List<MyEntity> foundElements, MyEntityQueryType qtype)
Parameters
GetTopMostEntitiesInSphere(ref BoundingSphereD)
Returns list of entities that intersects with oriented bounding box.
If you are modder, you better use IMyEntities method. It is safe to use.
Declaration
public static List<MyEntity> GetTopMostEntitiesInSphere(ref BoundingSphereD boundingSphere)
Parameters
| Type |
Name |
Description |
| BoundingSphereD |
boundingSphere |
Bounding sphere in world coordinates
|
Returns
HasEntitiesToDelete()
Declaration
public static bool HasEntitiesToDelete()
Returns
| Type |
Description |
| System.Boolean |
|
InitAsync(MyEntity, MyObjectBuilder_EntityBase, Boolean, Action<MyEntity>, Double, Boolean)
Declaration
public static void InitAsync(MyEntity entity, MyObjectBuilder_EntityBase objectBuilder, bool addToScene, Action<MyEntity> doneHandler = null, double serializationTimestamp = 0, bool fadeIn = false)
Parameters
InitEntity(MyObjectBuilder_EntityBase, ref MyEntity, Boolean)
Declaration
public static bool InitEntity(MyObjectBuilder_EntityBase objectBuilder, ref MyEntity entity, bool tolerateBlacklistedPlanets = false)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
InvokeLater(Action, String)
Declaration
public static void InvokeLater(Action action, string callerDebugName = null)
Parameters
| Type |
Name |
Description |
| System.Action |
action |
|
| System.String |
callerDebugName |
|
IsCloseAllowed()
Declaration
public static bool IsCloseAllowed()
Returns
| Type |
Description |
| System.Boolean |
|
IsEntityIdValid(Int64)
Declaration
public static bool IsEntityIdValid(long entityId)
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsInsideVoxel(Vector3D, Vector3D, out Vector3D)
Declaration
public static bool IsInsideVoxel(Vector3D pos, Vector3D hintPosition, out Vector3D lastOutsidePos)
Parameters
| Type |
Name |
Description |
| Vector3D |
pos |
Position of object
|
| Vector3D |
hintPosition |
Position of object few frames back to test whether object enterred voxel. Usually pos - LinearVelocity * x, where x it time.
|
| Vector3D |
lastOutsidePos |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsNameExists(MyEntity, String)
Declaration
public static bool IsNameExists(MyEntity entity, string name)
Parameters
| Type |
Name |
Description |
| MyEntity |
entity |
|
| System.String |
name |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsRaycastBlocked(Vector3D, Vector3D)
Declaration
public static bool IsRaycastBlocked(Vector3D pos, Vector3D target)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
IsShapePenetrating(HkShape, ref Vector3D, ref Quaternion, Func<IMyEntity, Boolean>, Int32, Boolean)
Declaration
public static bool IsShapePenetrating(HkShape shape, ref Vector3D position, ref Quaternion rotation, Func<IMyEntity, bool> entityFilter, int filter = 15, bool allowSafezones = false)
Parameters
| Type |
Name |
Description |
| Havok.HkShape |
shape |
|
| Vector3D |
position |
|
| Quaternion |
rotation |
|
| System.Func<IMyEntity, System.Boolean> |
entityFilter |
|
| System.Int32 |
filter |
|
| System.Boolean |
allowSafezones |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsShapePenetrating(HkShape, ref Vector3D, ref Quaternion, Int32, MyEntity, Boolean)
Declaration
public static bool IsShapePenetrating(HkShape shape, ref Vector3D position, ref Quaternion rotation, int filter = 15, MyEntity ignoreEnt = null, bool allowSafezones = false)
Parameters
| Type |
Name |
Description |
| Havok.HkShape |
shape |
|
| Vector3D |
position |
|
| Quaternion |
rotation |
|
| System.Int32 |
filter |
|
| MyEntity |
ignoreEnt |
|
| System.Boolean |
allowSafezones |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsSpherePenetrating(ref BoundingSphereD, Boolean)
Declaration
public static bool IsSpherePenetrating(ref BoundingSphereD bs, bool allowSafezones = false)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
IsTypeHidden(Type)
Declaration
public static bool IsTypeHidden(Type type)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
Returns
| Type |
Description |
| System.Boolean |
|
IsUpdateInProgress()
Declaration
public static bool IsUpdateInProgress()
Returns
| Type |
Description |
| System.Boolean |
|
IsVisible(IMyEntity)
Declaration
public static bool IsVisible(IMyEntity entity)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Load(List<MyObjectBuilder_EntityBase>, out Nullable<MyStringId>)
Returns false when not all entities were loaded
Declaration
public static bool Load(List<MyObjectBuilder_EntityBase> objectBuilders, out Nullable<MyStringId> errorMessage)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
LoadData()
Declaration
public static void LoadData()
MemoryLimitAddFailureReset()
Declaration
public static void MemoryLimitAddFailureReset()
OverlapAllLineSegment(ref LineD, List<MyLineSegmentOverlapResult<MyEntity>>)
Declaration
public static void OverlapAllLineSegment(ref LineD line, List<MyLineSegmentOverlapResult<MyEntity>> resultList)
Parameters
RaiseEntityAdd(MyEntity)
Declaration
public static void RaiseEntityAdd(MyEntity entity)
Parameters
RaiseEntityCreated(MyEntity)
Declaration
public static void RaiseEntityCreated(MyEntity entity)
Parameters
RaiseEntityRemove(MyEntity)
Declaration
public static void RaiseEntityRemove(MyEntity entity)
Parameters
RegisterForDraw(IMyEntity)
Declaration
public static void RegisterForDraw(IMyEntity entity)
Parameters
RegisterForUpdate(MyEntity)
Declaration
public static void RegisterForUpdate(MyEntity entity)
Parameters
ReleaseWaitingAsync(Byte, Dictionary<Int64, MatrixD>)
Declaration
public static void ReleaseWaitingAsync(byte index, Dictionary<long, MatrixD> matrices)
Parameters
| Type |
Name |
Description |
| System.Byte |
index |
|
| System.Collections.Generic.Dictionary<System.Int64, MatrixD> |
matrices |
|
RemapObjectBuilder(MyObjectBuilder_EntityBase)
Declaration
public static IMyRemapHelper RemapObjectBuilder(MyObjectBuilder_EntityBase objectBuilder)
Parameters
Returns
RemapObjectBuilderCollection(IEnumerable<MyObjectBuilder_EntityBase>)
Declaration
public static void RemapObjectBuilderCollection(IEnumerable<MyObjectBuilder_EntityBase> objectBuilders)
Parameters
Remove(MyEntity)
Removes the specified entity from scene
Declaration
public static bool Remove(MyEntity entity)
Parameters
| Type |
Name |
Description |
| MyEntity |
entity |
The entity.
|
Returns
| Type |
Description |
| System.Boolean |
|
RemoveFromClosedEntities(MyEntity)
Declaration
public static void RemoveFromClosedEntities(MyEntity entity)
Parameters
RemoveName(MyEntity)
Remove name of entity from used names
Declaration
public static void RemoveName(MyEntity entity)
Parameters
RemoveRenderObjectFromMap(UInt32)
Declaration
public static void RemoveRenderObjectFromMap(uint id)
Parameters
| Type |
Name |
Description |
| System.UInt32 |
id |
|
SendCloseRequest(IMyEntity)
Declaration
public static void SendCloseRequest(IMyEntity entity)
Parameters
SetEntityName(MyEntity, Boolean)
Declaration
public static void SetEntityName(MyEntity myEntity, bool possibleRename = true)
Parameters
| Type |
Name |
Description |
| MyEntity |
myEntity |
|
| System.Boolean |
possibleRename |
|
SetTypeHidden(Type, Boolean)
Declaration
public static void SetTypeHidden(Type type, bool hidden)
Parameters
| Type |
Name |
Description |
| System.Type |
type |
|
| System.Boolean |
hidden |
|
Simulate()
Declaration
public static void Simulate()
StartAsyncUpdateBlock()
Start a asynchronous update block.
Declaration
public static MyEntities.AsyncUpdateToken StartAsyncUpdateBlock()
Returns
TestPlaceInSpace(Vector3D, Single, Func<IMyEntity, Boolean>, Boolean)
Declaration
public static Nullable<Vector3D> TestPlaceInSpace(Vector3D basePos, float radius, Func<IMyEntity, bool> ignoredEntity, bool detailedVoxelsCheck = false)
Parameters
| Type |
Name |
Description |
| Vector3D |
basePos |
|
| System.Single |
radius |
|
| System.Func<IMyEntity, System.Boolean> |
ignoredEntity |
|
| System.Boolean |
detailedVoxelsCheck |
|
Returns
| Type |
Description |
| System.Nullable<Vector3D> |
|
TestPlaceInSpace(Vector3D, Single, MyEntity, Boolean)
Declaration
public static Nullable<Vector3D> TestPlaceInSpace(Vector3D basePos, float radius, MyEntity ignoredEntity = null, bool detailedVoxelsCheck = false)
Parameters
| Type |
Name |
Description |
| Vector3D |
basePos |
|
| System.Single |
radius |
|
| MyEntity |
ignoredEntity |
|
| System.Boolean |
detailedVoxelsCheck |
|
Returns
| Type |
Description |
| System.Nullable<Vector3D> |
|
TryGetEntityById(Int64, out MyEntity, Boolean)
Declaration
public static bool TryGetEntityById(long entityId, out MyEntity entity, bool allowClosed = false)
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
| MyEntity |
entity |
|
| System.Boolean |
allowClosed |
|
Returns
| Type |
Description |
| System.Boolean |
|
TryGetEntityById<T>(Int64, out T, Boolean)
Declaration
public static bool TryGetEntityById<T>(long entityId, out T entity, bool allowClosed = false)
where T : MyEntity
Parameters
| Type |
Name |
Description |
| System.Int64 |
entityId |
|
| T |
entity |
|
| System.Boolean |
allowClosed |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
TryGetEntityByName(String, out MyEntity)
Declaration
public static bool TryGetEntityByName(string name, out MyEntity entity)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| MyEntity |
entity |
|
Returns
| Type |
Description |
| System.Boolean |
|
TryGetEntityByName<T>(String, out T)
Declaration
public static bool TryGetEntityByName<T>(string name, out T entity)
where T : MyEntity
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| T |
entity |
|
Returns
| Type |
Description |
| System.Boolean |
|
Type Parameters
UnhideAllTypes()
Declaration
public static void UnhideAllTypes()
UnloadData()
Declaration
public static void UnloadData()
UnregisterForDraw(IMyEntity)
Declaration
public static void UnregisterForDraw(IMyEntity entity)
Parameters
UnregisterForUpdate(MyEntity, Boolean)
Declaration
public static void UnregisterForUpdate(MyEntity entity, bool immediate = false)
Parameters
| Type |
Name |
Description |
| MyEntity |
entity |
|
| System.Boolean |
immediate |
|
UpdateAfterSimulation()
Declaration
public static void UpdateAfterSimulation()
UpdateBeforeSimulation()
Declaration
public static void UpdateBeforeSimulation()
UpdateOnceBeforeFrame()
Declaration
public static void UpdateOnceBeforeFrame()
UpdatingStopped()
Declaration
public static void UpdatingStopped()
Events
OnCloseAll
Declaration
public static event Action OnCloseAll
Event Type
| Type |
Description |
| System.Action |
|
OnEntityAdd
Declaration
public static event Action<MyEntity> OnEntityAdd
Event Type
| Type |
Description |
| System.Action<MyEntity> |
|
OnEntityCreate
Declaration
public static event Action<MyEntity> OnEntityCreate
Event Type
| Type |
Description |
| System.Action<MyEntity> |
|
OnEntityDelete
Declaration
public static event Action<MyEntity> OnEntityDelete
Event Type
| Type |
Description |
| System.Action<MyEntity> |
|
OnEntityNameSet
Declaration
public static event Action<MyEntity, string, string> OnEntityNameSet
Event Type
| Type |
Description |
| System.Action<MyEntity, System.String, System.String> |
|
OnEntityRemove
Declaration
public static event Action<MyEntity> OnEntityRemove
Event Type
| Type |
Description |
| System.Action<MyEntity> |
|