Beispiel #1
0
		/// <summary>
		/// creates from a local position
		/// </summary>
		public static RelativeVector3F createFromLocal(Vector3 grid, IMyCubeGrid cubeGrid)
		{
			RelativeVector3F result = new RelativeVector3F();
			result.value__grid = grid;
			result.cubeGrid = cubeGrid;
			return result;
		}
Beispiel #2
0
		/// <summary>
		/// create from a relative world vector (current position - G.P.S.)
		/// </summary>
		public static RelativeVector3F createFromWorld(Vector3 world, IMyCubeGrid cubeGrid)
		{
			RelativeVector3F result = new RelativeVector3F();
			result.value__world = world;
			result.cubeGrid = cubeGrid;
			return result;
		}
Beispiel #3
0
		/// <summary>
		/// create from a vector relative to a block (including block orientation)
		/// <para>Use to create a position vector from a block.</para>
		/// </summary>
		/// <param name="IsPosition">If true, the resultant RelativeVector3F represents a position. If false, it represents a direction</param>
		public static RelativeVector3F createFromBlock(Vector3 fromBlock, IMyCubeBlock block)
		{
			RelativeVector3F result = new RelativeVector3F();
			result.value__block = fromBlock;
			result.cubeGrid = block.CubeGrid;
			result.cubeBlock = block;
			return result;
		}
Beispiel #4
0
        /// <summary>
        /// creates from a local position
        /// </summary>
        public static RelativeVector3F createFromLocal(Vector3 grid, IMyCubeGrid cubeGrid)
        {
            RelativeVector3F result = new RelativeVector3F();

            result.value__grid = grid;
            result.cubeGrid    = cubeGrid;
            return(result);
        }
Beispiel #5
0
        /// <summary>
        /// create from a relative world vector (current position - G.P.S.)
        /// </summary>
        public static RelativeVector3F createFromWorld(Vector3 world, IMyCubeGrid cubeGrid)
        {
            RelativeVector3F result = new RelativeVector3F();

            result.value__world = world;
            result.cubeGrid     = cubeGrid;
            return(result);
        }
Beispiel #6
0
        /// <summary>
        /// create from a vector relative to a block (including block orientation)
        /// </summary>
        public static RelativeVector3F createFromBlock(Vector3 fromBlock, IMyCubeBlock block)
        {
            RelativeVector3F result = new RelativeVector3F();

            result.value__block = fromBlock;
            result.cubeGrid     = block.CubeGrid;
            result.cubeBlock    = block;
            return(result);
        }
Beispiel #7
0
 public static Vector3D GetCentre(this IMyCubeGrid grid)
 {
     return(RelativeVector3F.createFromLocal(grid.LocalAABB.Center, grid).getWorldAbsolute());
 }