— MatrixEngineWGPU instance
— cube mesh for projectile/decal visuals
— CollisionSystem instance
Optionalopts: {OptionaldecalLifetime?: numberOptionaldecalSize?: numberOptionaldecalTex?: stringOptionalonHitscanHit?: Function— callback(hitPoint, normal, reflect, entry)
OptionalonProjectileHit?: Function— callback(hitPoint, normal, entry)
OptionalprojectileLifetime?: number— ms before auto-despawn
OptionalprojectileScale?: numberOptionalprojectileSpeed?: numberOptionalprojectileTex?: stringInstant raycast from camera forward. Tests all static collision entries, spawns decal on hit.
OptionalmaxDist: number = 200
Description
ProjectileSystem — FPS projectile manager for the beast
Two modes: hitscan — instant raycast, no moving mesh (bullets) projectile — moving mesh using Position.translateByXYZ (rockets)
Position.update() is called by the engine each frame automatically. Hook collision check into your game loop manually — see comment below.