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

Method SetPhysicsTransform

Source/Objects/itemobject.cpp:793–811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

791}
792
793void ItemObject::SetPhysicsTransform(const mat4& transform) {
794 using_physics_ = false;
795 if (bullet_object_) {
796 vec3 new_pos = transform.GetTranslationPart() +
797 transform.GetRotatedvec3(phys_offset_);
798 bullet_object_->SetRotationAndVel(transform, interp_period_);
799 bullet_object_->SetPositionAndVel(new_pos, interp_period_);
800 bullet_object_->SetRotation(transform);
801 bullet_object_->SetPosition(new_pos);
802 bullet_object_->Sleep();
803 bullet_object_->UpdateTransform();
804 scenegraph_->bullet_world_->UnlinkObject(bullet_object_);
805 if (stuck_in_environment_) {
806 scenegraph_->bullet_world_->LinkObject(bullet_object_);
807 }
808 stuck_in_environment_ = false;
809 sticking_collision_occured_ = false;
810 }
811}
812
813void ItemObject::SetVelocities(const vec3& linear_vel, const vec3& angular_vel) {
814 if (bullet_object_) {

Callers 4

UpdateAttachedItemFunction · 0.45
UpdateStuckItemFunction · 0.45
StickItemMethod · 0.45

Calls 10

GetTranslationPartMethod · 0.80
GetRotatedvec3Method · 0.80
SetRotationAndVelMethod · 0.80
SetPositionAndVelMethod · 0.80
SleepMethod · 0.80
SetRotationMethod · 0.45
SetPositionMethod · 0.45
UpdateTransformMethod · 0.45
UnlinkObjectMethod · 0.45
LinkObjectMethod · 0.45

Tested by

no test coverage detected