MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Moved

Method Moved

Source/Objects/itemobject.cpp:331–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331void 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
350void ItemObject::Reset() {
351 Moved(Object::kAll);

Callers

nothing calls this directly

Calls 11

GetTranslationFunction · 0.85
GetRotationFunction · 0.85
Mat4FromQuaternionFunction · 0.85
vec4Class · 0.50
vec3Class · 0.50
SetTransformMethod · 0.45
SetLinearVelocityMethod · 0.45
SetAngularVelocityMethod · 0.45
UpdateTransformMethod · 0.45
ActivateMethod · 0.45
LinkObjectMethod · 0.45

Tested by

no test coverage detected