Collision v0.5.12
jumphp/collision · MIT · 0 indirme
Shapes (circle, box, convex polygon), the separating axis test with the minimum translation, rays and a spatial hash broad phase.
JumPHP ^0.5 ile çalışır
Neler getirir
- Circle, Box, convex Polygon (regular(), rotated())
- Collision::test() gives the normal and the depth: how to push apart
- Collision::raycast(): the first shape a ray meets, with its normal
- SpatialHash broad phase and a CollisionWorld service: collisions(), at(), overlapping(), raycast()
- Pure PHP on floats: the same in the browser
Oyununuza ekleyin
bin/jumphp extension:add <game> jumphp/collision
Ya da Composer ile:
bin/jumphp composer <game> require jumphp/collision Servisler: JumPHP\Collision\CollisionWorld
Örnek
$hit = Collision::test($player, $wall);if ($hit) { [$dx, $dy] = $hit->pushOutOfFirst(); $player->translate($dx, $dy); }
Collision
Collisions for JumPHP games (jumphp/collision): circles, boxes and convex polygons, overlap tests with the way out, rays, a broad phase.
Documentation: doc/index.md; sample: samples/ (bin/jumphp extension:add <game> jumphp/collision copies both into your game).
Example game: games/collision-demo.
Bu uzantı hakkındaki yorumlar
GitHub ile giriş Bu uzantıyı puanlamak için GitHub ile giriş yapın.
Henüz yorum yok: ilk siz olun.