simplify logic (#16966)

* simplify logic
* the same logic in c++
This commit is contained in:
minggo
2024-05-10 17:51:08 +08:00
committed by GitHub
parent 3f17039bef
commit 82dfc976e9
2 changed files with 23 additions and 16 deletions
+4
View File
@@ -395,6 +395,10 @@ Node *Node::getChildByPath(const ccstd::string &path) const {
//
void Node::setPositionInternal(float x, float y, float z, bool calledFromJS) {
if (_localPosition.approxEquals({x, y, z})) {
return;
}
_localPosition.set(x, y, z);
invalidateChildren(TransformBit::POSITION);