@series-inc/rundot-syncplay 6.0.0-rc.4 → 6.0.0-rc.6

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.
@@ -830,18 +830,19 @@ BuoyancyStatus validateVoxelBoxes(std::span<const VoxelBoxShape3D> boxes) {
830
830
  || !(box.halfSize.z > 0.0)) return BuoyancyStatus::InvalidInput;
831
831
  for (std::size_t otherIndex = 0; otherIndex < index; ++otherIndex) {
832
832
  const VoxelBoxShape3D& other = boxes[otherIndex];
833
+ constexpr double kEps = 1e-9;
833
834
  const bool overlap = box.offset.x - box.halfSize.x
834
- < other.offset.x + other.halfSize.x
835
+ < other.offset.x + other.halfSize.x - kEps
835
836
  && other.offset.x - other.halfSize.x
836
- < box.offset.x + box.halfSize.x
837
+ < box.offset.x + box.halfSize.x - kEps
837
838
  && box.offset.y - box.halfSize.y
838
- < other.offset.y + other.halfSize.y
839
+ < other.offset.y + other.halfSize.y - kEps
839
840
  && other.offset.y - other.halfSize.y
840
- < box.offset.y + box.halfSize.y
841
+ < box.offset.y + box.halfSize.y - kEps
841
842
  && box.offset.z - box.halfSize.z
842
- < other.offset.z + other.halfSize.z
843
+ < other.offset.z + other.halfSize.z - kEps
843
844
  && other.offset.z - other.halfSize.z
844
- < box.offset.z + box.halfSize.z;
845
+ < box.offset.z + box.halfSize.z - kEps;
845
846
  if (overlap) return BuoyancyStatus::OverlapUnsupported;
846
847
  }
847
848
  }
@@ -124,12 +124,13 @@ bool validGeometry(std::span<const double> geometry, ShapeKind kind,
124
124
  || first[13] != 0 || first[14] != 0 || first[15] != 0) return false;
125
125
  for (std::uint64_t other = 0; other < child; ++other) {
126
126
  const double* second = values + other * recordStride;
127
- const bool overlap = first[1] - first[4] < second[1] + second[4]
128
- && second[1] - second[4] < first[1] + first[4]
129
- && first[2] - first[5] < second[2] + second[5]
130
- && second[2] - second[5] < first[2] + first[5]
131
- && first[3] - first[6] < second[3] + second[6]
132
- && second[3] - second[6] < first[3] + first[6];
127
+ constexpr double kEps = 1e-9;
128
+ const bool overlap = first[1] - first[4] < second[1] + second[4] - kEps
129
+ && second[1] - second[4] < first[1] + first[4] - kEps
130
+ && first[2] - first[5] < second[2] + second[5] - kEps
131
+ && second[2] - second[5] < first[2] + first[5] - kEps
132
+ && first[3] - first[6] < second[3] + second[6] - kEps
133
+ && second[3] - second[6] < first[3] + first[6] - kEps;
133
134
  if (overlap) return false;
134
135
  }
135
136
  }
@@ -2845,7 +2845,10 @@ WorldError World::step(const StepOptions& options) {
2845
2845
  };
2846
2846
  inputs.bodyGeometry = bodyGeometryInputs_;
2847
2847
  inputs.fluids = state_.fluids;
2848
- inputs.fluidInteractionCapacity = limits_.maxFluidInteractions;
2848
+ const std::uint64_t maxFluidPairs = static_cast<std::uint64_t>(bodyCount)
2849
+ * (state_.fluids.size() / kFluidStride);
2850
+ inputs.fluidInteractionCapacity = static_cast<std::uint32_t>(
2851
+ std::min(static_cast<std::uint64_t>(limits_.maxFluidInteractions), maxFluidPairs));
2849
2852
  std::vector<std::uint64_t> poseBodyIds;
2850
2853
  std::vector<geometry_private::GeometryRecordOwner> poseGeometryOwners;
2851
2854
  bool hasCcd = false;