示例#1
0
        public void Init(int id, Vector2 position, Vector2 goal)
        {
            this.id = id;

            k             = 1.5f;
            ksi           = 0.91f;
            m             = 2.4f;
            t0            = 4.47f;
            neighborDist  = 11.6f;
            radius        = 0.25f;
            prefSpeed     = Random.Range(1.3f, 1.6f);
            this.position = position;
            this.goal     = goal;

            // Add to the database
            proximityToken = Engine.Instance.GetSpatialDatabase.AllocateToken(this);

            // Notify proximity database that our position has changed
            proximityToken.UpdateForNewPosition(ExtensionMethods.Vector2ToVector3(position));
        }
示例#2
0
 public void AddToDB()
 {
     // Add to the database
     proximityToken = Engine.Instance.GetSpatialDatabase.AllocateToken(this);
     UpdateDB();
 }