| 1302 | } |
| 1303 | |
| 1304 | void EnvObject::Update(float timestep) { |
| 1305 | Online* online = Online::Instance(); |
| 1306 | |
| 1307 | if (plant_component_.get()) { |
| 1308 | if (plant_component_->IsActive()) { |
| 1309 | plant_component_->Update(timestep); |
| 1310 | } else { |
| 1311 | if (scenegraph_ && update_list_entry != -1) { |
| 1312 | scenegraph_->UnlinkUpdateObject(this, update_list_entry); |
| 1313 | update_list_entry = -1; |
| 1314 | } |
| 1315 | } |
| 1316 | } |
| 1317 | |
| 1318 | if (online->IsClient()) { |
| 1319 | list<OnlineMessageRef>& frames = incoming_online_env_update; |
| 1320 | if (frames.size() > 0) { |
| 1321 | EnvObjectUpdate* eou = static_cast<EnvObjectUpdate*>(frames.begin()->GetData()); |
| 1322 | if (eou != nullptr) { |
| 1323 | SetTransformationMatrix(eou->transform); |
| 1324 | } |
| 1325 | frames.pop_front(); |
| 1326 | } |
| 1327 | } |
| 1328 | } |
| 1329 | |
| 1330 | void EnvObject::UpdateBoundingSphere() { |
| 1331 | vec3 radius_vec = box_.dims * 0.5f; |