KRNode::update is now fallible.
Added stub function, KRCamera::update.
This commit is contained in:
@@ -43,6 +43,17 @@ void KRCamera::InitNodeInfo(KrNodeInfo* nodeInfo)
|
|||||||
nodeInfo->camera.skybox_texture = -1;
|
nodeInfo->camera.skybox_texture = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KrResult KRCamera::update(const KrNodeInfo* nodeInfo)
|
||||||
|
{
|
||||||
|
KrResult res = KRNode::update(nodeInfo);
|
||||||
|
if (res != KR_SUCCESS) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO - Implement surface changes
|
||||||
|
// TODO - Implement skybox changes
|
||||||
|
}
|
||||||
|
|
||||||
KRCamera::KRCamera(KRScene& scene, std::string name) : KRNode(scene, name)
|
KRCamera::KRCamera(KRScene& scene, std::string name) : KRNode(scene, name)
|
||||||
{
|
{
|
||||||
m_last_frame_start = 0;
|
m_last_frame_start = 0;
|
||||||
@@ -102,7 +113,6 @@ void KRCamera::setSkyBox(const std::string& skyBox)
|
|||||||
{
|
{
|
||||||
m_pSkyBoxTexture = NULL;
|
m_pSkyBoxTexture = NULL;
|
||||||
m_skyBox = skyBox;
|
m_skyBox = skyBox;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string KRCamera::getSkyBox() const
|
const std::string KRCamera::getSkyBox() const
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public:
|
|||||||
KRCamera(KRScene& scene, std::string name);
|
KRCamera(KRScene& scene, std::string name);
|
||||||
virtual ~KRCamera();
|
virtual ~KRCamera();
|
||||||
|
|
||||||
|
KrResult update(const KrNodeInfo* nodeInfo) override;
|
||||||
|
|
||||||
void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& compositeSurface);
|
void renderFrame(VkCommandBuffer& commandBuffer, KRSurface& compositeSurface);
|
||||||
|
|
||||||
KRRenderSettings settings;
|
KRRenderSettings settings;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ void KRNode::InitNodeInfo(KrNodeInfo* nodeInfo)
|
|||||||
nodeInfo->scale_pivot = Vector3::Zero();
|
nodeInfo->scale_pivot = Vector3::Zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRNode::update(const KrNodeInfo* nodeInfo)
|
KrResult KRNode::update(const KrNodeInfo* nodeInfo)
|
||||||
{
|
{
|
||||||
// TODO - Implement name changes
|
// TODO - Implement name changes
|
||||||
|
|
||||||
@@ -93,6 +93,8 @@ void KRNode::update(const KrNodeInfo* nodeInfo)
|
|||||||
invalidateBindPoseMatrix();
|
invalidateBindPoseMatrix();
|
||||||
invalidateModelMatrix();
|
invalidateModelMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return KR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
KRNode::KRNode(KRScene& scene, std::string name) : KRContextObject(scene.getContext())
|
KRNode::KRNode(KRScene& scene, std::string name) : KRContextObject(scene.getContext())
|
||||||
@@ -297,7 +299,12 @@ KrResult KRNode::createNode(const KrCreateNodeInfo* pCreateNodeInfo, KRScene* sc
|
|||||||
default:
|
default:
|
||||||
return KR_ERROR_NOT_IMPLEMENTED;
|
return KR_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
(*node)->update(&pCreateNodeInfo->node);
|
KrResult res = (*node)->update(&pCreateNodeInfo->node);
|
||||||
|
if (res != KR_SUCCESS) {
|
||||||
|
delete *node;
|
||||||
|
*node = nullptr;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
return KR_SUCCESS;
|
return KR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void InitNodeInfo(KrNodeInfo* nodeInfo);
|
static void InitNodeInfo(KrNodeInfo* nodeInfo);
|
||||||
virtual void update(const KrNodeInfo* nodeInfo);
|
virtual KrResult update(const KrNodeInfo* nodeInfo);
|
||||||
|
|
||||||
KRNode(KRScene& scene, std::string name);
|
KRNode(KRScene& scene, std::string name);
|
||||||
virtual ~KRNode();
|
virtual ~KRNode();
|
||||||
|
|||||||
Reference in New Issue
Block a user