/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
return success;
}
+bool UpdateProxy::GetOrientation(uint32_t id, Quaternion& orientation) const
+{
+ bool success = false;
+ const SceneGraph::Node* node = GetNodeWithId(id);
+ if(node)
+ {
+ const SceneGraph::TransformManager& transformManager = mTransformManager; // To ensure we call the const getter
+
+ orientation = transformManager.GetQuaternionPropertyValue(node->GetTransformId());
+ success = true;
+ }
+ return success;
+}
+
+bool UpdateProxy::SetOrientation(uint32_t id, const Quaternion& orientation)
+{
+ bool success = false;
+ SceneGraph::Node* node = GetNodeWithId(id);
+ if(node)
+ {
+ mTransformManager.SetQuaternionPropertyValue(node->GetTransformId(), orientation);
+ success = true;
+ }
+ return success;
+}
+
+bool UpdateProxy::BakeOrientation(uint32_t id, const Quaternion& orientation)
+{
+ bool success = false;
+ SceneGraph::Node* node = GetNodeWithId(id);
+ if(node)
+ {
+ mTransformManager.BakeQuaternionPropertyValue(node->GetTransformId(), orientation);
+ success = true;
+ }
+ return success;
+}
+
bool UpdateProxy::GetSize(uint32_t id, Vector3& size) const
{
bool success = false;
return success;
}
+bool UpdateProxy::GetWorldPositionScaleAndSize(uint32_t id, Vector3& position, Vector3& scale, Vector3& size) const
+{
+ bool success = false;
+ const SceneGraph::Node* node = GetNodeWithId(id);
+ if(node)
+ {
+ const SceneGraph::TransformManager& transformManager = mTransformManager; // To ensure we call the const getter
+ const Matrix& worldMatrix = transformManager.GetWorldMatrix(node->GetTransformId());
+
+ Quaternion orientation;
+ worldMatrix.GetTransformComponents(position, orientation, scale);
+
+ size = transformManager.GetVector3PropertyValue(node->GetTransformId(), SceneGraph::TRANSFORM_PROPERTY_SIZE);
+ success = true;
+ }
+ return success;
+}
+
+bool UpdateProxy::GetWorldTransformAndSize(uint32_t id, Vector3& position, Vector3& scale, Quaternion& orientation, Vector3& size) const
+{
+ bool success = false;
+ const SceneGraph::Node* node = GetNodeWithId(id);
+ if(node)
+ {
+ const SceneGraph::TransformManager& transformManager = mTransformManager; // To ensure we call the const getter
+ const Matrix& worldMatrix = transformManager.GetWorldMatrix(node->GetTransformId());
+
+ worldMatrix.GetTransformComponents(position, orientation, scale);
+ size = transformManager.GetVector3PropertyValue(node->GetTransformId(), SceneGraph::TRANSFORM_PROPERTY_SIZE);
+ success = true;
+ }
+ return success;
+}
+
bool UpdateProxy::GetScale(uint32_t id, Vector3& scale) const
{
bool success = false;