minor cleanup
This commit is contained in:
parent
e9d0de8cdd
commit
c33211182a
2 changed files with 4 additions and 8 deletions
|
@ -41,12 +41,6 @@ struct PongStage {
|
||||||
|
|
||||||
auto t = (min_el.second <= eps) ? min_el.first : TouchPoint::None;
|
auto t = (min_el.second <= eps) ? min_el.first : TouchPoint::None;
|
||||||
|
|
||||||
if (t != TouchPoint::None) {
|
|
||||||
sprite.bitmap.pixel(0,0) = paradiso::RGBA::white();
|
|
||||||
} else {
|
|
||||||
sprite.bitmap.pixel(0,0) = paradiso::RGBA::black();
|
|
||||||
}
|
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -116,6 +110,7 @@ struct PongBall {
|
||||||
.scale = paradiso::Vector2<float>::make(0.0125f, 0.0125f),
|
.scale = paradiso::Vector2<float>::make(0.0125f, 0.0125f),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// interaction Stage - Ball
|
||||||
void interact(PongStage& stage) {
|
void interact(PongStage& stage) {
|
||||||
|
|
||||||
auto touch = stage.touch(sprite.pivot);
|
auto touch = stage.touch(sprite.pivot);
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#ifndef PARADISO_AABB_HPP
|
#ifndef PARADISO_AABB_HPP
|
||||||
#define PARADISO_AABB_HPP
|
#define PARADISO_AABB_HPP
|
||||||
|
|
||||||
|
#include <paradiso/globals.hpp>
|
||||||
#include <paradiso/vector.hpp>
|
#include <paradiso/vector.hpp>
|
||||||
|
|
||||||
namespace paradiso {
|
namespace paradiso {
|
||||||
|
@ -32,7 +33,7 @@ struct AABB final {
|
||||||
Vector2<float> top_left{};
|
Vector2<float> top_left{};
|
||||||
Vector2<float> bottom_right{};
|
Vector2<float> bottom_right{};
|
||||||
|
|
||||||
static constexpr AABB from_vertices(auto& vertices) noexcept {
|
static constexpr AABB from_vertices(const auto& vertices) noexcept {
|
||||||
|
|
||||||
Matrix<2, 2, float> min_max;
|
Matrix<2, 2, float> min_max;
|
||||||
min_max.set_slice<2, 1>(0, 0) = vertices.front();
|
min_max.set_slice<2, 1>(0, 0) = vertices.front();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue