Exemple #1
0
        public void setDynamicSystem(DynamicSystem system)
        {
            mDynamicSystem = system;

            mViSpeed = mDynamicSystem.mSpeed;
            mPosition = mDynamicSystem.mPosition;
        }
Exemple #2
0
        public void setDynamicSystem(DynamicSystem system)
        {
            mDynamicSystem = system;

            mViSpeed  = mDynamicSystem.mSpeed;
            mPosition = mDynamicSystem.mPosition;
        }
Exemple #3
0
 //---------------------------------------------------------------------
 public DynamicSystem clone()
 {
     DynamicSystem system = new DynamicSystem(mPosition, mSpeed);
     foreach (var it in mAcceleration)
     {
         system.mAcceleration.Add(it.Key, it.Value.clone());
     }
     return system;
 }
Exemple #4
0
        //---------------------------------------------------------------------
        public DynamicSystem clone()
        {
            DynamicSystem system = new DynamicSystem(mPosition, mSpeed);

            foreach (var it in mAcceleration)
            {
                system.mAcceleration.Add(it.Key, it.Value.clone());
            }
            return(system);
        }
Exemple #5
0
        //---------------------------------------------------------------------
        public DynamicSystem getDynamicSystem(int id, float delay_time)
        {
            string key = id.ToString();

            if (mRouteDic.ContainsKey(key))
            {
                DynamicSystem system = mRouteDic[key].clone();
                system.setDelayTime(delay_time);
                return(system);
            }

            return(null);
        }
Exemple #6
0
        //---------------------------------------------------------------------
        BaseEntity newBaseEntity(int fish_vib_id, int route_vib_id, float delay_time)
        {
            BaseEntity    entity = buildEntity(fish_vib_id);
            DynamicSystem system = getDynamicSystem(route_vib_id, delay_time);

            if (system == null)
            {
                entity.addRoute(RouteHelper.buildLineRoute(route_vib_id, delay_time));
            }
            else
            {
                entity.addDynamicSystem(system);
            }

            return(entity);
        }
Exemple #7
0
        //---------------------------------------------------------------------
        void parseJson(RouteJsonPacket json)
        {
            try
            {
                RouteObject   route_object = BaseJsonSerializer.deserialize <RouteObject>(json.JsonString);
                DynamicSystem system       = new DynamicSystem(new EbVector3(route_object.initPos.x, route_object.initPos.y, 0), getSpeed(route_object.initVelocity));
                foreach (var it in route_object.accs)
                {
                    system.add(it.start_time, getSpeed(it.acc), it.duration);
                }

                mRouteDic.Add(json.FileName, system);
            }
            catch (Exception e)
            {
                EbLog.Note(e.ToString());
            }
        }
Exemple #8
0
        //---------------------------------------------------------------------
        void parseJson(RouteJsonPacket json)
        {
            try
            {
                RouteObject route_object = BaseJsonSerializer.deserialize<RouteObject>(json.JsonString);
                DynamicSystem system = new DynamicSystem(new EbVector3(route_object.initPos.x, route_object.initPos.y, 0), getSpeed(route_object.initVelocity));
                foreach (var it in route_object.accs)
                {
                    system.add(it.start_time, getSpeed(it.acc), it.duration);
                }

                mRouteDic.Add(json.FileName, system);
            }
            catch (Exception e)
            {
                EbLog.Note(e.ToString());
            }
        }
Exemple #9
0
 //-------------------------------------------------------------------------
 public void addDynamicSystem(DynamicSystem system)
 {
     mMassEntity.setDynamicSystem(system);
 }
Exemple #10
0
 //-------------------------------------------------------------------------
 public void addDynamicSystem(DynamicSystem system)
 {
     mMassEntity.setDynamicSystem(system);
 }