hyperstellar 0.1.71__tar.gz → 0.1.73__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.
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/PKG-INFO +1 -1
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/math.comp +22 -79
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/_native/windows-x64/stellar.pyd +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar.egg-info/PKG-INFO +1 -1
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/pyproject.toml +3 -1
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/LICENSE +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/README.md +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/__init__.py +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/__init__.pyi +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.frag +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.geom +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/_native/windows-x64/shaders/quad.vert +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar/py.typed +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar.egg-info/SOURCES.txt +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar.egg-info/dependency_links.txt +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar.egg-info/top_level.txt +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/setup.cfg +0 -0
- {hyperstellar-0.1.71 → hyperstellar-0.1.73}/tests/test.py +0 -0
|
@@ -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
|
|
1113
|
+
// COLLISION DETECTION FUNCTIONS (UNCHANGED - KEEP YOUR EXISTING CODE)
|
|
1114
1114
|
// ============================================================================
|
|
1115
1115
|
|
|
1116
1116
|
// Circle-Circle collision detection
|
|
@@ -1387,72 +1387,6 @@ 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
|
-
|
|
1456
1390
|
// Master collision detection dispatcher
|
|
1457
1391
|
CollisionInfo detectCollision(Object objA, Object objB, int objIndexB)
|
|
1458
1392
|
{
|
|
@@ -1506,11 +1440,13 @@ CollisionInfo detectCollision(Object objA, Object objB, int objIndexB)
|
|
|
1506
1440
|
}
|
|
1507
1441
|
else if (shapeA == COLLISION_AABB && shapeB == COLLISION_CIRCLE)
|
|
1508
1442
|
{
|
|
1443
|
+
// Swap roles and flip normal
|
|
1509
1444
|
vec2 halfExtA = objA.visualData.xy * 0.5;
|
|
1510
1445
|
info = detectCircleAABB(objB.position, objB.visualData.x,
|
|
1511
1446
|
objA.position, halfExtA, objIndexB);
|
|
1512
1447
|
info.normal = -info.normal; // Flip normal
|
|
1513
1448
|
}
|
|
1449
|
+
// Circle vs Polygon
|
|
1514
1450
|
else if (shapeA == COLLISION_CIRCLE && shapeB == COLLISION_POLYGON)
|
|
1515
1451
|
{
|
|
1516
1452
|
info = detectCirclePolygon(objA.position, objA.visualData.x,
|
|
@@ -1526,29 +1462,28 @@ CollisionInfo detectCollision(Object objA, Object objB, int objIndexB)
|
|
|
1526
1462
|
objIndexB);
|
|
1527
1463
|
info.normal = -info.normal; // Flip normal
|
|
1528
1464
|
}
|
|
1529
|
-
// AABB vs Polygon (
|
|
1465
|
+
// AABB vs Polygon (simplified - treat polygon as circle for collision)
|
|
1530
1466
|
else if (shapeA == COLLISION_AABB && shapeB == COLLISION_POLYGON)
|
|
1531
1467
|
{
|
|
1532
1468
|
vec2 halfExtA = objA.visualData.xy * 0.5;
|
|
1533
|
-
info =
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
objIndexB);
|
|
1469
|
+
info = detectCircleAABB(objB.position, objB.visualData.x,
|
|
1470
|
+
objA.position, halfExtA, objIndexB);
|
|
1471
|
+
info.normal = -info.normal; // Flip normal
|
|
1537
1472
|
}
|
|
1538
|
-
// Polygon vs AABB (corrected)
|
|
1539
1473
|
else if (shapeA == COLLISION_POLYGON && shapeB == COLLISION_AABB)
|
|
1540
1474
|
{
|
|
1541
1475
|
vec2 halfExtB = objB.visualData.xy * 0.5;
|
|
1542
|
-
info =
|
|
1543
|
-
|
|
1544
|
-
int(objA.visualData.y), objA.visualData.z,
|
|
1545
|
-
objIndexB);
|
|
1546
|
-
info.normal = -info.normal;
|
|
1476
|
+
info = detectCircleAABB(objA.position, objA.visualData.x,
|
|
1477
|
+
objB.position, halfExtB, objIndexB);
|
|
1547
1478
|
}
|
|
1548
1479
|
|
|
1549
1480
|
return info;
|
|
1550
1481
|
}
|
|
1551
1482
|
|
|
1483
|
+
// ============================================================================
|
|
1484
|
+
// NEW: RESEARCH-GRADE COLLISION RESOLUTION SYSTEM
|
|
1485
|
+
// ============================================================================
|
|
1486
|
+
|
|
1552
1487
|
// ============================================================================
|
|
1553
1488
|
// BASIC COLLISION RESPONSE (Momentum-Conserving)
|
|
1554
1489
|
// ============================================================================
|
|
@@ -2069,6 +2004,10 @@ if (had_collision) {
|
|
|
2069
2004
|
ageContacts(objectIndex);
|
|
2070
2005
|
}
|
|
2071
2006
|
|
|
2007
|
+
// REMOVED: The second collision loop that was causing double-resolution
|
|
2008
|
+
// We no longer need to check i < objectIndex because all pairs are
|
|
2009
|
+
// processed exactly once in the loop above
|
|
2010
|
+
|
|
2072
2011
|
// Apply the collision-corrected state
|
|
2073
2012
|
new_pos = sanitizeVec2(new_pos);
|
|
2074
2013
|
new_vel = sanitizeVec2(new_vel);
|
|
@@ -2106,4 +2045,8 @@ if (had_collision) {
|
|
|
2106
2045
|
objectsOut[gid]._pad1 = 0;
|
|
2107
2046
|
objectsOut[gid]._padEnd[0] = 0;
|
|
2108
2047
|
objectsOut[gid]._padEnd[1] = 0;
|
|
2109
|
-
}
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
// ============================================================================
|
|
2051
|
+
// END OF RESEARCH-GRADE COLLISION SYSTEM
|
|
2052
|
+
// ============================================================================
|
|
Binary file
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hyperstellar"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.73"
|
|
8
8
|
description = "GPU-accelerated physics simulation engine"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{name = "Aiden Jabari", email = "Jabariaiden15@email.com"}]
|
|
@@ -69,6 +69,8 @@ where = ["hyperstellar/src"]
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
72
|
+
|
|
73
|
+
|
|
72
74
|
|
|
73
75
|
|
|
74
76
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{hyperstellar-0.1.71 → hyperstellar-0.1.73}/hyperstellar/src/hyperstellar.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|