fix(physics): forgot to track joints

This commit is contained in:
maelstrom 2025-08-27 22:19:36 +02:00
parent 497cbc51e0
commit dac8d0f4bd
5 changed files with 3 additions and 4 deletions

View file

@ -48,6 +48,9 @@ void JointInstance::Update() {
// Finally, build the joint
buildJoint();
part0.lock()->trackJoint(shared<JointInstance>());
part1.lock()->trackJoint(shared<JointInstance>());
}
nullable std::shared_ptr<Workspace> JointInstance::workspaceOfPart(std::shared_ptr<BasePart> part) {

View file

@ -18,7 +18,6 @@ void Rotate::buildJoint() {
// used to be rather than specifying an anchor rotation, so whatever.
CFrame newFrame = part0.lock()->cframe * (c0 * c1.Inverse());
part1.lock()->cframe = newFrame;
part1.lock()->UpdateProperty("CFrame");
// Do NOT use Abs() in this scenario. For some reason that breaks it
PhysJointHingeInfo jointInfo((part0.lock()->cframe * c0).Position(), -(part0.lock()->cframe * c0).LookVector().Unit());

View file

@ -20,7 +20,6 @@ void RotateV::buildJoint() {
// used to be rather than specifying an anchor rotation, so whatever.
CFrame newFrame = part0.lock()->cframe * (c0 * c1.Inverse());
part1.lock()->cframe = newFrame;
part1.lock()->UpdateProperty("CFrame");
// Do NOT use Abs() in this scenario. For some reason that breaks it
PhysJointMotorInfo jointInfo((part0.lock()->cframe * c0).Position(), -(part0.lock()->cframe * c0).LookVector().Unit());

View file

@ -22,7 +22,6 @@ void Snap::buildJoint() {
// used to be rather than specifying an anchor rotation, so whatever.
CFrame newFrame = part0.lock()->cframe * (c0 * c1.Inverse());
part1.lock()->cframe = newFrame;
part1.lock()->UpdateProperty("CFrame");
PhysJointSnapInfo jointInfo((c0.Inverse() * c1).Position());
this->joint = workspace->CreateJoint(jointInfo, part0.lock(), part1.lock());

View file

@ -22,7 +22,6 @@ void Weld::buildJoint() {
// used to be rather than specifying an anchor rotation, so whatever.
CFrame newFrame = part0.lock()->cframe * (c0 * c1.Inverse());
part1.lock()->cframe = newFrame;
part1.lock()->UpdateProperty("CFrame");
PhysJointWeldInfo jointInfo((c0.Inverse() * c1).Position());
this->joint = workspace->CreateJoint(jointInfo, part0.lock(), part1.lock());