Пример #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
        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;
 }