hyperstellar 0.1.69__tar.gz → 0.1.71__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.69 → hyperstellar-0.1.71}/PKG-INFO +1 -1
  2. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/math.comp +78 -6
  3. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/_native/windows-x64/stellar.pyd +0 -0
  4. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar.egg-info/PKG-INFO +1 -1
  5. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/pyproject.toml +3 -1
  6. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/LICENSE +0 -0
  7. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/README.md +0 -0
  8. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/__init__.py +0 -0
  9. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/__init__.pyi +0 -0
  10. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.frag +0 -0
  11. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.geom +0 -0
  12. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.vert +0 -0
  13. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar/py.typed +0 -0
  14. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar.egg-info/SOURCES.txt +0 -0
  15. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar.egg-info/dependency_links.txt +0 -0
  16. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/hyperstellar/src/hyperstellar.egg-info/top_level.txt +0 -0
  17. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/setup.cfg +0 -0
  18. {hyperstellar-0.1.69 → hyperstellar-0.1.71}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperstellar
3
- Version: 0.1.69
3
+ Version: 0.1.71
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
@@ -1387,6 +1387,72 @@ CollisionInfo detectCirclePolygon(vec2 circlePos, float circleRadius,
1387
1387
  return info;
1388
1388
  }
1389
1389
 
1390
+ // -------------------------------------------------------------------------
1391
+ // NEW: Exact AABB projection onto a SAT axis
1392
+ // Meant to replace approximate polygon projection for AABB shapes
1393
+ // -------------------------------------------------------------------------
1394
+ vec2 projectAABB(vec2 center, vec2 halfExt, vec2 axis)
1395
+ {
1396
+ // Project the 4 AABB vertices efficiently using the half-extents
1397
+ float centerProj = dot(center, axis);
1398
+ float extent = abs(axis.x) * halfExt.x + abs(axis.y) * halfExt.y;
1399
+ return vec2(centerProj - extent, centerProj + extent);
1400
+ }
1401
+
1402
+ // -------------------------------------------------------------------------
1403
+ // NEW: AABB vs Polygon collision using a dedicated SAT that respects AABB axes
1404
+ // -------------------------------------------------------------------------
1405
+ CollisionInfo detectAABBPolygon(
1406
+ vec2 posA, vec2 halfExtA,
1407
+ vec2 posB, float radiusB, int sidesB, float rotB,
1408
+ int objB)
1409
+ {
1410
+ CollisionInfo info;
1411
+ info.hasCollision = false;
1412
+ info.otherObjectID = objB;
1413
+ info.penetration = 1e10;
1414
+
1415
+ // AABB contributes 2 axes: X and Y
1416
+ vec2 aabbAxes[2];
1417
+ aabbAxes[0] = vec2(1.0, 0.0);
1418
+ aabbAxes[1] = vec2(0.0, 1.0);
1419
+
1420
+ // Test AABB axes
1421
+ for (int i = 0; i < 2; i++)
1422
+ {
1423
+ vec2 axis = aabbAxes[i];
1424
+ vec2 projA = projectAABB(posA, halfExtA, axis);
1425
+ vec2 projB = projectPolygon(posB, radiusB, sidesB, rotB, axis);
1426
+ if (projA.y < projB.x || projB.y < projA.x)
1427
+ return info;
1428
+ float overlap = min(projA.y, projB.y) - max(projA.x, projB.x);
1429
+ if (overlap < info.penetration) {
1430
+ info.penetration = overlap;
1431
+ info.normal = axis;
1432
+ if (dot(posB - posA, axis) < 0.0) info.normal = -axis;
1433
+ }
1434
+ }
1435
+
1436
+ // Test polygon edge axes
1437
+ for (int i = 0; i < sidesB; i++)
1438
+ {
1439
+ vec2 axis = getPolygonNormal(i, sidesB, rotB);
1440
+ vec2 projA = projectAABB(posA, halfExtA, axis);
1441
+ vec2 projB = projectPolygon(posB, radiusB, sidesB, rotB, axis);
1442
+ if (projA.y < projB.x || projB.y < projA.x)
1443
+ return info;
1444
+ float overlap = min(projA.y, projB.y) - max(projA.x, projB.x);
1445
+ if (overlap < info.penetration) {
1446
+ info.penetration = overlap;
1447
+ info.normal = axis;
1448
+ if (dot(posB - posA, axis) < 0.0) info.normal = -axis;
1449
+ }
1450
+ }
1451
+
1452
+ info.hasCollision = true;
1453
+ return info;
1454
+ }
1455
+
1390
1456
  // Master collision detection dispatcher
1391
1457
  CollisionInfo detectCollision(Object objA, Object objB, int objIndexB)
1392
1458
  {
@@ -1460,18 +1526,24 @@ CollisionInfo detectCollision(Object objA, Object objB, int objIndexB)
1460
1526
  objIndexB);
1461
1527
  info.normal = -info.normal; // Flip normal
1462
1528
  }
1529
+ // AABB vs Polygon (corrected)
1463
1530
  else if (shapeA == COLLISION_AABB && shapeB == COLLISION_POLYGON)
1464
1531
  {
1465
1532
  vec2 halfExtA = objA.visualData.xy * 0.5;
1466
- info = detectCircleAABB(objB.position, objB.visualData.x,
1467
- objA.position, halfExtA, objIndexB);
1468
- info.normal = -info.normal; // Flip normal
1533
+ info = detectAABBPolygon(objA.position, halfExtA,
1534
+ objB.position, objB.visualData.x,
1535
+ int(objB.visualData.y), objB.visualData.z,
1536
+ objIndexB);
1469
1537
  }
1538
+ // Polygon vs AABB (corrected)
1470
1539
  else if (shapeA == COLLISION_POLYGON && shapeB == COLLISION_AABB)
1471
1540
  {
1472
1541
  vec2 halfExtB = objB.visualData.xy * 0.5;
1473
- info = detectCircleAABB(objA.position, objA.visualData.x,
1474
- objB.position, halfExtB, objIndexB);
1542
+ info = detectAABBPolygon(objB.position, halfExtB,
1543
+ objA.position, objA.visualData.x,
1544
+ int(objA.visualData.y), objA.visualData.z,
1545
+ objIndexB);
1546
+ info.normal = -info.normal;
1475
1547
  }
1476
1548
 
1477
1549
  return info;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperstellar
3
- Version: 0.1.69
3
+ Version: 0.1.71
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.69"
7
+ version = "0.1.71"
8
8
  description = "GPU-accelerated physics simulation engine"
9
9
  readme = "README.md"
10
10
  authors = [{name = "Aiden Jabari", email = "Jabariaiden15@email.com"}]
@@ -67,6 +67,8 @@ where = ["hyperstellar/src"]
67
67
 
68
68
 
69
69
 
70
+
71
+
70
72
 
71
73
 
72
74
 
File without changes
File without changes
File without changes