예제 #1
0
        /// <summary>
        /// Sends an <see cref="ARViewUpdate"/> with the current position
        /// and rotation.
        /// </summary>
        public void Update()
        {
            Vector3      position = this.transform.position;
            ARViewUpdate update   = new ARViewUpdate(this.PlayerId, position, this.transform.eulerAngles);

            this.SendMessageUpwards("OnFollowPlayerInfo", update);
        }
예제 #2
0
        /// <summary>
        /// Sends an <see cref="ARViewUpdate"/> with the current position
        /// and rotation.
        /// </summary>
        public void Update()
        {
            LevelManager manager = this.transform.parent.GetComponent <LevelManager>();

            transform.position = new Vector3(manager.BoardSize.x / 2, 30, manager.BoardSize.y / 2);

            Vector3      position = this.transform.position;
            ARViewUpdate update   = new ARViewUpdate(FakeOverviewPlayerId, position, this.transform.eulerAngles);

            this.SendMessageUpwards("OnFollowPlayerInfo", update);
        }
예제 #3
0
        /// <summary>
        /// Places the given <see cref="RemotePlayerMarker"/> at the position and
        /// rotation indicated by the <see cref="ARViewUpdate"/>.
        /// </summary>
        /// <param name="head">The <see cref="RemotePlayerMarker"/>.</param>
        /// <param name="playerInfo">The <see cref="ARViewUpdate"/>.</param>
        public void PlacePlayerHead(RemotePlayerMarker head, ARViewUpdate playerInfo)
        {
            Assert.IsNotNull(head);
            Assert.IsNotNull(playerInfo);
            int markerId = playerInfo.Id + PlayerIdOffset;

            Vector3 position = playerInfo.Position;

            //Quaternion direction = Quaternion.Euler(playerInfo.Rotation);
            Quaternion direction = Quaternion.LookRotation(playerInfo.Rotation - position);

            if (this.trackingIndex == -1)
            {
                this.NextTracking();
            }

            this.GetPlayer(playerInfo.Id).RemotePosition =
                new MarkerPosition(position, direction, DateTime.Now, Vector3.one, markerId);

            //Debug.LogWarning("LOCAL " + position);
        }
예제 #4
0
 /// <summary>
 /// Updates the position of a player as indicated by the argument
 /// <see cref="ARViewUpdate"/>.
 /// </summary>
 /// <param name="update">The <see cref="ARViewUpdate"/>.</param>
 public void OnFollowPlayerInfo(ARViewUpdate update)
 {
     this.PlacePlayerHead(this.GetPlayer(update.Id), update);
 }