@onerjs/core 8.46.8 → 8.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2172,11 +2172,17 @@ export class HavokPlugin {
|
|
|
2172
2172
|
* the Havok constraint, when it is no longer needed. This is important for avoiding memory leaks.
|
|
2173
2173
|
*/
|
|
2174
2174
|
disposeConstraint(constraint) {
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2175
|
+
if (constraint._pluginData) {
|
|
2176
|
+
for (const jointId of constraint._pluginData) {
|
|
2177
|
+
if (this._constraintToBodyIdPair.has(jointId)) {
|
|
2178
|
+
this._constraintToBodyIdPair.delete(jointId);
|
|
2179
|
+
}
|
|
2180
|
+
this._hknp.HP_Constraint_SetEnabled(jointId, false);
|
|
2181
|
+
this._hknp.HP_Constraint_Release(jointId);
|
|
2182
|
+
}
|
|
2183
|
+
constraint._pluginData.length = 0;
|
|
2178
2184
|
}
|
|
2179
|
-
constraint.
|
|
2185
|
+
constraint._initOptions = void 0;
|
|
2180
2186
|
}
|
|
2181
2187
|
_populateHitData(hitData, result) {
|
|
2182
2188
|
const hitBody = this._bodies.get(hitData[0][0]);
|