Experiment with rotation
This commit is contained in:
@@ -54,6 +54,13 @@ namespace JabyEngine {
|
||||
return *static_cast<T*>(this);
|
||||
}
|
||||
|
||||
constexpr PositionI16 get_rect_pos() const {
|
||||
return PositionI16::create(
|
||||
static_cast<const T*>(this)->vertex0.x,
|
||||
static_cast<const T*>(this)->vertex0.y
|
||||
);
|
||||
}
|
||||
|
||||
constexpr SizeI16 get_rect_size() const {
|
||||
return SizeI16::create(
|
||||
static_cast<const T*>(this)->vertex1.x - static_cast<const T*>(this)->vertex0.x,
|
||||
|
@@ -264,7 +264,19 @@ namespace JabyEngine {
|
||||
return Area(this->position.sub(this->size.width/2, this->size.height/2), this->size);
|
||||
}
|
||||
|
||||
constexpr Position<T> get_top_left() const {
|
||||
return this->position;
|
||||
}
|
||||
|
||||
constexpr Position<T> get_top_right() const {
|
||||
return this->position.add(this->size.width, 0);
|
||||
}
|
||||
|
||||
constexpr Position<T> get_bottom_left() const {
|
||||
return this->position.add(0, this->size.height);
|
||||
}
|
||||
|
||||
constexpr Position<T> get_bottom_right() const {
|
||||
return this->position.move(this->size.width, this->size.height);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user