hyperstellar 0.1.65__tar.gz → 0.1.66__tar.gz

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.
Files changed (18) hide show
  1. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/PKG-INFO +1 -1
  2. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/math.comp +31 -26
  3. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/_native/windows-x64/stellar.pyd +0 -0
  4. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar.egg-info/PKG-INFO +1 -1
  5. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/pyproject.toml +2 -1
  6. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/LICENSE +0 -0
  7. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/README.md +0 -0
  8. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/__init__.py +0 -0
  9. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/__init__.pyi +0 -0
  10. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.frag +0 -0
  11. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.geom +0 -0
  12. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.vert +0 -0
  13. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar/py.typed +0 -0
  14. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar.egg-info/SOURCES.txt +0 -0
  15. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar.egg-info/dependency_links.txt +0 -0
  16. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/hyperstellar/src/hyperstellar.egg-info/top_level.txt +0 -0
  17. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/setup.cfg +0 -0
  18. {hyperstellar-0.1.65 → hyperstellar-0.1.66}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperstellar
3
- Version: 0.1.65
3
+ Version: 0.1.66
4
4
  Summary: GPU-accelerated physics simulation engine
5
5
  Author-email: Aiden Jabari <Jabariaiden15@email.com>
6
6
  License: MIT License
@@ -1110,7 +1110,7 @@ void applyConstraints(inout vec2 pos, inout vec2 vel, int objectIndex, vec2 orig
1110
1110
  }
1111
1111
 
1112
1112
  // ============================================================================
1113
- // COLLISION DETECTION FUNCTIONS (UNCHANGED - KEEP YOUR EXISTING CODE)
1113
+ // COLLISION DETECTION FUNCTIONS
1114
1114
  // ============================================================================
1115
1115
 
1116
1116
  // Circle-Circle collision detection
@@ -1137,35 +1137,38 @@ CollisionInfo detectCircleCircle(vec2 posA, float radiusA, vec2 posB, float radi
1137
1137
  return info;
1138
1138
  }
1139
1139
 
1140
- // Axis-Aligned Bounding Box collision detection
1141
- CollisionInfo detectAABBAABB(vec2 posA, vec2 halfExtA, vec2 posB, vec2 halfExtB, int objB)
1140
+ // HYBRID AABB detection: current positions for penetration, old positions for normal direction
1141
+ CollisionInfo detectAABBAABB(vec2 posA_curr, vec2 halfExtA, vec2 posB_curr, vec2 halfExtB,
1142
+ vec2 posA_old, vec2 posB_old, int objB)
1142
1143
  {
1143
1144
  CollisionInfo info;
1144
1145
  info.hasCollision = false;
1145
1146
  info.otherObjectID = objB;
1146
-
1147
- // Calculate separation vector
1148
- vec2 delta = posB - posA;
1149
- vec2 overlap = halfExtA + halfExtB - abs(delta);
1150
-
1151
- // Check for overlap on both axes
1147
+
1148
+ // Penetration uses CURRENT (predicted/selfNew) positions
1149
+ vec2 delta_curr = posB_curr - posA_curr;
1150
+ vec2 overlap = halfExtA + halfExtB - abs(delta_curr);
1151
+
1152
1152
  if (overlap.x > 0.0 && overlap.y > 0.0)
1153
1153
  {
1154
1154
  info.hasCollision = true;
1155
-
1156
- // Resolve along minimum penetration axis
1157
- if (overlap.x < overlap.y)
1155
+
1156
+ // Normal direction uses OLD positions (physically correct side)
1157
+ vec2 delta_old = posB_old - posA_old;
1158
+
1159
+ if (overlap.x < overlap.y ||
1160
+ (abs(overlap.x - overlap.y) < 0.001 && abs(delta_old.y) >= abs(delta_old.x)))
1158
1161
  {
1159
- info.normal = vec2(sign(delta.x), 0.0);
1160
- info.penetration = overlap.x;
1162
+ info.normal = vec2(0.0, sign(delta_old.y));
1163
+ info.penetration = overlap.y;
1161
1164
  }
1162
1165
  else
1163
1166
  {
1164
- info.normal = vec2(0.0, sign(delta.y));
1165
- info.penetration = overlap.y;
1167
+ info.normal = vec2(sign(delta_old.x), 0.0);
1168
+ info.penetration = overlap.x;
1166
1169
  }
1167
1170
  }
1168
-
1171
+
1169
1172
  return info;
1170
1173
  }
1171
1174
 
@@ -1387,8 +1390,9 @@ CollisionInfo detectCirclePolygon(vec2 circlePos, float circleRadius,
1387
1390
  return info;
1388
1391
  }
1389
1392
 
1390
- // Master collision detection dispatcher
1391
- CollisionInfo detectCollision(Object objA, Object objB, int objIndexB)
1393
+ // Master collision detection dispatcher - hybrid for AABB
1394
+ CollisionInfo detectCollision(Object objA, Object objB, int objIndexB,
1395
+ vec2 posA_old, vec2 posB_old)
1392
1396
  {
1393
1397
  CollisionInfo info;
1394
1398
  info.hasCollision = false;
@@ -1415,13 +1419,14 @@ CollisionInfo detectCollision(Object objA, Object objB, int objIndexB)
1415
1419
  info = detectCircleCircle(objA.position, objA.visualData.x,
1416
1420
  objB.position, objB.visualData.x, objIndexB);
1417
1421
  }
1418
- // AABB vs AABB
1422
+ // AABB vs AABB - HYBRID
1419
1423
  else if (shapeA == COLLISION_AABB && shapeB == COLLISION_AABB)
1420
1424
  {
1421
1425
  vec2 halfExtA = objA.visualData.xy * 0.5;
1422
1426
  vec2 halfExtB = objB.visualData.xy * 0.5;
1423
1427
  info = detectAABBAABB(objA.position, halfExtA,
1424
- objB.position, halfExtB, objIndexB);
1428
+ objB.position, halfExtB,
1429
+ posA_old, posB_old, objIndexB);
1425
1430
  }
1426
1431
  // Polygon vs Polygon
1427
1432
  else if (shapeA == COLLISION_POLYGON && shapeB == COLLISION_POLYGON)
@@ -1874,7 +1879,7 @@ void main() {
1874
1879
  applyConstraints(new_pos, new_vel, objectIndex, originalPos);
1875
1880
 
1876
1881
  // ========================================================================
1877
- // COLLISION HANDLING - Keep selfNew for circles, but fix stickiness for rectangles
1882
+ // COLLISION HANDLING - Keep selfNew for circles, hybrid AABB for rectangles
1878
1883
  // ========================================================================
1879
1884
  vec2 collision_vel = new_vel;
1880
1885
  vec2 final_pos = new_pos; // Accumulate corrections (prevents feedback loop)
@@ -1885,8 +1890,8 @@ void main() {
1885
1890
 
1886
1891
  Object other = objectsIn[i];
1887
1892
 
1888
- // Keep your selfNew detection - this is what made circles bouncy
1889
- CollisionInfo collision = detectCollision(selfNew, other, i); // <--- selfNew here
1893
+ // Pass old positions (p.position and other.position) for correct AABB normals
1894
+ CollisionInfo collision = detectCollision(selfNew, other, i, p.position, other.position);
1890
1895
 
1891
1896
  if (collision.hasCollision) {
1892
1897
  had_collision = true;
@@ -1926,8 +1931,8 @@ void main() {
1926
1931
  }
1927
1932
 
1928
1933
  // Position correction - ACCUMULATED + rectangle-tuned values
1929
- const float slop = 0.025; // Increased to reduce micro-corrections on flat edges
1930
- const float percent = 0.75; // Stronger push to separate cleanly
1934
+ const float slop = 0.04; // Increased to reduce micro-corrections on flat edges
1935
+ const float percent = 0.68; // Stronger push to separate cleanly
1931
1936
 
1932
1937
  if (collision.penetration > slop) {
1933
1938
  float totalMass = massA + massB;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperstellar
3
- Version: 0.1.65
3
+ Version: 0.1.66
4
4
  Summary: GPU-accelerated physics simulation engine
5
5
  Author-email: Aiden Jabari <Jabariaiden15@email.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "hyperstellar"
7
- version = "0.1.65"
7
+ version = "0.1.66"
8
8
  description = "GPU-accelerated physics simulation engine"
9
9
  readme = "README.md"
10
10
  authors = [{name = "Aiden Jabari", email = "Jabariaiden15@email.com"}]
@@ -64,5 +64,6 @@ where = ["hyperstellar/src"]
64
64
 
65
65
 
66
66
 
67
+
67
68
 
68
69
 
File without changes
File without changes
File without changes