|
Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
|
A 2-dimensional vector. More...
#include <Vec2.hpp>
Public Member Functions | |
| constexpr | Vec2 (void)=default |
| Default constructor. | |
| constexpr | Vec2 (T x, T y) noexcept |
| Parameterized constructor. | |
| constexpr | ~Vec2 ()=default |
| Default destructor. | |
| constexpr bool | operator== (const Vec2 &) const noexcept=default |
| Checks if two vectors are exactly equal. | |
| constexpr auto & | operator[] (this auto &self, size_t index) noexcept |
| Accesses the coordinate at the specified index. | |
Public Member Functions inherited from rtp::details::VecBase< T, 2 > | |
| constexpr auto | squaredDistance (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> T |
| constexpr auto | distance (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> RealT |
| constexpr auto | squaredLength (this const Self &self) noexcept -> T |
| constexpr auto | length (this const Self &self) noexcept -> RealT |
| constexpr auto | normalize (this Self &self) noexcept -> Self & |
| constexpr auto | normalized (this const Self &self) noexcept -> std::remove_cvref_t< Self > |
| constexpr auto | dot (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> T |
| constexpr auto | project (this const Self &self, const std::remove_cvref_t< Self > &other) noexcept -> std::remove_cvref_t< Self > |
| constexpr auto & | operator+= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| constexpr auto & | operator+= (this Self &self, T scalar) noexcept |
| constexpr auto & | operator-= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| constexpr auto & | operator-= (this Self &self, T scalar) noexcept |
| constexpr auto & | operator*= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| constexpr auto & | operator*= (this Self &self, T scalar) noexcept |
| constexpr auto & | operator/= (this Self &self, const std::remove_cvref_t< Self > &other) noexcept |
| constexpr auto & | operator/= (this Self &self, T scalar) noexcept |
Public Attributes | |
| T | x {} |
| T | y {} |
Additional Inherited Members | |
Public Types inherited from rtp::details::VecBase< T, 2 > | |
| using | RealT = std::conditional_t< std::is_integral_v< T >, double, T > |
A 2-dimensional vector.
| T | Must be an integral or floating-point type. |
|
constexprdefault |
Default constructor.
Initializes to (0, 0).
|
constexprnoexcept |
Parameterized constructor.
|
constexprdefaultnoexcept |
Checks if two vectors are exactly equal.
|
constexprnoexcept |
Accesses the coordinate at the specified index.
| index | The index (0 for x, 1 for y). |
| T rtp::Vec2< T >::x {} |
Definition at line 54 of file Vec2.hpp.
Referenced by rtp::server::EntitySystem::createEnemyEntity(), rtp::server::EntitySystem::createObstacleEntity(), rtp::server::EntitySystem::createPlayerEntity(), rtp::server::EntitySystem::createPowerupEntity(), rtp::client::UISystem::getDropdownOptionAtMouse(), rtp::client::UISystem::isMouseOverButton(), rtp::client::UISystem::isMouseOverDropdown(), rtp::client::UISystem::isMouseOverSlider(), rtp::client::UISystem::isMouseOverTextInput(), rtp::client::NetworkSyncSystem::onBeamState(), rtp::client::NetworkSyncSystem::onRoomUpdate(), rtp::server::CollisionSystem::overlaps(), rtp::server::EnemyShootSystem::spawnBullet(), rtp::server::PlayerShootSystem::spawnBullet(), rtp::server::PlayerShootSystem::spawnChargedBullet(), rtp::server::PlayerShootSystem::spawnDebugPowerup(), rtp::server::CollisionSystem::spawnPowerup(), rtp::server::LevelSystem::update(), rtp::client::scenes::MenuScene::update(), rtp::server::BoomerangSystem::update(), rtp::server::EnemyAISystem::update(), rtp::server::HomingSystem::update(), rtp::server::MovementSystem::update(), rtp::server::PlayerShootSystem::update(), and rtp::client::UISystem::updateSliderValue().
| T rtp::Vec2< T >::y {} |
Definition at line 55 of file Vec2.hpp.
Referenced by rtp::server::EntitySystem::createEnemyEntity(), rtp::server::EntitySystem::createObstacleEntity(), rtp::server::EntitySystem::createPlayerEntity(), rtp::server::EntitySystem::createPowerupEntity(), rtp::client::UISystem::getDropdownOptionAtMouse(), rtp::client::UISystem::isMouseOverButton(), rtp::client::UISystem::isMouseOverDropdown(), rtp::client::UISystem::isMouseOverSlider(), rtp::client::UISystem::isMouseOverTextInput(), rtp::client::NetworkSyncSystem::onBeamState(), rtp::server::CollisionSystem::overlaps(), rtp::server::EnemyShootSystem::spawnBullet(), rtp::server::PlayerShootSystem::spawnBullet(), rtp::server::PlayerShootSystem::spawnChargedBullet(), rtp::server::PlayerShootSystem::spawnDebugPowerup(), rtp::server::CollisionSystem::spawnPowerup(), rtp::server::LevelSystem::update(), rtp::server::EnemyAISystem::update(), and rtp::server::PlayerShootSystem::update().