@react-three/rapier 0.7.3 → 0.7.4
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.
@@ -780,12 +780,22 @@ const setColliderOptions = (collider, options, states) => {
|
|
780
780
|
|
781
781
|
_matrix4.copy(state.object.matrixWorld).premultiply(state.worldParent.matrixWorld.clone().invert()).decompose(_position, _rotation, _scale);
|
782
782
|
|
783
|
-
collider.
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
783
|
+
if (collider.parent()) {
|
784
|
+
collider.setTranslationWrtParent({
|
785
|
+
x: _position.x * parentWorldScale.x,
|
786
|
+
y: _position.y * parentWorldScale.y,
|
787
|
+
z: _position.z * parentWorldScale.z
|
788
|
+
});
|
789
|
+
collider.setRotationWrtParent(_rotation);
|
790
|
+
} else {
|
791
|
+
collider.setTranslation({
|
792
|
+
x: _position.x * parentWorldScale.x,
|
793
|
+
y: _position.y * parentWorldScale.y,
|
794
|
+
z: _position.z * parentWorldScale.z
|
795
|
+
});
|
796
|
+
collider.setRotation(_rotation);
|
797
|
+
}
|
798
|
+
|
789
799
|
mutableColliderOptionKeys.forEach(key => {
|
790
800
|
if (key in options) {
|
791
801
|
mutableColliderOptions[key](collider, options[key]);
|
@@ -1147,8 +1157,11 @@ const AnyCollider = /*#__PURE__*/React.memo(props => {
|
|
1147
1157
|
});
|
1148
1158
|
};
|
1149
1159
|
}, []);
|
1150
|
-
|
1151
|
-
|
1160
|
+
const mergedProps = React.useMemo(() => {
|
1161
|
+
return _objectSpread2(_objectSpread2({}, rigidBodyContext === null || rigidBodyContext === void 0 ? void 0 : rigidBodyContext.options), props);
|
1162
|
+
}, [props, rigidBodyContext === null || rigidBodyContext === void 0 ? void 0 : rigidBodyContext.options]);
|
1163
|
+
useUpdateColliderOptions(collidersRef, mergedProps, colliderStates);
|
1164
|
+
useColliderEvents(collidersRef, mergedProps, colliderEvents);
|
1152
1165
|
return /*#__PURE__*/React__default["default"].createElement("object3D", {
|
1153
1166
|
position: position,
|
1154
1167
|
rotation: rotation,
|
@@ -780,12 +780,22 @@ const setColliderOptions = (collider, options, states) => {
|
|
780
780
|
|
781
781
|
_matrix4.copy(state.object.matrixWorld).premultiply(state.worldParent.matrixWorld.clone().invert()).decompose(_position, _rotation, _scale);
|
782
782
|
|
783
|
-
collider.
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
783
|
+
if (collider.parent()) {
|
784
|
+
collider.setTranslationWrtParent({
|
785
|
+
x: _position.x * parentWorldScale.x,
|
786
|
+
y: _position.y * parentWorldScale.y,
|
787
|
+
z: _position.z * parentWorldScale.z
|
788
|
+
});
|
789
|
+
collider.setRotationWrtParent(_rotation);
|
790
|
+
} else {
|
791
|
+
collider.setTranslation({
|
792
|
+
x: _position.x * parentWorldScale.x,
|
793
|
+
y: _position.y * parentWorldScale.y,
|
794
|
+
z: _position.z * parentWorldScale.z
|
795
|
+
});
|
796
|
+
collider.setRotation(_rotation);
|
797
|
+
}
|
798
|
+
|
789
799
|
mutableColliderOptionKeys.forEach(key => {
|
790
800
|
if (key in options) {
|
791
801
|
mutableColliderOptions[key](collider, options[key]);
|
@@ -1147,8 +1157,11 @@ const AnyCollider = /*#__PURE__*/React.memo(props => {
|
|
1147
1157
|
});
|
1148
1158
|
};
|
1149
1159
|
}, []);
|
1150
|
-
|
1151
|
-
|
1160
|
+
const mergedProps = React.useMemo(() => {
|
1161
|
+
return _objectSpread2(_objectSpread2({}, rigidBodyContext === null || rigidBodyContext === void 0 ? void 0 : rigidBodyContext.options), props);
|
1162
|
+
}, [props, rigidBodyContext === null || rigidBodyContext === void 0 ? void 0 : rigidBodyContext.options]);
|
1163
|
+
useUpdateColliderOptions(collidersRef, mergedProps, colliderStates);
|
1164
|
+
useColliderEvents(collidersRef, mergedProps, colliderEvents);
|
1152
1165
|
return /*#__PURE__*/React__default["default"].createElement("object3D", {
|
1153
1166
|
position: position,
|
1154
1167
|
rotation: rotation,
|
@@ -755,12 +755,22 @@ const setColliderOptions = (collider, options, states) => {
|
|
755
755
|
|
756
756
|
_matrix4.copy(state.object.matrixWorld).premultiply(state.worldParent.matrixWorld.clone().invert()).decompose(_position, _rotation, _scale);
|
757
757
|
|
758
|
-
collider.
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
758
|
+
if (collider.parent()) {
|
759
|
+
collider.setTranslationWrtParent({
|
760
|
+
x: _position.x * parentWorldScale.x,
|
761
|
+
y: _position.y * parentWorldScale.y,
|
762
|
+
z: _position.z * parentWorldScale.z
|
763
|
+
});
|
764
|
+
collider.setRotationWrtParent(_rotation);
|
765
|
+
} else {
|
766
|
+
collider.setTranslation({
|
767
|
+
x: _position.x * parentWorldScale.x,
|
768
|
+
y: _position.y * parentWorldScale.y,
|
769
|
+
z: _position.z * parentWorldScale.z
|
770
|
+
});
|
771
|
+
collider.setRotation(_rotation);
|
772
|
+
}
|
773
|
+
|
764
774
|
mutableColliderOptionKeys.forEach(key => {
|
765
775
|
if (key in options) {
|
766
776
|
mutableColliderOptions[key](collider, options[key]);
|
@@ -1122,8 +1132,11 @@ const AnyCollider = /*#__PURE__*/memo(props => {
|
|
1122
1132
|
});
|
1123
1133
|
};
|
1124
1134
|
}, []);
|
1125
|
-
|
1126
|
-
|
1135
|
+
const mergedProps = useMemo(() => {
|
1136
|
+
return _objectSpread2(_objectSpread2({}, rigidBodyContext === null || rigidBodyContext === void 0 ? void 0 : rigidBodyContext.options), props);
|
1137
|
+
}, [props, rigidBodyContext === null || rigidBodyContext === void 0 ? void 0 : rigidBodyContext.options]);
|
1138
|
+
useUpdateColliderOptions(collidersRef, mergedProps, colliderStates);
|
1139
|
+
useColliderEvents(collidersRef, mergedProps, colliderEvents);
|
1127
1140
|
return /*#__PURE__*/React.createElement("object3D", {
|
1128
1141
|
position: position,
|
1129
1142
|
rotation: rotation,
|