Ejemplo n.º 1
0
 public static IEnumerable <IStellarEntity> CreateAsteroidBelt(
     Random random,
     AsteroidOrbit orbiterParams)
 {
     return((IEnumerable <IStellarEntity>) new IStellarEntity[1]
     {
         (IStellarEntity) new StellarEntity()
         {
             Params = (Kerberos.Sots.Data.StarMapFramework.Orbit)orbiterParams
         }
     });
 }
Ejemplo n.º 2
0
    public static GameObject CreateRepresentation(Asteroid asteroid, Material mat)
    {
        GameObject go = Orbit.CreateOrbitObject(Vector3.zero, asteroid.AphelionDistance, asteroid.SemiMajorAxis, asteroid.ArgOfPerihelion, asteroid.AscNodeLongitude, asteroid.Eccentricity, mat);

        GameObject parentObj    = new GameObject("asteroid " + asteroid.FullName);
        GameObject asteroidMesh = GameObject.CreatePrimitive(PrimitiveType.Sphere);

        asteroidMesh.transform.localScale = new Vector3(0.0001f, 0.0001f, 0.0001f) * asteroid.Diameter;;
        GameObject asteroidObject = new GameObject("Asteroid orbit");

        asteroidMesh.transform.parent = asteroidObject.transform;
        AsteroidOrbit orbit = asteroidObject.AddComponent <AsteroidOrbit>();

        orbit.AsteroidYo = asteroid;

        go.transform.parent             = parentObj.transform;
        asteroidObject.transform.parent = parentObj.transform;
        return(parentObj);
    }