void model::on_zone_created( size_t id ) { if (phys_->zone_name(id) == settings_.icao_code) { create_phys(); } }
model::model( kernel::object_create_t const& oc, dict_copt dict ) : view (oc, dict) , phys_object_model_base(collection_) , nodes_manager_ (find_first_child<nodes_management::manager_ptr>(this)) { create_phys(); }
engine( const engine_state &state ): huge_data_(hd_size, 1), world_(b2Vec2(0.0f, -10.0f)) { grey = std::min( 1.0f, std::max( 0.0f, state.grey )); create_phys(); test_assets(); }
model::model( kernel::object_create_t const& oc, dict_copt dict ) : view (oc, dict) , phys_object_model_base(collection_) , sys_(dynamic_cast<model_system *>(oc.sys)) //, nodes_manager_ (find_first_child<nodes_management::manager_ptr>(this)) , _speed (10.0 ) , _soar (true ) , _landing (false) , _flatFlyDown (true ) , _stuckCounter (0.0 ) , _landingSpotted (false) { settings_._avoidValue = rnd_.random_range(.2, .4/*.3, .1*/); create_phys(); start_ = boost::bind(&model::wander, this, 0.0f ); }
void model::update(double time) { view::update(time); create_phys(); double dt = time - (last_update_ ? *last_update_ : 0); if (!cg::eq_zero(dt)) { update_model(time, dt); sync_phys(dt); sync_nodes_manager(dt); update_contact_effects(time); } last_update_ = time; }
engine() : grey(0), hue_(0.0), huge_data_(hd_size, 1), world_(b2Vec2(0.0f, -10.0f)) { create_phys(); test_assets(); }