|
|
Line 6: |
Line 6: |
| == Examples == | | == Examples == |
| <syntaxhighlight lang="csharp"> | | <syntaxhighlight lang="csharp"> |
− | using Sandbox.Common;
| + | // Examples here |
− | using Sandbox.Common.Components;
| |
− | using Sandbox.Common.ObjectBuilders;
| |
− | using System;
| |
− | using System.Collections.Generic;
| |
− | using VRageMath;
| |
− | | |
− | namespace Sandbox.ModAPI
| |
− | {
| |
− | public interface IMyEntity
| |
− | {
| |
− | long EntityId { get; set; }
| |
− | | |
− | string Name { get; }
| |
− | | |
− | string DisplayName { get; set; }
| |
− | | |
− | bool MarkedForClose { get; }
| |
− | | |
− | bool Closed { get; }
| |
− | | |
− | MyGameLogicComponent GameLogic { get; set; }
| |
− | | |
− | MyEntityUpdateEnum NeedsUpdate { get; set; }
| |
− | | |
− | IMyEntity Parent { get; }
| |
− | | |
− | bool NearFlag { get; set; }
| |
− | | |
− | bool CastShadows { get; set; }
| |
− | | |
− | bool FastCastShadowResolve { get; set; }
| |
− | | |
− | bool NeedsResolveCastShadow { get; set; }
| |
− | | |
− | float MaxGlassDistSq { get; }
| |
− | | |
− | bool NeedsDraw { get; set; }
| |
− | | |
− | bool NeedsDrawFromParent { get; set; }
| |
− | | |
− | bool Transparent { get; set; }
| |
− | | |
− | bool ShadowBoxLod { get; set; }
| |
− | | |
− | bool SkipIfTooSmall { get; set; }
| |
− | | |
− | float? Scale { get; set; }
| |
− | | |
− | bool Visible { get; set; }
| |
− | | |
− | bool Save { get; set; }
| |
− | | |
− | MyPersistentEntityFlags2 PersistentFlags { get; set; }
| |
− | | |
− | bool InScene { get; }
| |
− | | |
− | bool InvalidateOnMove { get; }
| |
− | | |
− | bool IsCCDForProjectiles { get; }
| |
− | | |
− | bool IsVolumetric { get; }
| |
− | | |
− | BoundingBox LocalAABB { get; set; }
| |
− | | |
− | BoundingBox LocalAABBHr { get; }
| |
− | | |
− | Matrix LocalMatrix { get; set; }
| |
− | | |
− | BoundingSphere LocalVolume { get; set; }
| |
− | | |
− | Vector3 LocalVolumeOffset { get; set; }
| |
− | | |
− | Vector3 LocationForHudMarker { get; }
| |
− | | |
− | BoundingBox WorldAABB { get; }
| |
− | | |
− | BoundingBox WorldAABBHr { get; }
| |
− | | |
− | Matrix WorldMatrix { get; set; }
| |
− | | |
− | Matrix WorldMatrixInvScaled { get; }
| |
− | | |
− | Matrix WorldMatrixNormalizedInv { get; }
| |
− | | |
− | BoundingSphere WorldVolume { get; }
| |
− | | |
− | BoundingSphere WorldVolumeHr { get; }
| |
− | | |
− | event Action<IMyEntity> OnClose;
| |
− | | |
− | event Action<IMyEntity> OnClosing;
| |
− | | |
− | event Action<IMyEntity> OnMarkForClose;
| |
− | | |
− | event Action<IMyEntity> OnPhysicsChanged;
| |
− | | |
− | event Action<IMyEntity> OnPositionChanged;
| |
− | | |
− | string GetFriendlyName();
| |
− | | |
− | void MarkForClose();
| |
− | | |
− | void Close();
| |
− | | |
− | IMyEntity GetTopMostParent(Type type = null);
| |
− | | |
− | Vector3 GetDiffuseColor();
| |
− | | |
− | float GetDistanceBetweenCameraAndBoundingSphere();
| |
− | | |
− | float GetDistanceBetweenCameraAndPosition();
| |
− | | |
− | float GetLargestDistanceBetweenCameraAndBoundingSphere();
| |
− | | |
− | float GetSmallestDistanceBetweenCameraAndBoundingSphere();
| |
− | | |
− | Vector3? GetIntersectionWithLineAndBoundingSphere(ref Line line, float boundingSphereRadiusMultiplier);
| |
− | | |
− | bool GetIntersectionWithSphere(ref BoundingSphere sphere);
| |
− | | |
− | void GetTrianglesIntersectingSphere(ref BoundingSphere sphere, Vector3? referenceNormalVector, float? maxAngle, List<MyTriangle_Vertex_Normals> retTriangles, int maxNeighbourTriangles);
| |
− | | |
− | bool DoOverlapSphereTest(float sphereRadius, Vector3 spherePos);
| |
− | | |
− | MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false);
| |
− | | |
− | bool IsSelectable();
| |
− | | |
− | bool IsSelectableAsChild();
| |
− | | |
− | bool IsSelectableParentOnly();
| |
− | | |
− | bool IsVisible();
| |
− | | |
− | Matrix GetViewMatrix();
| |
− | | |
− | Matrix GetWorldMatrixForDraw();
| |
− | | |
− | Matrix GetWorldMatrixNormalizedInv();
| |
− | | |
− | void SetLocalMatrix(Matrix localMatrix, object source = null);
| |
− | | |
− | void SetWorldMatrix(Matrix worldMatrix, object source = null);
| |
− | | |
− | Vector3 GetPosition();
| |
− | | |
− | void SetPosition(Vector3 pos);
| |
− | | |
− | void GetChildren(List<IMyEntity> children, Func<IMyEntity, bool> collect = null);
| |
− | }
| |
− | }
| |
− | | |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |