示例#1
0
        public virtual void Init(World world)
        {
            World   = world;
            this.ID = world.GenerateObjectID();

            world.Actors.Add(this);
            World.BodyAdd(this);

            this.OriginalPosition = this.Position;
            this.OriginalAngle    = this.Angle;
            this.DefinitionTime   = world.Time;
            this.Project(world.Time);

            this.Exists = true;
        }
示例#2
0
        public WorldBody(World world)
        {
            this.World = world;
            if (world.InStep)
            {
                throw new Exception("Tried to create WorldBody while processing step");
            }

            this.BodyHandle.Value = -1;

            this.ID   = World.GenerateObjectID();
            this.Mass = 100;
            this.Size = 100;

            this.DefinePhysicsObject(this.Size, this.Mass);
            this.WriteSimulation();

            World.BodyAdd(this);
            World.Actors.Add(this);
            this.Exists = true;
        }