Пример #1
0
        public void PrepareGrass(MTerrainTile tile)
        {
            MTerrainTile Tile         = tile;
            Matrix4d     TreeRotation = Matrix4d.CreateFromQuaternion(Quaterniond.FromEulerAngles(tile.transform.Up()));

            float numxinterps = LOD0Size / Tile.x_res;
            float numzinterps = LOD0Size / Tile.z_res;

            for (int x = 0; x < LOD0Size; x++)
            {
                for (int z = 0; z < LOD0Size; z++)
                {
                    Vector3d PlantingPos = new Vector3d((x / numxinterps), 0, (z / numzinterps));
                    //PlantingPos = Tile.GetInterpolatedPointOnSurfaceFromGrid2(PlantingPos);
                    //double y = tile.ElevationAtPoint(x / numxinterps, z / numzinterps);
                    //PlantingPos = new Vector3d(x, y, z);
                    PlantingPos = Tile.GetInterpolatedPointOnSurfaceFromGrid2(PlantingPos);
                    Matrix4d TreeScale    = Matrix4d.Scale(10, 10, 10);
                    Matrix4d TreePosition = Matrix4d.CreateTranslation(PlantingPos);
                    Matrix4  final        = MTransform.GetFloatMatrix(TreeScale * TreeRotation * TreePosition);
                    Grassmats[x, z] = final;
                }
            }

            IsComplete = true;
            Console.WriteLine("Grass Planted:" + Tile.TileX + "," + Tile.TileY);
        }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (!isObjectSpawned && GPSManager.Instance != null && GPSManager.Instance.ServiceStatus == LocationServiceStatus.Running)
        {
            var gpsPosition    = new Vector3d(GPSManager.Instance.position);
            var objectPosition = new Vector3d(Position);
            var gpsAlt         = 0;

            var heading = MathHelper.DegreesToRadians(GPSManager.Instance.heading);
            // Need to rotate the the the offset to align to the world coords

            var t = Quaterniond.FromEulerAngles(0, heading, 0);

            var obj = GameObject.CreatePrimitive(PrimitiveType.Cylinder);

            var gpsObj = obj.AddComponent <GPSTrackedObject>();
            gpsObj.GpsPosition = Position;
            gpsObj.GPSManager  = GPSManager.Instance;


            if (OutputText != null)
            {
                OutputText.text = "Object spawned";
            }

            isObjectSpawned = true;
        }
    }
Пример #3
0
        void RotateCameraAroundTarget(Point e)
        {
            Vector3d tp = Vector3d.Zero;

            if (MScene.Camera.Focus != null)
            {
                tp = MScene.Camera.Focus.transform.Position;
            }

            ///Globals.GlobalOffset

            double mult = GetMouseMult();
            double dy   = (DownPoint.Y - e.Y) * mult;
            double dx   = (DownPoint.X - e.X) * mult;

            Vector3d    op = MScene.Camera.transform.Position;
            Quaterniond q  = Quaterniond.FromEulerAngles(0, dx, 0);
            Vector3d    p  = RotateOffset(op - tp, -dx);

            double dist = 0;

            Vector3d.Distance(ref MScene.Camera.Focus.transform.Position, ref MScene.Camera.transform.Position, out dist);

            MScene.Camera.transform.Position = p + tp + new Vector3d(0, dist * -dy, 0);

            DownPoint = e;
        }
Пример #4
0
        public static void SetTimeOfDay(double time)
        {
            MAstroBody   Sol = MPlanetHandler.Get("Sol");
            Quaterniond  q   = Quaterniond.FromEulerAngles(0, 0, time * Math.PI / 180.0);
            MSceneObject mo  = (MSceneObject)MScene.AstroRoot.FindModuleByName("Sol");

            mo.SetPosition(new Vector3d(time * 10000000000, 0, 0));
        }
Пример #5
0
        Quaterniond Perp(Vector3d dir)
        {
            double      angle = Math.Atan2(dir.X, dir.Z); // Note: I expected atan2(z,x) but OP reported success with atan2(x,z) instead! Switch around if you see 90° off.
            Quaterniond q     = new Quaterniond(0, 1 * Math.Sin(angle / 2), 0, Math.Cos(angle / 2));

            q *= Quaterniond.FromEulerAngles(0, 0, 90 * Math.PI / 180.0);
            return(q);
        }
