Closed haubna closed 1 year ago
Same here: would be possible, but I'm not going to do it for PhysX 4 😃
With the PhysX 5 bindings these raw-pointer based arrays can be iterated out-of-the-box in Java (passing an actual array would still be much cleaner, but is difficult to generate):
public void onConstraintBreak(PxConstraintInfo constraints, int count) {
for (int i = 0; i < count; i++) {
PxConstraintInfo info = PxConstraintInfo.arrayGet(constraints.getAddress(), i);
}
}
Perfect, thanks! :D
onConstraintBreak should pass an array (described here https://gameworksdocs.nvidia.com/PhysX/4.0/documentation/PhysXGuide/Manual/Joints.html).
But it passes only one value that can't be iterated. Maybe a similar solution to PxContactPair (PxContactPair pair = TypeHelpers.getContactPairAt(pairs, i);) would be feasible.