|
group2 0.1.0
CSE 125 Group 2
|
Shared geometry helpers for weapon-pickup proximity tests. More...
#include <cmath>#include <glm/glm.hpp>#include <glm/gtc/constants.hpp>Go to the source code of this file.
Namespaces | |
| namespace | systems |
| Client-only input sampling system — split into two halves so mouse look can run every iterate() (smooth camera at any FPS) while movement keys run once per physics tick group (server-consistent). | |
Functions | |
| bool | systems::overlapsAABB (glm::vec3 aPos, glm::vec3 aHalf, glm::vec3 bPos, glm::vec3 bHalf) |
| Test whether two axis-aligned bounding boxes overlap. | |
| glm::vec3 | systems::viewForward (float yaw, float pitch) |
| Forward direction implied by a player's yaw + pitch. | |
| bool | systems::isPlayerLookingAtPickup (glm::vec3 eye, glm::vec3 viewFwd, glm::vec3 pickupPos) |
| True if the eye is within range of pickupPos and viewFwd points within the look cone. | |
Variables | |
| constexpr float | systems::k_pickupRange = 140.0f |
| Maximum distance (units) at which a player can press F to pick up. | |
| const glm::vec3 | systems::k_weaponPickupHalfExtents {32.0f, 32.0f, 32.0f} |
| Shared pickup collision half-extents for weapon spawners and dropped weapons. | |
| constexpr float | systems::k_pickupMaxAngleDeg = 12.0f |
| Half-angle (degrees) of the look cone for press-F pickup. | |
| const float | systems::k_pickupMinDot = std::cos(glm::radians(k_pickupMaxAngleDeg)) |
| Pre-computed cosine of the look cone half-angle. | |
Shared geometry helpers for weapon-pickup proximity tests.
Used by WeaponSpawnerSystem, DroppedWeaponSystem, and the client-side HUD pickup-prompt sweep so the "is the player close enough and looking at the pickup" rule lives in one place.