public void setDynamicSystem(DynamicSystem system) { mDynamicSystem = system; mViSpeed = mDynamicSystem.mSpeed; mPosition = mDynamicSystem.mPosition; }
//--------------------------------------------------------------------- public DynamicSystem clone() { DynamicSystem system = new DynamicSystem(mPosition, mSpeed); foreach (var it in mAcceleration) { system.mAcceleration.Add(it.Key, it.Value.clone()); } return system; }
//--------------------------------------------------------------------- public DynamicSystem clone() { DynamicSystem system = new DynamicSystem(mPosition, mSpeed); foreach (var it in mAcceleration) { system.mAcceleration.Add(it.Key, it.Value.clone()); } return(system); }
//--------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------- 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()); } }
//--------------------------------------------------------------------- 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()); } }
//------------------------------------------------------------------------- public void addDynamicSystem(DynamicSystem system) { mMassEntity.setDynamicSystem(system); }