implement grid and heightmap with lambert shading
This commit is contained in:
12
src/node.h
12
src/node.h
@@ -188,6 +188,18 @@ public:
|
||||
return static_cast<T*>(found);
|
||||
return nullptr;
|
||||
}
|
||||
template<class T = Node> std::shared_ptr<T> find_ref(const char* ids)
|
||||
{
|
||||
uint16_t id = const_hash(ids);
|
||||
for (auto& c : m_children)
|
||||
{
|
||||
if (c->m_nodeID == id)
|
||||
return std::static_pointer_cast<T>(c);
|
||||
else if (auto found = c->find_ref(ids))
|
||||
return std::static_pointer_cast<T>(found);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
template<class T> T* add_child()
|
||||
{
|
||||
auto* n = new T;
|
||||
|
||||
Reference in New Issue
Block a user