CreateComponentInfo::parent_node改名为owner_node

This commit is contained in:
2025-07-27 13:26:43 +08:00
parent a165227292
commit a27150c9d2
2 changed files with 9 additions and 9 deletions

View File

@@ -10,38 +10,38 @@ namespace hgl
struct CreateComponentInfo struct CreateComponentInfo
{ {
graph::SceneNode *parent_node; ///<节点 graph::SceneNode *owner_node; ///<所属节点
graph::Matrix4f mat; ///<矩阵 graph::Matrix4f mat; ///<变换矩阵
public: public:
CreateComponentInfo() CreateComponentInfo()
{ {
parent_node=nullptr; owner_node=nullptr;
mat=graph::Identity4f; mat=graph::Identity4f;
} }
CreateComponentInfo(const CreateComponentInfo &cci) CreateComponentInfo(const CreateComponentInfo &cci)
{ {
parent_node=cci.parent_node; owner_node=cci.owner_node;
mat=cci.mat; mat=cci.mat;
} }
CreateComponentInfo(graph::SceneNode *pn,const graph::Matrix4f &m) CreateComponentInfo(graph::SceneNode *pn,const graph::Matrix4f &m)
{ {
parent_node=pn; owner_node=pn;
mat=m; mat=m;
} }
CreateComponentInfo(graph::SceneNode *pn) CreateComponentInfo(graph::SceneNode *pn)
{ {
parent_node=pn; owner_node=pn;
mat=graph::Identity4f; mat=graph::Identity4f;
} }
CreateComponentInfo(const graph::Matrix4f &m) CreateComponentInfo(const graph::Matrix4f &m)
{ {
parent_node=nullptr; owner_node=nullptr;
mat=m; mat=m;
} }
};//struct CreateComponentInfo };//struct CreateComponentInfo

View File

@@ -245,8 +245,8 @@ public: //Component 相关
*/ */
if(cci) if(cci)
{ {
if(cci->parent_node) if(cci->owner_node)
cci->parent_node->AttachComponent(c); //将组件附加到节点 cci->owner_node->AttachComponent(c); //将组件附加到所属节点
c->graph::SceneOrient::SetLocalMatrix(cci->mat); c->graph::SceneOrient::SetLocalMatrix(cci->mat);
} }