Пример #6
0
 public void InputYawH(double h)
 {
     if (_physics == null)
     {
         return;
     }
     _physics.SetActive(true);
     //_physics._rigidBody.ApplyTorque(_physics.GetRotation() * new Vector3d(0, h, 0));
     TargetRotation = _physics.GetRotation() * Quaterniond.FromEulerAngles(0, h, 0);
 }
Пример #7
0
        Vector3d GetQuantizedPoint(Vector3d p, Vector3d origin, double xrot, double yrot)
        {
            Vector3d delta = p - origin;
            Matrix4d rotx  = Matrix4d.CreateFromQuaternion(
                Quaterniond.FromEulerAngles(xrot * Math.PI / 180.0, yrot * Math.PI / 180.0, 0)
                );
            Matrix4d pos = Matrix4d.CreateTranslation(delta);

            Matrix4d result  = pos * rotx;
            Vector3d vresult = result.ExtractTranslation() + origin;

            return(vresult);
        }
Пример #8
0
        public void PlaceInstances(Vector3d Anchorpoint)
        {
            //DistanceThreshold = tile.DistanceThreshold;
            this.transform.Position = Anchorpoint;

            Random ran = new Random(1234);

            Matrix4d TreeRotation = Matrix4d.CreateFromQuaternion(Globals.LocalUpRotation());

            int i = 0;

            for (int z = 0; z < 30; z++)
            {
                for (int x = 0; x < 30; x++)
                {
                    if (i >= MaxInstances)
                    {
                        break;
                    }

                    //Vector3d pos = new Vector3d(1000 * ran.NextDouble(), 200 * ran.NextDouble(), 1000 * ran.NextDouble());
                    Vector3d pos = MassiveTools.RandomPointInSphere(Vector3d.Zero, 1000, ran);
                    //Vector3d PlantingPos = planet.GetNearestPointOnSphere(SeedPos + Treepos, 0) - SeedPos;
                    double   scale     = MinSize + ran.NextDouble() * (MaxSize - MinSize);
                    Matrix4d TreeScale = Matrix4d.Scale(scale, scale, scale);

                    Matrix4d TreePosition = Matrix4d.CreateTranslation(pos);
                    TreeRotation = Matrix4d.CreateFromQuaternion(
                        Quaterniond.FromEulerAngles(
                            ran.NextDouble(),
                            ran.NextDouble(),
                            ran.NextDouble()));
                    //find point at y with raycast
                    Matrix4 final = MTransform.GetFloatMatrix(TreeScale * TreeRotation * TreePosition);
                    mats[i] = final;
                    i++;
                }
            }

            TotalInstances = i;

            //null out the remainder
            for (int j = TotalInstances; j < MaxInstances; j++)
            {
                Matrix4 final = Matrix4.Identity;
                mats[j] = final;
            }

            Planted = false;
        }
Пример #9
0
        public static void SetTimeOfDay(double _time)
        {
            time = _time;
            MAstroBody   Sol = MPlanetHandler.Get("Sol");
            Quaterniond  q   = Quaterniond.FromEulerAngles(0, (15 * time) * Math.PI / 180.0, 0);
            MSceneObject mo  = (MSceneObject)MScene.AstroRoot.FindModuleByName("Sol");

            mo.SetPosition(q * new Vector3d(Sol.DistanceToAvatar, 0, 0));
            MMessageBus.Navigate(null, mo.transform.Position);

            double ottime = (time + timeOffset) % 24;

            float f24 = (float)Math.Sin((ottime * 15.0) * Math.PI / 180.0);

            //f24 = Math.Min((float)Math.Pow(f24, 0.2), 1);
            f24 = Math.Max(f24, 0.02f);
            MScene.light.Ambient = new Vector3(f24, f24, f24);
        }
