This commit is contained in:
watrabi
2025-10-28 14:05:46 -04:00
parent 977f1ff4b8
commit c93494f795
452 changed files with 47860 additions and 152 deletions
+48
View File
@@ -0,0 +1,48 @@
/* Copyright 2003-2006 ROBLOX Corporation, All Rights Reserved */
#pragma once
#include "Util/G3DCore.h"
#include "Util/Memory.h"
namespace RBX {
class Body;
class Cofm : public Allocator<Cofm>
{
private:
Body* body;
bool dirty;
Vector3 cofmInBody;
float mass;
Matrix3 moment;
void updateIfDirty(); // true if was dirty
public:
Cofm(Body* body);
bool getIsDirty() const {return dirty;}
void makeDirty() {
dirty = true;
}
const Vector3& getCofmInBody() {
updateIfDirty();
return cofmInBody;
}
float getMass() {
updateIfDirty();
return mass;
}
const Matrix3& getMoment() {
updateIfDirty();
return moment;
}
};
} // namespace