Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/native-linter-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ jobs:
clang-tidy --format-style=file --export-fixes=clang-fixes.yaml $FILTERED
fi
- name: clang-tidy-action
uses: PatriceJiang/clang-tidy-action@master
uses: minggo/clang-tidy-action@master
if: hashFiles('clang-fixes.yaml') != ''
with:
fixesFile: clang-fixes.yaml
noFailOnIssue: false
repo-token: ${{ secrets.GITHUB_TOKEN }}
error-limit: 200
env:
ACTIONS_STEP_DEBUG: true
12 changes: 6 additions & 6 deletions native/cocos/core/scene-graph/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,27 +620,27 @@ void Node::setWorldScale(float x, float y, float z) {
Mat3 localRotInv;
Mat4 worldMatrixTmp = _worldMatrix;
Vec3 rescaleFactor;

if (oldWorldScale.x == 0) {
oldWorldScale.x = 1;
worldMatrixTmp.m[0] = 1.F;
rotationFlag = TransformBit::ROTATION;
}

if (oldWorldScale.y == 0) {
oldWorldScale.y = 1;
worldMatrixTmp.m[5] = 1.F;
rotationFlag = TransformBit::ROTATION;
}

if (oldWorldScale.z == 0) {
oldWorldScale.z = 1;
worldMatrixTmp.m[10] = 1.F;
rotationFlag = TransformBit::ROTATION;
}

rescaleFactor = _worldScale / oldWorldScale;

// apply new world scale to temp world matrix
worldMatrixTmp.scale(rescaleFactor); // need opt
// get temp local matrix
Expand All @@ -655,7 +655,7 @@ void Node::setWorldScale(float x, float y, float z) {
_localScale.x = Vec3{localRS.m[0], localRS.m[1], localRS.m[2]}.length();
_localScale.y = Vec3{localRS.m[3], localRS.m[4], localRS.m[5]}.length();
_localScale.z = Vec3{localRS.m[6], localRS.m[7], localRS.m[8]}.length();

if (_localScale.x == 0 || _localScale.y == 0 || _localScale.z == 0) {
rotationFlag = TransformBit::ROTATION;
}
Expand Down
2 changes: 1 addition & 1 deletion native/cocos/core/scene-graph/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ class Node : public CCObject {
uint32_t _hasChangedFlagsVersion{0};
uint32_t _hasChangedFlags{0};

bool _eulerDirty{false};
bool _eulerDirty{true};

friend class NodeActivator;
friend class Scene;
Expand Down
Loading