Пример #10
0
        void RotateAvatarWalking(Point e)
        {
            //Vector3d tp = Vector3d.Zero;
            //tp = MScene.Camera.transform.Position;

            double mult = GetMouseMult();
            double dy   = (DownPoint.Y - e.Y) * mult;
            double dx   = (DownPoint.X - e.X) * mult;

            accx += dx;

            Vector3d op = MScene.Camera.Focus.transform.Position;

            //Quaterniond rota = Extensions.LookAt(Globals.Avatar.GetPosition(),
            //         Globals.Avatar.GetPosition() + Globals.LocalUpVector, Vector3d.UnitY);
            Quaterniond rota = Extensions.LookAt(MScene.Camera.transform.Position,
                                                 MScene.Camera.transform.Position + Globals.LocalUpVector, Vector3d.UnitY);

            if (double.IsNaN(rota.X))
            {
                //rota = Quaterniond.Identity;
                return;
            }

            Quaterniond rot = rota
                              * Quaterniond.FromEulerAngles(0, 0.8 * accx * (Math.PI / 180.0), 0);

            //Quaterniond rot2 =
            //Quaterniond.FromEulerAngles(0, dx, 0);
            Globals.Avatar.SetRotation(rot);
            Globals.Avatar.InputRollHDirect(accx * 100);
            double dist = Vector3d.Distance(MScene.Camera.transform.Position, MScene.Camera.transform.Position + MScene.Camera.TargetOffset);

            if (dist < 90)
            {
                MScene.Camera.TargetOffset += Globals.LocalUpVector * dy * 0.05;
            }
            else
            {
                MScene.Camera.TargetOffset *= 0.999;
            }

            DownPoint = e;
        }
Пример #11
0
        void TurnToHome()
        {
            //Matrix4d m = Matrix4d.LookAt(model.transform.Position, OriginalPosition, Globals.LocalUpVector);
            //Matrix4d m = Matrix4d.RotateY(model.transform.Position, OriginalPosition, Globals.LocalUpVector);
            //Quaterniond q = m.ExtractRotation();
            //Quaterniond q = Quaterniond.FromAxisAngle(model.transform.Up(), 0.1);

            // model.SetRotation(q);

            Vector3d delta = model.transform.Position - OriginalPosition;
            Vector3d d2    = model.transform.Position + model.transform.Forward();
            double   d     = Vector3d.Dot(delta.Normalized(), d2.Normalized());

            Quaterniond s = Quaterniond.Slerp(model.transform.Rotation,
                                              model.transform.Rotation * Quaterniond.FromEulerAngles(0, -d, 0),
                                              0.0150);

            model.SetRotation(s);
        }
Пример #12
0
    // Update is called once per frame
    void Update()
    {
        if (GPSManager.ServiceStatus == LocationServiceStatus.Running)
        {
            var gpsPosition    = new Vector3d(GPSManager.position);
            var objectPosition = new Vector3d(GpsPosition);
            var gpsAlt         = 0;

            var offset = (objectPosition - gpsPosition) * new Vector3d(degreesLatitudeInMeters, 1, GetLongitudeDegreeDistance(gpsPosition.X));

            var heading = MathHelper.DegreesToRadians(GPSManager.heading);
            // Need to rotate the the the offset to align to the world coords

            var t             = Quaterniond.FromEulerAngles(0, heading, 0);
            var rotatedOffset = t * offset;

            var floatPosition = new Vector3((float)rotatedOffset.X, (float)rotatedOffset.Y, (float)rotatedOffset.Z);
            transform.localPosition = floatPosition;
            transform.localScale    = new Vector3(1, 1, 1);
        }
    }
Пример #13
0
        void DoIdle()
        {
            accum += Time.DeltaTime * direction * speed;
            if (accum > 1)
            {
                direction = -direction;
                accum     = 1;
            }
            if (accum <= -1)
            {
                accum     = -1;
                direction = -direction;
            }
            MSceneObject msoParent = (MSceneObject)Parent;

            msoParent.SetRotation(OriginalRotation * Quaterniond.FromEulerAngles(0, accum, 0));

            if (Parent is MAnimatedModel)
            {
                MAnimatedModel m = (MAnimatedModel)Parent;
                m._animationController.PlayAnimation("idle", 1);
            }
        }
Пример #14
0
        void RotateSelection(double x, double y, double z)
        {
            if (SelectedItem == null)
            {
                return;
            }
            double mult = MKeyboardHandler.GetRotationMinifier();

            x = MathHelper.DegreesToRadians(x * mult);
            y = MathHelper.DegreesToRadians(y * mult);
            z = MathHelper.DegreesToRadians(z * mult);

            // complete any pending transitions
            MMoveSync ms = (MMoveSync)SelectedItem.FindModuleByType(MObject.EType.MoveSync);

            if (ms != null)
            {
                ms.Complete();
            }

            Quaterniond rot = SelectedItem.transform.Rotation * Quaterniond.FromEulerAngles(x, y, z);

            MMessageBus.MoveRequest(this, SelectedItem.InstanceID, SelectedItem.transform.Position, rot);
        }
