@series-inc/rundot-syncplay 6.0.0-rc.6 → 6.0.0-rc.7
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.
- package/core/native/physics/capsule_triangle_native.inc +1 -1
- package/core/native/physics/physics.cpp +15 -1
- package/core/native/physics/physics.hpp +1 -1
- package/core/src/physics/physics-wasm-module.generated.mjs +3 -3
- package/dist/movement3d.js +3 -2
- package/dist/physics/3d.js +2 -2
- package/package.json +2 -2
|
@@ -242,7 +242,7 @@ Collision observeGeometry(SolverOperation& operation,const Body& capsule,const B
|
|
|
242
242
|
for(std::uint32_t child=0;child<count;++child){work(operation);const auto at=base+std::size_t(child)*18;
|
|
243
243
|
auto code=[&](unsigned lane){const auto value=payload[at+lane];if(!finite(value)||value<0||value>std::numeric_limits<std::uint32_t>::max()||std::floor(value)!=value)throw TriangleNativeFailure{tp::Failure::InvalidInput};return std::uint32_t(value);};
|
|
244
244
|
const auto kind=code(0),offset=code(13),size=code(14),format=code(15);
|
|
245
|
-
if(kind>11||payload[at+16]!=0
|
|
245
|
+
if(kind>11||(payload[at+16]!=0.&&payload[at+16]!=1.)||code(17)!=count)throw TriangleNativeFailure{tp::Failure::InvalidInput};
|
|
246
246
|
const bool complex=kind==3||kind==4||kind==5||kind==6;
|
|
247
247
|
if(complex){if(offset<previousEnd||offset>node.count||size>node.count-offset)throw TriangleNativeFailure{tp::Failure::InvalidInput};previousEnd=offset+size;}
|
|
248
248
|
else if(offset||size||format)throw TriangleNativeFailure{tp::Failure::InvalidInput};
|
|
@@ -958,6 +958,20 @@ void populateBoxContactPoints(const Body& a, const Body& b, Collision& collision
|
|
|
958
958
|
const Candidate& candidate = candidates[selected[index]];
|
|
959
959
|
appendBoxContactPoint(collision, candidate.point, candidate.featureId);
|
|
960
960
|
}
|
|
961
|
+
if (collision.pointCount > 0) {
|
|
962
|
+
double sumX = 0.0;
|
|
963
|
+
double sumY = 0.0;
|
|
964
|
+
double sumZ = 0.0;
|
|
965
|
+
for (std::uint32_t i = 0; i < collision.pointCount; ++i) {
|
|
966
|
+
sumX += collision.points[i][0];
|
|
967
|
+
sumY += collision.points[i][1];
|
|
968
|
+
sumZ += collision.points[i][2];
|
|
969
|
+
}
|
|
970
|
+
const double inv = 1.0 / static_cast<double>(collision.pointCount);
|
|
971
|
+
collision.pointX = sumX * inv;
|
|
972
|
+
collision.pointY = sumY * inv;
|
|
973
|
+
collision.pointZ = sumZ * inv;
|
|
974
|
+
}
|
|
961
975
|
}
|
|
962
976
|
|
|
963
977
|
Collision boxBoxOriented(const Body& a, const Body& b) {
|
|
@@ -18653,7 +18667,7 @@ std::int32_t solveStartingConstraints(SolverOperation& operation,
|
|
|
18653
18667
|
|| operation.materialMotionEpochs != nullptr) {
|
|
18654
18668
|
operation.jointSubstepDuration = substepOptions.dtTicks;
|
|
18655
18669
|
resolveSoAContacts(operation, operation.storage.soaBodies.data(), bodyCount,
|
|
18656
|
-
|
|
18670
|
+
1, substepOptions, ContactPass::OwnedPositionCorrection);
|
|
18657
18671
|
if (operation.storage.contactConstraintOverflow) return 5;
|
|
18658
18672
|
resolveSoAContacts(operation, operation.storage.soaBodies.data(), bodyCount,
|
|
18659
18673
|
0, substepOptions,
|
|
@@ -253,7 +253,7 @@ struct StepOptions {
|
|
|
253
253
|
std::uint32_t velocityIterations = 6;
|
|
254
254
|
double gravityX = 0.0;
|
|
255
255
|
double gravityZ = 0.0;
|
|
256
|
-
double restitutionThreshold = 0.
|
|
256
|
+
double restitutionThreshold = 0.5;
|
|
257
257
|
double contactSpeed = 0.0;
|
|
258
258
|
double maximumLinearSpeed = 0.0;
|
|
259
259
|
double contactHertz = 0.0;
|