Class unicell_movable_entity2D

Inheritance Relationships

Base Type

Class Documentation

class unicell_movable_entity2D : public cosm::repr::unicell_entity2D

A class representing 2D objects that reside within one or more squares within a 2D grid whose position CAN change during the lifetime of the object.

Public Functions

~unicell_movable_entity2D(void) override = default
inline void danchor2D(const rmath::vector2z &anchor)
template<typename T, typename std::enable_if<T::is_movable(), int>::type = 0>
inline void danchor2D(const rmath::vector2z &danchor)

SFINAE to allow only derived classes that mark themselves as movable to change the initial position of the entity.

Updates the discrete anchor,center. Does not change the real anchor,center of the entity.

inline rmath::vector2z danchor2D(void) const

Return the anchor (LL corner) of the object in discrete coordinates. This ALWAYS exists, evenif if dcenter2D() does not.

inline void ranchor2D(const rmath::vector2d &anchor)
template<typename T, typename std::enable_if<T::is_movable(), int>::type = 0>
inline void ranchor2D(const rmath::vector2d &ranchor)

SFINAE to allow only derived classes that mark themselves as movable to change the initial position of the entity.

Updates the real anchor,center. Does not change the discrete anchor,center of the entity.

inline rmath::vector2d ranchor2D(void) const

Return the anchor (LL corner) of the object in real coordinates.

inline unicell_entity2D(const rtypes::type_uuid &id, const rmath::vector2d &dims, const rmath::vector2d &center, const rtypes::discretize_ratio &resolution)
inline unicell_entity2D(const rtypes::type_uuid &id, const rmath::vector2d &dims, const rtypes::discretize_ratio &resolution)

Public Static Functions

static inline constexpr bool is_movable(void)