Пример #15
0
        public static MSceneObject LoadTemplate(string TemplateID)
        {
            MBuildingBlock bb = MBuildParts.GetBlock(TemplateID);

            if (bb == null)
            {
                Console.WriteLine("WARNING: MSpawnHandler.LoadTemplate " + TemplateID + " not found in blocks");
                return(null);
            }

            MSceneObject o = null;

            if (bb.Type == MBuildParts.MAnimatedModel)
            {
                o = Helper.CreateAnimatedModel(MScene.TemplateRoot, TemplateID, bb.Model, Vector3d.Zero);
                MAnimatedModel man = (MAnimatedModel)o;
                man.BoneOffset = MassiveTools.VectorFromArray(bb.BoneOffset);
            }

            if (bb.Type == MBuildParts.MModel)
            {
                o = Helper.CreateModel(MScene.TemplateRoot, TemplateID, bb.Model, Vector3d.Zero);
            }

            MMaterial mat = (MMaterial)MScene.MaterialRoot.FindModuleByName(bb.MaterialID);

            if (mat == null)
            {
                Console.WriteLine("MSpawnHandler.LoadTemplate " + bb.MaterialID + " was null");
            }
            o.SetMaterial(mat);

            Vector3d size = MassiveTools.VectorFromArray(bb.Size);

            MPhysicsObject.EShape shape = GetShape(bb.PhysicsShape);
            if (shape != MPhysicsObject.EShape.NULL)
            {
                MPhysicsObject mpo = new MPhysicsObject(o, TemplateID + "_physics", bb.Weight, shape,
                                                        true, size);
                mpo.SetSleep(5);
                mpo.SetFriction(0.5);
                if (shape != MPhysicsObject.EShape.Sphere)
                {
                    mpo.SetAngularFactor(0.0, 0.0, 0.0);
                    mpo.SetDamping(0.5, 0.5);
                    mpo.SetRestitution(0.5);
                }
                else
                {
                    mpo.SetDamping(0.1, 0.1);
                    mpo.SetRestitution(0.8);
                }
            }

            o.TemplateID               = TemplateID;
            o.InstanceID               = TemplateID;
            o.IsTransparent            = bb.IsTransparent;
            o.transform.RotationOffset = Quaterniond.FromEulerAngles(MassiveTools.VectorFromArray(bb.RotationOffset));
            o.Setup();

            AddSubmodules(bb, o);

            return(o);
        }
