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

Method SetDamping

Source/Objects/riggedobject.cpp:2543–2559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2541}
2542
2543void RiggedObject::SetDamping(float amount) {
2544 for (auto& physics_bone : skeleton_.physics_bones) {
2545 BulletObject* b_object = physics_bone.bullet_object;
2546 if (!b_object) {
2547 continue;
2548 }
2549 b_object->SetDamping(amount);
2550 if (amount >= 1.0f) {
2551 b_object->Sleep();
2552 }
2553 }
2554 if (amount >= 1.0f) {
2555 for (auto& item : stuck_items.items) {
2556 item.item->SleepPhysics();
2557 }
2558 }
2559}
2560
2561void RiggedObject::UnRagdoll() {
2562 // mat4 inv_transform = invert(GetTransformationMatrix());

Callers 1

SetAngularVelocityMethod · 0.45

Calls 2

SleepMethod · 0.80
SleepPhysicsMethod · 0.80

Tested by

no test coverage detected