/// <remarks>I have not tested IsInsideVoxel for thread-safety, I assumed it is not.</remarks> public static bool RayCastVoxel(this IMyEntities entities, Vector3 from, Vector3 to, out Vector3 boundary) { using (Lock_MainThread.AcquireSharedUsing()) { entities.IsInsideVoxel(from, to, out boundary); return(boundary != from); } }
public static void Clean() { Session = null; Entities = null; Players = null; CubeBuilder = null; TerminalActionsHelper = null; Utilities = null; Parallel = null; Multiplayer = null; PrefabManager = null; }
/// <summary> /// <para>Uses IMyEntities.GetEntities to get entities in AABB</para> /// <para>Always use over GetEntitiesInAABB_Safe() when blocks are not needed, much faster.</para> /// </summary> /// <param name="preCollect">applied before intersection test</param> public static void GetEntitiesInAABB_Safe_NoBlock(this IMyEntities entitiesObject, BoundingBoxD boundingBox, HashSet <IMyEntity> entities, Func <IMyEntity, bool> preCollect = null) { Func <IMyEntity, bool> collector; if (preCollect == null) { collector = (entity) => boundingBox.Intersects(entity.WorldAABB); } else { collector = (entity) => { return(preCollect(entity) && boundingBox.Intersects(entity.WorldAABB)); } }; entitiesObject.GetEntities_Safe(entities, collector); }
public static void Clean() { Session = null; Entities = null; Players = null; CubeBuilder = null; if (IngameScripting != null) { IngameScripting.Clean(); } IngameScripting = null; TerminalActionsHelper = null; Utilities = null; Parallel = null; Physics = null; Multiplayer = null; PrefabManager = null; Input = null; TerminalControls = null; }
public MyEntitiesRepository(IMyEntities context) { this.Context = context; }
public static void Clean() { Session = null; Entities = null; Players = null; CubeBuilder = null; TerminalActionsHelper = null; Utilities = null; Parallel = null; Multiplayer = null; PrefabManager = null; Input = null; }
public static void GetEntities_Safe(this IMyEntities entitiesObject, HashSet <IMyEntity> entities, Func <IMyEntity, bool> collect = null) { using (Lock_MainThread.AcquireSharedUsing()) entitiesObject.GetEntities(entities, collect); }
/// <summary>Consider using GetEntitiesInSphere_Safe_NoBlock instead.</summary> public static List <IMyEntity> GetEntitiesInSphere_Safe(this IMyEntities entitiesObject, ref BoundingSphereD boundingSphere) { using (Lock_MainThread.AcquireSharedUsing()) return(entitiesObject.GetEntitiesInSphere(ref boundingSphere)); }
/// <summary>Consider using GetEntitiesInAABB_Safe_NoBlock instead.</summary> public static List <IMyEntity> GetEntitiesInAABB_Safe(this IMyEntities entitiesObject, ref BoundingBoxD boundingBox) { using (Lock_MainThread.AcquireSharedUsing()) return(entitiesObject.GetEntitiesInAABB(ref boundingBox)); }