| 329 | } |
| 330 | |
| 331 | void ItemObject::Moved(Object::MoveType type) { |
| 332 | Object::Moved(type); |
| 333 | if (bullet_object_) { |
| 334 | vec3 new_pos = GetTranslation() + |
| 335 | GetRotation() * display_phys_offset_; |
| 336 | bullet_object_->SetTransform(new_pos, Mat4FromQuaternion(GetRotation()), vec4(1.0f)); |
| 337 | bullet_object_->SetLinearVelocity(vec3(0.0f)); |
| 338 | bullet_object_->SetAngularVelocity(vec3(0.0f)); |
| 339 | bullet_object_->UpdateTransform(); |
| 340 | bullet_object_->Activate(); |
| 341 | thrown_ = kThrown; |
| 342 | if (stuck_in_environment_) { |
| 343 | scenegraph_->bullet_world_->LinkObject(bullet_object_); |
| 344 | } |
| 345 | stuck_in_environment_ = false; |
| 346 | sticking_collision_occured_ = false; |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | void ItemObject::Reset() { |
| 351 | Moved(Object::kAll); |
nothing calls this directly
no test coverage detected