summaryrefslogtreecommitdiff
path: root/src/KingSystem/ActorSystem/actPhysicsConstraints.cpp
blob: 7356a9765019f961a48d914ab140d2c260acbe48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "KingSystem/ActorSystem/actPhysicsConstraints.h"
#include "KingSystem/Physics/Constraint/physConstraint.h"

namespace ksys::act {

PhysicsConstraints::PhysicsConstraints() = default;

PhysicsConstraints::~PhysicsConstraints() {
    finalize();
}

void PhysicsConstraints::finalize() {
    for (auto*& cs : mConstraints) {
        if (cs) {
            phys::Constraint::destroy(cs);
            cs = nullptr;
        }
    }
    mConstraints.freeBuffer();
    _10 = false;
    _11 = false;
}

}  // namespace ksys::act