33#ifndef DVD_OBJECT_3D_H_
34#define DVD_OBJECT_3D_H_
69 [[nodiscard]]
const VertexBuffer_ptr& geometryBuffer();
71 inline void geometryBuffer(
const VertexBuffer_ptr& vb)
noexcept { _geometryBuffer = vb; }
73 virtual void onAnimationChange([[maybe_unused]]
SceneGraphNode* sgn, [[maybe_unused]]
const U32 newIndex) {}
75 [[nodiscard]]
U8 getGeometryPartitionCount()
const noexcept {
77 for (
auto partition : _geometryPartitionIDs) {
87 [[nodiscard]]
U16 getGeometryPartitionID(
const U8 lodIndex)
noexcept {
88 return _geometryPartitionIDs[std::min(lodIndex,
to_U8(_geometryPartitionIDs.size()))];
91 void setGeometryPartitionID(
const U8 lodIndex,
const U16 partitionID)
noexcept {
92 if (lodIndex < _geometryPartitionIDs.size()) {
93 _geometryPartitionIDs[lodIndex] = partitionID;
99 if (!computeTriangleList(partitionID))
104 return _geometryTriangles[partitionID];
109 if (partitionID >= _geometryTriangles.size())
111 _geometryTriangles.resize(
to_size(partitionID) + 1);
114 _geometryTriangles[partitionID].insert(cend(_geometryTriangles[partitionID]),
119 [[nodiscard]]
bool saveCache(
ByteBuffer& outputBuffer)
const override;
120 [[nodiscard]]
bool loadCache(
ByteBuffer& inputBuffer)
override;
122 void saveToXML(boost::property_tree::ptree& pt)
const override;
123 void loadFromXML(
const boost::property_tree::ptree& pt)
override;
130 [[nodiscard]]
bool computeTriangleList(
U16 partitionID,
bool force =
false);
132 virtual void rebuildInternal();
137 std::array<U16, 4> _geometryPartitionIDs;
142 VertexBuffer_ptr _geometryBuffer =
nullptr;
#define DEFINE_NODE_BASE_TYPE(Name, Enum)
static constexpr U16 INVALID_PARTITION_ID
Handle console commands that start with a forward slash.
FORCE_INLINE constexpr PrimitiveTopology GetGeometryBufferType(const SceneNodeType type) noexcept
SceneNodeType
ToDo: Move particle emitter to components (it will make them way more dynamic) - Ionut.
eastl::vector< Type > vector
constexpr U8 to_U8(const T value)
eastl::fixed_vector< GenericDrawCommand, 1, true > GenericDrawCommandContainer
FORCE_INLINE constexpr bool Is3DObject(const SceneNodeType type) noexcept
constexpr size_t to_size(const T value)