示例#1
0
        public override bool Equals(object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return(false);
            }

            // If parameter cannot be cast to Point return false.
            Object3D so = obj as Object3D;

            if ((System.Object)so == null)
            {
                return(false);
            }

            // Return true if the fields match:
            return(ID == so.ID);
        }
示例#2
0
文件: Map.cs 项目: NuCode1497/Netsky
        private void reFormMap()
        {
            defaultTile = new GreenTiles();
            defaultTile.LoadContent();
            defaultTile.parent    = this;
            defaultTile.dimension = dimension;

            tiles = new Object3D[length, width];
            for (int i = 0; i < length; i++)
            {
                for (int j = 0; j < width; j++)
                {
                    Object3D tile = defaultTile.Clone();
                    tile.position.X = (-length / 2 + i) * gridSpacing;
                    tile.position.Z = (-width / 2 + j) * gridSpacing;
                    tile.angle.Y    = MathHelper.ToRadians(Global.random.Next(0, 3) * 90);
                    tiles[i, j]     = tile;
                }
            }
        }
示例#3
0
 /// <summary>
 /// Constantly face an offset from the given object.
 /// with no roll.
 /// </summary>
 /// <param name="o">The object to face.</param>
 /// <param name="offset">The offset from the object.</param>
 public virtual void Track(Object3D o, Vector3 offset)
 {
     this.offset = offset;
     focus       = o;
     state       = STATE_TRACK_OBJ;
 }
示例#4
0
 /// <summary>
 /// Constantly face the given object with no roll.
 /// </summary>
 /// <param name="o">The object to face.</param>
 public virtual void Track(Object3D o)
 {
     offset = Vector3.Zero;
     focus  = o;
     state  = STATE_TRACK_OBJ;
 }
示例#5
0
 /// <summary>
 /// Face the absolute position of an object with an offset.
 /// </summary>
 /// <param name="o">The object to face.</param>
 /// <param name="offset">Face this absolute position from the object.</param>
 public virtual void Face(Object3D o, Vector3 offset)
 {
     this.offset = offset;
     focus       = o;
     state       = STATE_FACE_OBJ;
 }
示例#6
0
 /// <summary>
 /// Face the absolute position of an object.
 /// </summary>
 /// <param name="o">The object to face.</param>
 public virtual void Face(Object3D o)
 {
     offset = Vector3.Zero;
     focus  = o;
     state  = STATE_FACE_OBJ;
 }
示例#7
0
 public void AddTransparent(Object3D o)
 {
     o.dimension = this;
     Transparencies.Add(o);
 }
示例#8
0
 public void AddOverlay(Object3D o)
 {
     o.dimension = this;
     Overlays.Add(o);
 }
示例#9
0
 public override void Add(Object3D o)
 {
     o.dimension = this;
     base.Add(o);
 }
示例#10
0
 public void ControlFree(Object3D o)
 {
     controlObject = o;
     ControlMode   = ControlModes.Free;
 }