Files
our_dick/include/engine/flat_object.hpp

63 lines
1.7 KiB
C++

/**
This file is a part of our_dick
Copyright (C) 2022 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUR_DICK_ENGINE_FLAT_OBJECT_HPP
#define OUR_DICK_ENGINE_FLAT_OBJECT_HPP
#include "math/vec.hpp"
namespace egn{
namespace flat{
class object_base
{
protected:
math::vec2f m_position;
math::vec2f m_scale;
float m_orientation;
public:
object_base(void) = default;
object_base(const math::vec2f& position, float orientation = 0);
object_base(const object_base&) = default;
object_base(object_base&&) = default;
~object_base(void) = default;
object_base& operator=(const object_base&) = default;
object_base& operator=(object_base&&) = default;
void translate(const math::vec2f& distance);
void rotate(float distance);
void scale(const math::vec2f& distance);
void look_at(const math::vec2f& target);
void set_position(const math::vec2f& pos);
void set_orientation(float orient);
void set_scale(const math::vec2f& scale);
const math::vec2f& position(void)const;
float orientation(void)const;
const math::vec2f& scale(void)const;
};
}
}
#endif