diff --git a/crates/avian3d/snapshots/avian3d__tests__cubes_simulation_is_deterministic_across_machines.snap b/crates/avian3d/snapshots/avian3d__tests__cubes_simulation_is_deterministic_across_machines.snap index 3ae4208d..c92868a0 100644 --- a/crates/avian3d/snapshots/avian3d__tests__cubes_simulation_is_deterministic_across_machines.snap +++ b/crates/avian3d/snapshots/avian3d__tests__cubes_simulation_is_deterministic_across_machines.snap @@ -9,15 +9,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.6235313, - 0.4999551, - -4.3102026, + -4.3436184, + 0.49991006, + -4.296879, ), rotation: Quat( - 6.792209e-6, - 0.028391084, - 9.04388e-6, - 0.9995969, + -2.5553492e-5, + 0.022908358, + 1.3738552e-5, + 0.99973756, ), scale: Vec3( 1.0, @@ -32,15 +32,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.395441, - 0.4999247, - -2.1216874, + -4.269073, + 0.4997923, + -2.2233717, ), rotation: Quat( - 8.929338e-6, - 0.04565544, - 3.2982214e-5, - 0.9989572, + 4.585157e-5, + 0.016790895, + 2.3272169e-5, + 0.99985904, ), scale: Vec3( 1.0, @@ -55,15 +55,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.274698, - 0.49992138, - -0.05236319, + -4.338925, + 0.49993542, + -0.06489013, ), rotation: Quat( - -2.374302e-6, - 0.008430953, - 2.023666e-5, - 0.9999645, + 9.748377e-6, + 0.018174091, + -9.919771e-6, + 0.99983484, ), scale: Vec3( 1.0, @@ -78,15 +78,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.5010552, - 0.49988276, - 2.0600283, + -4.309342, + 0.4999242, + 2.0784388, ), rotation: Quat( - -1.549203e-5, - 0.060082633, - 3.9520124e-5, - 0.9981934, + 1.3023027e-5, + 0.0005634976, + 1.4167339e-5, + 0.9999998, ), scale: Vec3( 1.0, @@ -101,15 +101,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.3512757, - 0.4999154, - -4.3770533, + -2.2676656, + 0.4999424, + -4.275999, ), rotation: Quat( - -1.436397e-5, - -0.0029353325, - 2.4329216e-5, - 0.9999957, + 8.007702e-6, + 0.02796826, + 5.278343e-6, + 0.9996088, ), scale: Vec3( 1.0, @@ -124,15 +124,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.1879144, - 0.49990264, - -2.1195703, + -2.2391012, + 0.49989316, + -2.156254, ), rotation: Quat( - 1.3067328e-5, - 0.042666864, - 3.453079e-6, - 0.99908936, + 1.5177168e-5, + 0.010355742, + 1.0820655e-5, + 0.99994636, ), scale: Vec3( 1.0, @@ -147,15 +147,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.2019854, - 0.49993193, - -0.08177335, + -2.1382418, + 0.49994266, + -0.050839357, ), rotation: Quat( - 3.632382e-5, - 0.03833177, - -6.8493405e-6, - 0.9992651, + 8.426809e-7, + 0.019350963, + 1.5954093e-6, + 0.9998128, ), scale: Vec3( 1.0, @@ -170,15 +170,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.2972653, - 0.4998191, - 2.0399506, + -2.1722434, + 0.49991077, + 1.9967961, ), rotation: Quat( - -2.1943695e-5, - 0.044874776, - -1.23802765e-5, - 0.9989926, + 2.620148e-5, + 0.034605335, + -1.5479044e-6, + 0.99940103, ), scale: Vec3( 1.0, @@ -193,15 +193,15 @@ expression: bodies ), Transform { translation: Vec3( - 0.107554115, - 0.49993876, - -4.327578, + -0.16056237, + 0.49987614, + -4.3232784, ), rotation: Quat( - 6.8130457e-6, - 0.033044733, - 7.462414e-7, - 0.9994539, + -1.9152565e-5, + 0.030875357, + -3.5572582e-5, + 0.9995232, ), scale: Vec3( 1.0, @@ -216,15 +216,15 @@ expression: bodies ), Transform { translation: Vec3( - -0.16756493, - 0.49985483, - -2.235181, + -0.20442173, + 0.4999341, + -2.2879012, ), rotation: Quat( - 6.80968e-5, - 0.049224917, - 1.751861e-5, - 0.9987877, + 3.6669778e-6, + 0.030178297, + 4.506087e-6, + 0.99954456, ), scale: Vec3( 1.0, @@ -239,15 +239,15 @@ expression: bodies ), Transform { translation: Vec3( - -0.0541185, - 0.49994805, - -0.10040754, + -0.0555723, + 0.49986637, + -0.025465094, ), rotation: Quat( - 3.8723425e-5, - 0.036581654, - 2.2724045e-9, - 0.99933064, + -5.680657e-5, + 0.035923723, + 1.1356462e-5, + 0.99935454, ), scale: Vec3( 1.0, @@ -262,15 +262,15 @@ expression: bodies ), Transform { translation: Vec3( - -0.1380171, - 0.4999437, - 2.041131, + -0.14790367, + 0.49987102, + 2.0024178, ), rotation: Quat( - 4.469642e-6, - 0.063405216, - -8.009917e-6, - 0.99798787, + 3.157794e-5, + 0.03596949, + 9.217124e-6, + 0.9993529, ), scale: Vec3( 1.0, @@ -285,15 +285,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.3947806, - 0.49992827, - -4.5461936, + 1.8907627, + 0.49997494, + -4.2941923, ), rotation: Quat( - -1.0799266e-5, - 0.027643675, - -1.9875699e-5, - 0.9996178, + 7.3110705e-6, + 0.013656743, + -2.2990896e-6, + 0.9999067, ), scale: Vec3( 1.0, @@ -308,15 +308,15 @@ expression: bodies ), Transform { translation: Vec3( - 1.9873046, - 0.49990204, - -2.1898642, + 2.225411, + 0.49993524, + -1.9878211, ), rotation: Quat( - -7.0308447e-6, - 0.013860726, - -9.374108e-7, - 0.9999039, + 1.5965279e-5, + 0.0062459577, + -2.0927005e-6, + 0.9999805, ), scale: Vec3( 1.0, @@ -331,15 +331,15 @@ expression: bodies ), Transform { translation: Vec3( - 1.9924507, - 0.49990392, - 0.028409133, + 2.0315042, + 0.49983877, + 0.14541504, ), rotation: Quat( - -2.0307734e-5, - 0.038908634, - -2.5417212e-5, - 0.9992428, + -5.124351e-6, + 0.060059395, + -5.3043706e-5, + 0.9981948, ), scale: Vec3( 1.0, @@ -354,15 +354,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.0213652, - 0.49992904, - 2.07552, + 2.5097122, + 0.49965858, + 2.233436, ), rotation: Quat( - -8.9036865e-7, - 0.038583953, - -4.484539e-6, - 0.99925536, + 0.00014104994, + 0.07634663, + 5.9060276e-5, + 0.99708134, ), scale: Vec3( 1.0, @@ -377,15 +377,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.6172295, - 2.4997044, - -4.4200807, + -4.6546392, + 2.4994938, + -4.60831, ), rotation: Quat( - -3.9479753e-5, - 0.008044018, - 0.000119170385, - 0.99996763, + -8.056431e-5, + -0.03575463, + 9.7319855e-5, + 0.99936056, ), scale: Vec3( 1.0, @@ -400,15 +400,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.209664, - 2.4996552, - -1.8515848, + -4.172791, + 2.4996233, + -1.8589829, ), rotation: Quat( - -2.3919894e-5, - -0.09500672, - 2.4027535e-5, - 0.9954766, + -7.965194e-6, + -0.058567688, + 3.2652686e-5, + 0.99828345, ), scale: Vec3( 1.0, @@ -423,15 +423,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.2944584, - 2.4997544, - 0.41124114, + -4.285608, + 2.4997356, + 0.46847337, ), rotation: Quat( - -5.633291e-6, - -0.049498014, - 4.2487663e-6, - 0.99877423, + -4.3386393e-5, + -0.072301075, + 1.2604773e-5, + 0.9973829, ), scale: Vec3( 1.0, @@ -446,15 +446,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.963533, - 2.4995315, - 2.9559677, + -4.7553477, + 2.499642, + 2.552817, ), rotation: Quat( - 3.0370862e-5, - 0.22723709, - 0.000112364956, - 0.97383946, + 3.525961e-5, + -0.12182438, + 7.4685727e-6, + 0.9925517, ), scale: Vec3( 1.0, @@ -469,15 +469,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.5552368, - 2.4993527, - -4.500378, + -2.3004465, + 2.4998322, + -4.284665, ), rotation: Quat( - -0.00011087178, - 0.04056032, - 0.00016879673, - 0.9991771, + 4.411128e-6, + -0.096014515, + 2.1338878e-5, + 0.9953799, ), scale: Vec3( 1.0, @@ -492,15 +492,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.0473864, - 2.4997523, - -2.1444805, + -2.0032275, + 2.49972, + -2.0576475, ), rotation: Quat( - 2.3767692e-5, - -0.06617973, - 4.5312634e-5, - 0.99780774, + 2.4163653e-6, + -0.037724778, + 4.2749e-6, + 0.99928814, ), scale: Vec3( 1.0, @@ -515,15 +515,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.0019884, - 2.4996307, - 0.07245258, + -2.182591, + 2.4997797, + 0.15891865, ), rotation: Quat( - -1.8408135e-5, - -0.033830024, - -3.4742905e-5, - 0.9994276, + -2.9885423e-5, + -0.06532209, + 1.4196821e-5, + 0.99786425, ), scale: Vec3( 1.0, @@ -538,15 +538,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.3242505, - 2.4993322, - 2.2606218, + -2.2900982, + 2.499291, + 2.32595, ), rotation: Quat( - 0.00024682377, - -0.038670935, - -1.3273278e-5, - 0.99925196, + 9.5834424e-5, + -0.007069989, + -1.6672475e-5, + 0.999975, ), scale: Vec3( 1.0, @@ -561,15 +561,15 @@ expression: bodies ), Transform { translation: Vec3( - -0.017980704, - 2.4997847, - -4.5714655, + 0.09160258, + 2.4995058, + -4.6007705, ), rotation: Quat( - 7.516822e-5, - -0.1037768, - -6.3543735e-6, - 0.9946006, + -5.737683e-5, + -0.09518905, + -7.304942e-5, + 0.9954592, ), scale: Vec3( 1.0, @@ -584,15 +584,15 @@ expression: bodies ), Transform { translation: Vec3( - 0.035522643, - 2.499665, - -1.887645, + 0.24078324, + 2.499625, + -1.8685613, ), rotation: Quat( - -5.4151067e-5, - -0.07759328, - 5.7816993e-5, - 0.9969851, + -2.0362297e-5, + 0.026618306, + -2.4803261e-5, + 0.99964565, ), scale: Vec3( 1.0, @@ -607,15 +607,15 @@ expression: bodies ), Transform { translation: Vec3( - 0.13470578, - 2.4998295, - 0.23872411, + 0.556041, + 2.4997425, + 0.5973528, ), rotation: Quat( - -2.729211e-5, - -0.036848005, - 3.6757367e-5, - 0.99932086, + -2.2246828e-5, + 0.039430592, + 1.7966987e-6, + 0.99922234, ), scale: Vec3( 1.0, @@ -630,15 +630,15 @@ expression: bodies ), Transform { translation: Vec3( - 1.2370723, - 2.4997654, - 3.0245857, + 0.9259823, + 2.4992216, + 3.1523142, ), rotation: Quat( - 5.3966458e-5, - -0.08192157, - -2.5600575e-5, - 0.9966388, + 0.0002603197, + -0.1646799, + 5.7218085e-6, + 0.986347, ), scale: Vec3( 1.0, @@ -653,15 +653,15 @@ expression: bodies ), Transform { translation: Vec3( - 3.0207999, - 2.49938, - -4.804246, + 5.785634, + 0.4999725, + -5.3406634, ), rotation: Quat( - -0.00025090633, - -0.22644581, - -3.296936e-5, - 0.97402376, + -0.048898797, + 0.0489102, + -0.7054177, + 0.7054095, ), scale: Vec3( 1.0, @@ -676,15 +676,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.2870855, - 2.4995823, - -2.0314507, + 2.3887408, + 2.4998147, + -1.7574005, ), rotation: Quat( - -4.212562e-5, - -0.0795341, - -8.496051e-5, - 0.99683213, + 3.2305175e-5, + 0.101838335, + -2.4820429e-5, + 0.994801, ), scale: Vec3( 1.0, @@ -699,15 +699,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.401399, - 2.4997003, - 0.40044406, + 3.006794, + 2.4994137, + 0.73332673, ), rotation: Quat( - -4.2936877e-5, - -0.02853228, - -6.93234e-5, - 0.99959284, + 3.47043e-5, + 0.007927637, + -0.0001795673, + 0.9999686, ), scale: Vec3( 1.0, @@ -722,15 +722,15 @@ expression: bodies ), Transform { translation: Vec3( - 4.8708215, - 0.49994954, - 2.716985, + 3.7097378, + 2.4991264, + 3.008501, ), rotation: Quat( - -0.22389062, - 0.22390395, - -0.67072326, - 0.67072374, + 9.539163e-5, + 0.06272054, + -0.0001412569, + 0.99803114, ), scale: Vec3( 1.0, @@ -745,15 +745,15 @@ expression: bodies ), Transform { translation: Vec3( - -5.743751, - 0.49997622, - -7.7576003, + -5.2136946, + 4.4990106, + -4.66623, ), rotation: Quat( - -0.6831842, - -0.1823796, - -0.18237586, - 0.68318087, + -0.00013128418, + 0.07245487, + 9.851393e-5, + 0.9973717, ), scale: Vec3( 1.0, @@ -768,15 +768,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.4394183, - 4.499168, - -2.2780342, + -4.331632, + 4.4989476, + -2.383557, ), rotation: Quat( - -0.00010241466, - -0.029148506, - 0.00014624714, - 0.9995751, + -0.00026280302, + 0.0064995657, + 8.416204e-5, + 0.99997884, ), scale: Vec3( 1.0, @@ -791,15 +791,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.742195, - 4.4995513, - -0.10190557, + -4.5210557, + 4.499607, + -0.086147875, ), rotation: Quat( - 2.112891e-5, - -0.07290185, - 5.221194e-5, - 0.9973391, + -1.5661459e-5, + -0.061075248, + 2.2725468e-5, + 0.9981332, ), scale: Vec3( 1.0, @@ -814,15 +814,15 @@ expression: bodies ), Transform { translation: Vec3( - -5.3016768, - 4.4993925, - 2.579552, + -4.4995008, + 4.4995866, + 2.128999, ), rotation: Quat( - 3.9158287e-5, - -0.033970475, - 0.00010121866, - 0.99942285, + 8.864076e-5, + -0.08956947, + 3.0174583e-6, + 0.99598056, ), scale: Vec3( 1.0, @@ -837,15 +837,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.5227122, - 4.499137, - -4.907738, + -1.3765528, + 4.499495, + -4.9117675, ), rotation: Quat( - -0.00016248651, - -0.04171383, - 0.00018044861, - 0.9991296, + -7.023918e-5, + 0.07935354, + -3.0031459e-5, + 0.99684656, ), scale: Vec3( 1.0, @@ -860,15 +860,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.2256882, - 4.499635, - -2.15674, + -2.2354882, + 4.499636, + -2.4831307, ), rotation: Quat( - 1.6705788e-5, - -0.026514797, - 7.257547e-6, - 0.9996484, + 1.5427466e-5, + 0.024701215, + 5.270279e-7, + 0.9996949, ), scale: Vec3( 1.0, @@ -883,15 +883,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.3874211, - 4.499609, - 0.07365528, + -2.3337624, + 4.4996247, + -0.30983275, ), rotation: Quat( - -1.194691e-5, - 0.0037788856, - -3.14291e-5, - 0.99999285, + 1.48931895e-5, + 0.043700416, + -1.387997e-5, + 0.99904466, ), scale: Vec3( 1.0, @@ -906,15 +906,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.5631702, - 4.4991107, - 2.296562, + -2.2943144, + 4.499116, + 2.3013654, ), rotation: Quat( - 0.0002573887, - 0.0011914646, - -3.442954e-5, - 0.9999993, + 8.590152e-5, + -0.065169744, + -3.7103877e-5, + 0.9978742, ), scale: Vec3( 1.0, @@ -929,15 +929,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.410794, - 4.4989686, - -5.4617033, + 0.82121176, + 4.499163, + -4.707244, ), rotation: Quat( - -0.00032732144, - 0.1383523, - -4.109261e-5, - 0.990383, + -6.240986e-5, + 0.09233464, + -0.00016790433, + 0.995728, ), scale: Vec3( 1.0, @@ -952,15 +952,15 @@ expression: bodies ), Transform { translation: Vec3( - 0.26225993, - 4.4995036, - -2.110422, + -0.019605312, + 4.4995275, + -1.8954474, ), rotation: Quat( - -9.350747e-5, - 0.033721026, - 6.520454e-5, - 0.99943125, + -9.695722e-6, + -0.027745536, + -6.428169e-5, + 0.999615, ), scale: Vec3( 1.0, @@ -975,15 +975,15 @@ expression: bodies ), Transform { translation: Vec3( - -0.3186675, - 4.499629, - 0.0963318, + 0.3675758, + 4.4994783, + 0.5742598, ), rotation: Quat( - -1.4555179e-5, - 0.022730097, - 4.3712032e-5, - 0.9997416, + -2.5495856e-5, + -0.08530305, + 5.8762038e-5, + 0.99635506, ), scale: Vec3( 1.0, @@ -998,15 +998,15 @@ expression: bodies ), Transform { translation: Vec3( - 1.660552, - 4.499688, - 2.6138442, + 0.5175026, + 4.498979, + 3.16442, ), rotation: Quat( - 5.7584428e-5, - 0.177509, - -2.7266731e-5, - 0.9841192, + 0.00026501337, + 0.032471776, + 0.00012322664, + 0.9994726, ), scale: Vec3( 1.0, @@ -1021,15 +1021,15 @@ expression: bodies ), Transform { translation: Vec3( - 6.5616693, - 0.49995765, - -4.681283, + 12.741775, + 0.49997452, + -2.6795921, ), rotation: Quat( - 0.11759628, - -0.117593996, - -0.6972648, - 0.6972551, + 4.563578e-6, + -0.73042923, + 1.6262841e-6, + 0.68298835, ), scale: Vec3( 1.0, @@ -1044,15 +1044,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.6076624, - 4.499192, - -2.3946123, + 6.832665, + 0.49997413, + -2.2504506, ), rotation: Quat( - -8.149893e-5, - -0.13977607, - -0.00016805792, - 0.9901831, + -0.49702427, + 0.4970268, + -0.50295997, + 0.5029538, ), scale: Vec3( 1.0, @@ -1067,15 +1067,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.7510502, - 4.4994597, - -0.11339602, + 3.0461473, + 4.499225, + 0.22920866, ), rotation: Quat( - 1.7198529e-6, - -0.025809804, - -0.00010880344, - 0.99966687, + 5.1866413e-5, + 0.021056283, + -0.00019408693, + 0.9997783, ), scale: Vec3( 1.0, @@ -1090,15 +1090,15 @@ expression: bodies ), Transform { translation: Vec3( - 10.469548, - 0.4999776, - 1.3612407, + 2.9246209, + 4.499297, + 2.4780617, ), rotation: Quat( - -0.5211823, - 0.5211832, - -0.4778806, - 0.4778779, + 6.594242e-5, + 0.01213917, + -0.00013579946, + 0.9999263, ), scale: Vec3( 1.0, @@ -1113,15 +1113,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.9279284, - 0.49997404, - -11.524672, + -2.9110677, + 0.49997646, + -8.981629, ), rotation: Quat( - -0.7058846, - 0.041562825, - 0.041558053, - 0.70588416, + -0.5661933, + -0.42358997, + -0.42358074, + 0.56619436, ), scale: Vec3( 1.0, @@ -1136,15 +1136,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.447393, - 6.498999, - -2.2909615, + -4.3699694, + 6.4985104, + -2.557968, ), rotation: Quat( - -8.9638736e-5, - -0.0734362, - 0.00016005662, - 0.9972999, + -0.0001549909, + 0.011418832, + 0.00012667709, + 0.9999348, ), scale: Vec3( 1.0, @@ -1159,15 +1159,15 @@ expression: bodies ), Transform { translation: Vec3( - -4.9871564, - 6.4994545, - 0.7354106, + -8.460897, + 0.49997526, + 0.87348664, ), rotation: Quat( - 2.413892e-5, - -0.34084716, - 5.7699748e-5, - 0.94011873, + 0.5511459, + 0.55113834, + 0.44299087, + 0.44299415, ), scale: Vec3( 1.0, @@ -1182,15 +1182,15 @@ expression: bodies ), Transform { translation: Vec3( - -11.189314, - 0.49997368, - 2.969288, + -8.091601, + 0.49997482, + 8.084826, ), rotation: Quat( - 0.40561, - -2.8614409e-6, - 0.9140462, - 2.6912608e-6, + 0.6486452, + 0.2815346, + 0.28153172, + -0.64864284, ), scale: Vec3( 1.0, @@ -1205,15 +1205,15 @@ expression: bodies ), Transform { translation: Vec3( - -3.1166217, - 6.498797, - -4.673969, + -1.8391439, + 6.4995074, + -4.282115, ), rotation: Quat( - -0.00015008492, - 0.022614641, - 0.00021529867, - 0.99974424, + -7.8104196e-5, + 0.0742278, + -6.827869e-6, + 0.9972413, ), scale: Vec3( 1.0, @@ -1228,15 +1228,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.2219517, - 6.4995317, - -1.6324775, + -1.8901376, + 6.499587, + -1.9380401, ), rotation: Quat( - -9.831658e-6, - -0.012949602, - -1.5674532e-5, - 0.99991614, + -8.921055e-6, + -0.028636256, + -2.7397505e-6, + 0.9995899, ), scale: Vec3( 1.0, @@ -1251,15 +1251,15 @@ expression: bodies ), Transform { translation: Vec3( - -2.3359718, - 6.4995947, - 0.6213731, + -2.262749, + 6.499529, + 0.16420417, ), rotation: Quat( - -1.4475261e-5, - -0.14079188, - -3.3769644e-5, - 0.9900392, + 1.9269424e-5, + -0.034101903, + -1.681844e-5, + 0.9994184, ), scale: Vec3( 1.0, @@ -1274,15 +1274,15 @@ expression: bodies ), Transform { translation: Vec3( - -3.2923048, - 6.498702, - 2.6605368, + -2.7352326, + 6.499188, + 2.4458265, ), rotation: Quat( - 0.00031247907, - -0.032806676, - 7.217066e-5, - 0.99946165, + 0.000100062134, + 0.08199773, + -8.9980815e-5, + 0.9966325, ), scale: Vec3( 1.0, @@ -1297,15 +1297,15 @@ expression: bodies ), Transform { translation: Vec3( - -0.036978077, - 5.15025, - -4.5430636, + 0.18015957, + 6.4992023, + -5.020193, ), rotation: Quat( - 0.14573015, - -0.050092924, - 0.3867345, - 0.90922487, + -6.0591687e-5, + 0.112215094, + -0.00015659908, + 0.99368393, ), scale: Vec3( 1.0, @@ -1320,15 +1320,15 @@ expression: bodies ), Transform { translation: Vec3( - 0.09961634, - 6.4994335, - -1.8124114, + 0.97756267, + 6.4992156, + -2.7049718, ), rotation: Quat( - -9.371393e-5, - -0.028939188, - 5.6513025e-5, - 0.99958116, + -4.579273e-5, + -0.10631892, + -0.00020800346, + 0.9943321, ), scale: Vec3( 1.0, @@ -1343,15 +1343,15 @@ expression: bodies ), Transform { translation: Vec3( - 0.40858662, - 6.4996233, - 0.5594393, + 0.41251925, + 6.4994116, + 0.1899738, ), rotation: Quat( - -2.1253027e-5, - -0.08784573, - 4.792721e-5, - 0.9961341, + 5.4433436e-5, + -0.10809349, + 4.1983985e-5, + 0.99414074, ), scale: Vec3( 1.0, @@ -1366,15 +1366,15 @@ expression: bodies ), Transform { translation: Vec3( - -1.844904, - 0.4999791, - 4.966705, + -0.1697666, + 6.4988413, + 2.7628212, ), rotation: Quat( - -0.58803606, - -0.58803576, - 0.3927007, - 0.39270052, + 0.0002654026, + 0.03127186, + 0.00012196695, + 0.9995109, ), scale: Vec3( 1.0, @@ -1389,15 +1389,15 @@ expression: bodies ), Transform { translation: Vec3( - 7.232593, - 2.4998035, - -4.444068, + 5.0161757, + 0.49997386, + -10.729977, ), rotation: Quat( - 1.3062127e-5, - -0.16993561, - -7.430008e-5, - 0.98545516, + -0.6961508, + 0.12400561, + 0.123997934, + 0.69614744, ), scale: Vec3( 1.0, @@ -1412,15 +1412,15 @@ expression: bodies ), Transform { translation: Vec3( - 3.2513006, - 6.4988227, - -2.2973287, + 9.1778345, + 0.49997634, + -4.3737416, ), rotation: Quat( - -6.8110654e-5, - -0.09295494, - -0.00023127707, - 0.99567026, + 0.19280694, + 0.1928094, + -0.6803134, + -0.6803115, ), scale: Vec3( 1.0, @@ -1435,15 +1435,15 @@ expression: bodies ), Transform { translation: Vec3( - 2.899124, - 6.499335, - -0.016431106, + 2.6800532, + 6.4992833, + 0.25805184, ), rotation: Quat( - 1.5358692e-5, - 0.05692746, - -9.1249414e-5, - 0.99837834, + 4.5212557e-5, + -0.017432408, + -0.00019411273, + 0.999848, ), scale: Vec3( 1.0, @@ -1458,15 +1458,15 @@ expression: bodies ), Transform { translation: Vec3( - 5.00174, - 2.49973, - 2.6626215, + 2.6016824, + 6.499269, + 2.5533757, ), rotation: Quat( - -0.16455474, - 0.16442548, - -0.68768793, - 0.68772906, + 4.4812055e-5, + -0.12714767, + -0.00013879384, + 0.9918838, ), scale: Vec3( 1.0, diff --git a/src/dynamics/rigid_body/mass_properties.rs b/src/dynamics/rigid_body/mass_properties.rs index c6e5e962..4b48cbb9 100644 --- a/src/dynamics/rigid_body/mass_properties.rs +++ b/src/dynamics/rigid_body/mass_properties.rs @@ -641,7 +641,7 @@ impl From for ColliderDensity { /// /// fn print_collider_masses(query: Query<&ColliderMassProperties>) { /// for mass_props in &query { -/// println!("{}", mass_props.mass.0); +/// println!("{}", mass_props.mass.value()); /// } /// } /// ``` diff --git a/src/dynamics/rigid_body/mod.rs b/src/dynamics/rigid_body/mod.rs index 7d5b0928..6b764ca0 100644 --- a/src/dynamics/rigid_body/mod.rs +++ b/src/dynamics/rigid_body/mod.rs @@ -207,7 +207,7 @@ use derive_more::From; #[cfg_attr(feature = "2d", doc = " Collider::circle(0.5),")] #[cfg_attr(feature = "3d", doc = " Collider::sphere(0.5),")] /// ColliderDensity(0.0), -/// Mass(5.0), +/// Mass::new(5.0), /// // ...the rest of the mass properties /// )); /// # } diff --git a/src/dynamics/rigid_body/world_query.rs b/src/dynamics/rigid_body/world_query.rs index d8812652..ac4101f4 100644 --- a/src/dynamics/rigid_body/world_query.rs +++ b/src/dynamics/rigid_body/world_query.rs @@ -289,15 +289,23 @@ mod tests { // Spawn an entity with mass properties app.world_mut().spawn(MassPropertiesBundle { mass: Mass::new(1.6), + #[cfg(feature = "2d")] + angular_inertia: AngularInertia::new(1.6), + #[cfg(feature = "3d")] + angular_inertia: AngularInertia::new(Matrix::from_diagonal(Vector::new(1.6, 2.4, 3.2))), center_of_mass: CenterOfMass(Vector::NEG_X * 3.8), - ..default() }); // Create collider mass properties that will be added to the existing mass properties let collider_mass_props = ColliderMassProperties { mass: Mass::new(8.1), + #[cfg(feature = "2d")] + angular_inertia: AngularInertia::new(56.2), + #[cfg(feature = "3d")] + angular_inertia: AngularInertia::new(Matrix::from_diagonal(Vector::new( + 56.2, 62.7, 71.4, + ))), center_of_mass: CenterOfMass(Vector::X * 1.2 + Vector::Y), - ..default() }; // Get the mass properties and add the collider mass properties @@ -326,15 +334,23 @@ mod tests { // Spawn an entity with mass properties app.world_mut().spawn(MassPropertiesBundle { mass: Mass::new(8.1), + #[cfg(feature = "2d")] + angular_inertia: AngularInertia::new(56.2), + #[cfg(feature = "3d")] + angular_inertia: AngularInertia::new(Matrix::from_diagonal(Vector::new( + 56.2, 62.7, 71.4, + ))), center_of_mass: CenterOfMass(Vector::NEG_X * 3.8), - ..default() }); // Create collider mass properties that will be subtracted from the existing mass properties let collider_mass_props = ColliderMassProperties { mass: Mass::new(1.6), + #[cfg(feature = "2d")] + angular_inertia: AngularInertia::new(1.6), + #[cfg(feature = "3d")] + angular_inertia: AngularInertia::new(Matrix::from_diagonal(Vector::new(1.6, 2.4, 3.2))), center_of_mass: CenterOfMass(Vector::X * 1.2 + Vector::Y), - ..default() }; // Get the mass properties and subtract the collider mass properties diff --git a/src/prepare.rs b/src/prepare.rs index b967992c..4382d88b 100644 --- a/src/prepare.rs +++ b/src/prepare.rs @@ -161,9 +161,9 @@ impl Plugin for PreparePlugin { .add_systems( self.schedule, ( + warn_missing_mass, #[cfg(feature = "3d")] update_global_angular_inertia::>, - warn_missing_mass, clamp_collider_density, clamp_restitution, // All the components we added above must exist before we can simulate the bodies.