예제 #1
0
 public void BuildWorld()
 {
     if (TheSun != null)
     {
         TheSun.Destroy();
         MainWorldView.Lights.Remove(TheSun);
         ThePlanet.Destroy();
         MainWorldView.Lights.Remove(ThePlanet);
         TheSunClouds.Destroy();
         MainWorldView.Lights.Remove(TheSunClouds);
     }
     // TODO: DESTROY OLD REGION!
     // TODO: Radius -> max view rad * 2
     // TODO: Size -> max view rad * 2 + 30 * 2
     TheSun = new SkyLight(Location.Zero, Chunk.CHUNK_SIZE * 30, SunLightDef, new Location(0, 0, -1), Chunk.CHUNK_SIZE * 35, false);
     MainWorldView.Lights.Add(TheSun);
     // TODO: Separate cloud quality CVar?
     TheSunClouds = new SkyLight(Location.Zero, Chunk.CHUNK_SIZE * 30, CloudSunLightDef, new Location(0, 0, -1), Chunk.CHUNK_SIZE * 35, true);
     MainWorldView.Lights.Add(TheSunClouds);
     // TODO: Separate planet quality CVar?
     ThePlanet = new SkyLight(Location.Zero, Chunk.CHUNK_SIZE * 30, PlanetLightDef, new Location(0, 0, -1), Chunk.CHUNK_SIZE * 35, false);
     MainWorldView.Lights.Add(ThePlanet);
     TheRegion = new Region();
     TheRegion.TheClient = this;
     TheRegion.BuildWorld();
     Player = new PlayerEntity(TheRegion);
     TheRegion.SpawnEntity(Player);
     onCloudShadowChanged(null, null);
 }
예제 #2
0
 // TODO: Character!
 public void TurnIntoPlane(PlayerEntity pilot)
 {
     PlanePilot = pilot;
     Plane = new PlaneMotionConstraint(this);
     TheRegion.PhysicsWorld.Add(Plane);
     foreach (InternalBaseJoint joint in Joints) // TODO: Just track this detail on the joint itself ffs
     {
         if (joint is JointFlyingDisc)
         {
             ((FlyingDiscConstraint)((JointFlyingDisc)joint).CurrentJoint).IsAPlane = true;
         }
     }
 }
예제 #3
0
 // TODO: Character!
 public void TurnIntoHelicopter(PlayerEntity pilot)
 {
     HeloPilot = pilot;
     Helo = new HelicopterMotionConstraint(this);
     TheRegion.PhysicsWorld.Add(Helo);
 }