Exemplo n.º 1
0
        private void DebugDrawPlaceList(IDebug debug)
        {
            debug.Println("MAP SELECTION");
            debug.Println("");

            foreach (var place in _places.Skip(_debugPlaceCursor))
            {
                debug.Print($"{(place.Index == _debugPlaceCursor ? '>' : ' ')} ");
                debug.Print($"{Constants.WorldIds[place.WorldId]}{place.PlaceId:D02} ");
                debug.Println(place.MessageId);
            }
        }
        public void VirtualStep(double dt, double domain, object UID, out List <vector> result, ref bool running, IDebug dbg)          // returns future positions of an object
        {
            running = true;
            foreach (IPhysicsObject a in PhysObjects)
            {
                dbg.Print(a.GetHashCode());
            }
            OrbitalPhysics VirtualCopy = (OrbitalPhysics)this.Clone();

            foreach (IPhysicsObject a in VirtualCopy.PhysObjects)
            {
                dbg.Print(a.GetHashCode());
            }
            List <vector> resultCopy = new List <vector>();

            for (double i = 0; i < domain; i += dt)
            {
                foreach (IPhysicsObject a in VirtualCopy.PhysObjects)
                {
                    foreach (IPhysicsObject b in VirtualCopy.PhysObjects)
                    {
                        if (a != b)
                        {
                            a.Velocity += Gravity(a, b) * dt;
                        }
                    }
                    a.Velocity += a.Acceleration * dt;
                }
                foreach (IPhysicsObject a in VirtualCopy.PhysObjects)
                {
                    a.Position += a.Velocity * dt;
                    if (a.UniqueID.Equals(UID))
                    {
                        resultCopy.Add(a.Position);
                    }
                }
                if (domain - i < dt)
                {
                    dt = (domain - i);
                }
            }
            result  = resultCopy;
            running = false;
        }
Exemplo n.º 3
0
        private void DebugDrawObjentryList(IDebug debug)
        {
            debug.Println("OBJENTRY SELECTION");
            debug.Println("");

            var index = 0;

            foreach (var entry in _kernel.ObjEntries)
            {
                if (index >= _debugObjentryCursor)
                {
                    debug.Print($"{(index == _debugObjentryCursor ? '>' : ' ')} ");
                    debug.Print($"{entry.ObjectId:X04} ");
                    debug.Println(entry.ModelName.Replace('_', '-'));
                }

                index++;
            }
        }