30 lines
1.1 KiB
C++
30 lines
1.1 KiB
C++
#pragma once
|
|
|
|
namespace aethera::render_3d::detail {
|
|
inline bool Labels_Spec::valid(const Item& item) noexcept {
|
|
return finite(item.position) && finite(item.extent) && item.extent.x > 0.0F && item.extent.y > 0.0F &&
|
|
finite(item.texture_rectangle);
|
|
}
|
|
|
|
} // namespace aethera::render_3d::detail
|
|
|
|
namespace aethera::render_3d {
|
|
/* 具体 Visual 复用 Basic_Visual 的 Prepare、发布及缓冲推进钩子。 */
|
|
struct Labels_Visual::Private : Prev_Private {};
|
|
}
|
|
|
|
namespace aethera::render_3d::detail {
|
|
|
|
inline void Labels_Spec::prepare(const std::vector<Item>& items, Prepared_Data& output) {
|
|
output.positions.reserve(items.size());
|
|
output.extents.reserve(items.size());
|
|
output.texture_rectangles.reserve(items.size());
|
|
for (const auto& item : items) {
|
|
output.positions.push_back({item.position.x, item.position.y, item.position.z});
|
|
output.extents.push_back({item.extent.x, item.extent.y});
|
|
output.texture_rectangles.push_back(
|
|
{item.texture_rectangle.x, item.texture_rectangle.y, item.texture_rectangle.z, item.texture_rectangle.w});
|
|
}
|
|
}
|
|
}
|