Ejemplo n.º 1
0
		public void Possess( int ObjectInstanceID ) {
			Object o = physicalObjectInstances[ObjectInstanceID];
			CurrentAvatar = o as PhysicalObjectInstance;
			if ( cameraMode == EnumCameraMode.FirstPerson ) {
				CurrentAvatar.model.Hide();
			} else {
				CurrentAvatar.model.Show();
			}
			RepositionCamera();
		}
Ejemplo n.º 2
0
		public void Add( PhysicalObject po ) {
			if ( po is Terrain ) {
				Terrain t = (Terrain)po;
				terrainPieces.Add( new TerrainPiece(
					t.ObjectInstanceID, t.Position.X, t.Position.Z, t.Position.Y, t.ModelID ) );
			} else {
				PhysicalObjectInstance poi = new PhysicalObjectInstance( po );
				physicalObjectInstances.Add( po.ObjectInstanceID, poi );
				scene.Models.Add( po.ObjectInstanceID, poi.model );
				poi.model.Position = po.Position;
				poi.model.Rotation = po.Rotation;
			}
		}
Ejemplo n.º 3
0
        public void PlayerMovement(Vector3D oldPosition, Vector3D velocity, Vector3D newRotation)
        {
            PhysicalObjectInstance poi = Game.CurrentWorld.CurrentAvatar;

            poi.Move(oldPosition, velocity, newRotation);
            //Log.LogMessage( "Now at ("+poi.model.Position.X+", "+poi.model.Position.Y+", "+poi.model.Position.Z+")" );
            if (poi.NeedsUpdate(Game.now))
            {
                _connection.Position(
                    poi.model.Position,
                    poi.model.Rotation);
                poi.SentUpdate(Game.now);
            }
        }
Ejemplo n.º 4
0
        public void Possess(int ObjectInstanceID)
        {
            Object o = physicalObjectInstances[ObjectInstanceID];

            CurrentAvatar = o as PhysicalObjectInstance;
            if (cameraMode == EnumCameraMode.FirstPerson)
            {
                CurrentAvatar.model.Hide();
            }
            else
            {
                CurrentAvatar.model.Show();
            }
            RepositionCamera();
        }
Ejemplo n.º 5
0
 public void Add(PhysicalObject po)
 {
     if (po is Terrain)
     {
         Terrain t = (Terrain)po;
         terrainPieces.Add(new TerrainPiece(
                               t.ObjectInstanceID, t.Position.X, t.Position.Z, t.Position.Y, t.ModelID));
     }
     else
     {
         PhysicalObjectInstance poi = new PhysicalObjectInstance(po);
         physicalObjectInstances.Add(po.ObjectInstanceID, poi);
         scene.Models.Add(po.ObjectInstanceID, poi.model);
         poi.model.Position = po.Position;
         poi.model.Rotation = po.Rotation;
     }
 }