Exemplo n.º 1
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());
            }
        }
Exemplo n.º 2
0
 //---------------------------------------------------------------------
 EbVector3 getSpeed(RouteObject.Velocity velocity)
 {
     EbVector3 speed = CLogicUtility.getDirection(velocity.direction);
     return speed * velocity.speed;
 }