Пример #16
0
        public void InitializePlanets()
        {
            //GravityIndicator = Helper.CreateCube(MScene.AstroRoot, "GravitySphere", Vector3d.Zero);
            //GravityIndicator.transform.Scale = new Vector3d(0.05, 0.1, 0.1);
            //GravityIndicator.OwnerID = "MasterAstronomer";
            //MScene.AstroRoot.Add(GravityIndicator);
            //GravityIndicator.SetMaterial((MMaterial)MScene.MaterialRoot.FindModuleByName(MMaterial.DEFAULT_MATERIAL));
            CreateShaders();

            for (int i = 0; i < Bodies.Count; i++)
            {
                MAstroBody m = Bodies[i];
                //m.Radius = m.Radius * 0.5;
                if (m.IsTemplate == true)
                {
                    continue;
                }
                m.ListIndex = i;
                Vector3d    pos  = m.Position + new Vector3d(-m.Radius.X, 0, 0) * (m.HasRings == true ? 3.0 : 1.1);
                MServerZone zone = new MServerZone("MASTER_ASTRONOMER", m.Name, "Astronomical",
                                                   MassiveTools.ToVector3_Server(pos));
                zone.Rotation    = MassiveTools.ArrayFromQuaterniond(Quaterniond.Identity);
                zone.Description = m.Description + " \nRadius:" + m.Radius;
                MMessageBus.AddZone(this, zone);
                //Extensions.LookAt(m.Position + m.Radius * 2, m.Position), m.Name));

                MSceneObject mo;
                //planet files contain uvs for mercator
                if (m.HasAtmosphere)
                {
                    CurrentNear = m;
                    mo          = Helper.CreateModel(MScene.AstroRoot, m.Name, @"Models\planets\earth.3ds", Vector3d.Zero);
                    //mo = Helper.CreateSphere(MScene.AstroRoot, 3, "Planet");
                    //mo.transform.Scale = m.Radius * 1.00055;
                    mo.transform.Scale = m.Radius;
                }
                else
                {
                    mo = Helper.CreateModel(MScene.AstroRoot, m.Name, @"Models\planets\planet_sphere2.3ds", Vector3d.Zero);
                    mo.transform.Scale = m.Radius;
                }

                if (m.HasRings)
                {
                    MModel ring = Helper.CreateModel(MScene.Priority2, m.Name + "_rings", @"Models\planets\planet_rings.3ds", Vector3d.Zero);
                    ring.transform.Position = m.Position;
                    ring.transform.Rotation = Quaterniond.FromEulerAngles(0, 0, 5 * Math.PI / 180);
                    ring.transform.Scale    = m.Radius;
                    ring.InstanceID         = m.Name;
                    ring.TemplateID         = m.Name;
                    ring.DistanceThreshold  = m.Radius.X * 12;
                    ring.OwnerID            = "MasterAstronomer";
                    MMaterial ringmat = new MMaterial(m.Name + "_mat");
                    ringmat.AddShader((MShader)MScene.MaterialRoot.FindModuleByName(MShader.DEFAULT_SHADER));
                    MTexture ringtex = Globals.TexturePool.GetTexture(@"Textures\Planets\saturn_rings.png");
                    ringmat.SetDiffuseTexture(ringtex);
                    ring.SetMaterial(ringmat);

                    MPhysicsObject ringpo = new MPhysicsObject(ring, "Physics", 0, MPhysicsObject.EShape.ConcaveMesh, false, m.Radius);
                    ringpo.SetLinearFactor(0, 0, 0);
                    ringpo.SetRestitution(0.5);
                }

                mo.transform.Position = m.Position;
                //mo.transform.Scale = m.Radius * 1.9999;

                mo.InstanceID        = m.Name;
                mo.TemplateID        = m.Name;
                mo.OwnerID           = "MasterAstronomer";
                mo.DistanceThreshold = m.Radius.X * 110002; //distance at which it becomes visible
                //MModel mod = (MModel)mo.FindModuleByType(EType.Model);
                //mod.DistanceThreshold = mo.DistanceThreshold;
                //MMesh met = (MMesh)mod.FindModuleByType(EType.Mesh);
                //if ( met != null ) {
                //met.DistanceThreshold = mo.DistanceThreshold;
                //}
                mo.Tag = m;
                m.Tag  = mo;

                //now that we have a 3d model, apply some progressive textures (will auto-switch with smooth transition in shader)
                MMaterial mat = new MMaterial(m.Name + "_mat");
                mat.AddShader((MShader)MScene.MaterialRoot.FindModuleByName(MShader.DEFAULT_SHADER));
                MTexture tex = Globals.TexturePool.GetTexture(m.TextureName);
                mat.SetDiffuseTexture(tex);
                mo.SetMaterial(mat);
                MTexture tex2 = Globals.TexturePool.GetTexture("Textures\\terrain\\sand01b.jpg");
                mat.SetMultiTexture(tex2);
                MTexture tex3 = Globals.TexturePool.GetTexture("Textures\\terrain\\water.jpg");
                mat.SetNormalMap(tex3);

                double dia = 2.0 * Math.PI * m.Radius.X * 0.0000001;
                //double dia = 1;
                mat.Tex2CoordScale = new Vector2((float)dia, (float)dia);
                mo.SetMaterial(mat);

                MScene.MaterialRoot.Add(mat);

                if (m.HasAtmosphere)
                {
                    if (Settings.DrawTerrains == true)
                    {
                        m.AddDynamicTerrain(); //adds tile based terrain (from e.g. tile service)
                    }

                    //MPhysicsObject po = new MPhysicsObject(mo, "Physics", 0, MPhysicsObject.EShape.ConcaveMesh,
                    //false, m.Radius);
                    MPhysicsObject po = new MPhysicsObject(mo, "Physics", 0, MPhysicsObject.EShape.Sphere,
                                                           false, m.Radius);
                    //po.SetLinearFactor(0, 0, 0);
                    //po.SetRestitution(0.5);
                    //MSphere moc = Helper.CreateSphere(MScene.AstroRoot, 3, m.Name+ "Clouds", Vector3d.Zero);

                    MModel moc = Helper.CreateModel(MScene.AstroRoot, m.Name + "_clouds", @"Models\planets\clouds.3ds", Vector3d.Zero);
                    moc.CastsShadow        = false;
                    moc.transform.Position = m.Position;
                    moc.transform.Scale    = m.Radius;
                    moc.DistanceThreshold  = m.Radius.X * 3;
                    //moc.transform.Scale = m.Radius*2.1;
                    moc.InstanceID = m.Name;
                    moc.TemplateID = m.Name;
                    moc.OwnerID    = "MasterAstronomer";
                    moc.Tag        = m;

                    MMaterial cmat = new MMaterial("CloudMat");
                    cmat.AddShader((MShader)MScene.MaterialRoot.FindModuleByName(MShader.DEFAULT_SHADER));
                    cmat.Opacity = 1;
                    cmat.IsSky   = 1;
                    // = new MTexture("CloudTex");
                    MTexture ctex = Globals.TexturePool.GetTexture(CloudTexURL);
                    ctex.Additive = false;
                    cmat.SetDiffuseTexture(ctex);
                    moc.SetMaterial(cmat);
                    MScene.MaterialRoot.Add(cmat);

                    MModel sky = Helper.CreateModel(MScene.AstroRoot, m.Name + "_sky", @"Models\sky.3ds", Vector3d.Zero);
                    sky.CastsShadow        = false;
                    sky.transform.Position = m.Position;
                    sky.transform.Scale    = m.Radius;
                    //moc.transform.Scale = m.Radius*2.1;
                    sky.InstanceID = m.Name;
                    sky.TemplateID = m.Name;
                    sky.OwnerID    = "MasterAstronomer";
                    sky.Tag        = m;
                    sky.SetMaterial(cmat);
                    sky.DistanceThreshold = m.Radius.X * 4;
                    MObjectAnimation ani = new MObjectAnimation();
                    ani.AngleOffset = Quaterniond.FromEulerAngles(0, 0.002, 0);
                    ani.Speed       = 1;
                    sky.Add(ani);

                    sky.SetMaterial(MSkyMaterial);

                    /*MMaterial csky = new MMaterial("Skymat");
                     * csky.AddShader((MShader)MScene.MaterialRoot.FindModuleByName(MShader.DEFAULT_SHADER));
                     * csky.Opacity = 0.5;
                     * csky.IsSky = 1;
                     * // = new MTexture("CloudTex");
                     * MTexture cSkyTex = Globals.TexturePool.GetTexture(OpaqueCloudTexURL);
                     * cSkyTex.Additive = false;
                     * csky.SetDiffuseTexture(cSkyTex);
                     * sky.SetMaterial(csky);
                     * MScene.MaterialRoot.Add(csky);
                     */



                    /* MSphere water = Helper.CreateSphere(MScene.ModelRoot, 5, "Water");
                     * water.transform.Position = m.Position;
                     * water.transform.Scale = m.Radius * 2.00;
                     * MMaterial waterman = new MMaterial("Watermat");
                     * MShader shader = new MShader("watershader");
                     * shader.Load("ocean_vs.glsl", "ocean_fs.glsl");
                     * shader.Bind();
                     * shader.SetInt("diffuseTexture", 0);
                     * shader.SetInt("shadowMap", 1);
                     * waterman.AddShader(shader);
                     * water.SetMaterial(waterman);
                     */
                    //water.SetMaterial((MMaterial)MScene.MaterialRoot.FindModuleByName(MMaterial.DEFAULT_MATERIAL));
                }
                else
                {
                    MPhysicsObject po = new MPhysicsObject(mo, "Physics", 0, MPhysicsObject.EShape.Sphere, false,
                                                           m.Radius * 0.999);
                    po.SetLinearFactor(0, 0, 0);
                    po.SetRestitution(0.5);
                }
                m.Setup();
                //Console.WriteLine("Created:" + mo.Name + ":" + (mo.transform.Position) + " R:" + m.Radius);
            }
        }