19 child->SetParent(
nullptr);
31 return static_cast<int>(
mChild.size());
38 LogError(
"You cannot attach null children to a node.");
42 if (child->GetParent())
44 LogError(
"The child already has a parent.");
48 child->SetParent(
this);
52 for (
auto& current :
mChild)
63 int const numChildren =
static_cast<int>(mChild.size());
64 mChild.push_back(child);
73 for (
auto& current :
mChild)
77 current->SetParent(
nullptr);
89 if (0 <= i && i < static_cast<int>(
mChild.size()))
91 std::shared_ptr<Spatial> child =
mChild[i];
94 child->SetParent(
nullptr);
104 for (
auto& current :
mChild)
111 std::shared_ptr<Spatial>
const& child)
115 LogAssert(!child->GetParent(),
"The child already has a parent.");
118 int const numChildren =
static_cast<int>(
mChild.size());
119 if (0 <= i && i < numChildren)
122 std::shared_ptr<Spatial> previousChild =
mChild[i];
125 previousChild->SetParent(
nullptr);
131 child->SetParent(
this);
135 return previousChild;
141 child->SetParent(
this);
149 if (0 <= i && i < static_cast<int>(
mChild.size()))
160 for (
auto& child :
mChild)
164 child->Update(applicationTime,
false);
177 for (
auto& child :
mChild)
193 std::shared_ptr<Camera>
const& camera,
bool noCull)
195 for (
auto& child :
mChild)
199 child->OnGetVisibleSet(culler, camera, noCull);
virtual void UpdateWorldData(double applicationTime)
#define LogAssert(condition, message)
int GetNumChildren() const
virtual void GetVisibleSet(Culler &culler, std::shared_ptr< Camera > const &camera, bool noCull)
std::shared_ptr< Spatial > SetChild(int i, std::shared_ptr< Spatial > const &child)
void SetRadius(float radius)
#define LogError(message)
std::shared_ptr< Spatial > GetChild(int i)
std::vector< std::shared_ptr< Spatial > > mChild
int AttachChild(std::shared_ptr< Spatial > const &child)
virtual void UpdateWorldData(double applicationTime)
std::shared_ptr< Spatial > DetachChildAt(int i)
BoundingSphere worldBound
void GrowToContain(BoundingSphere const &sphere)
virtual void UpdateWorldBound()
int DetachChild(std::shared_ptr< Spatial > const &child)
void SetCenter(Vector4< float > const ¢er)