void GameObject::Draw() { if (this->visible) { this->transform->Draw(); #if USING_RUNTIME_COMPUTED_BONE_MATRICES // TODO [Cleanup] Cache the Armature, maybe Armature* armature = this->GetComponent<Armature>(); if (armature != nullptr) { armature->Bind(); } #elif USING_BAKED_BONE_MATRICES // TODO [Cleanup] Cache the BakedSkeletalAnimation component, maybe BakedSkeletalAnimation* bakedSkeletalAnimation = this->GetComponent<BakedSkeletalAnimation>(); if (bakedSkeletalAnimation != nullptr) { bakedSkeletalAnimation->Bind(); } #endif // TODO [Cleanup] Cache the Renderer, maybe Renderer* renderer = this->GetComponent<Renderer>(); if (renderer != nullptr) { renderer->Draw(); } } }