Improve camera default mode, refactor math module, rename PointerEvent API, add source checking CI - #3228
Merged
Conversation
Collaborator
Author
|
/clang-format |
2 similar comments
Collaborator
Author
|
/clang-format |
Collaborator
|
/clang-format |
halx99
force-pushed
the
improve-camera-default
branch
from
July 7, 2026 11:58
e8ead9e to
9f90bf9
Compare
Collaborator
Author
|
/clang-format |
Collaborator
Author
|
/clang-format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Summary
1. Camera Improvements (axmol/scene/)
Camera::create()now accepts aCameraModeparameter (defaultClassic) instead of inferring fromDirector::getProjectioninitDefault()renamed toinitClassic()— initializes the camera with Classic calibrated perspective modeAX_ENABLE_3Dguards fromscreenToRay(),isVisibleInFrustum(), and related members — 3D math types are always availableCameraMode::Classicinstead of reading oldaxmol.gl.projectionenv var2. PointerEvent API Renames
getScreenLocation()getPoint()getPreviousScreenLocation()getPrevPoint()getStartScreenLocation()getStartPoint()getLocation()getWorldPoint()getPreviousLocation()getPrevWorldPoint()getStartLocation()getStartWorldPoint()getWorldPoint()now computes world position via the per-camera ray (Camera::screenToRay) instead of callingDirector::screenToWorld()getPrevWorldPoint()andgetStartWorldPoint()also switched to ray-based computationPointerType::Controllerin world point methods3. EventDispatcher / Hit-Testing Refactor
pointerHitTest()now sets the ray on the event viacamera->screenToRay()before dispatching (except forControllertype)onPointerHitTestsignature simplified: thecameraparameter removed from the callback — camera info is obtained viaevent->getCamera()/event->getRay()Menu::hitTestNodeWithPointer()updated to always use ray-based hit testing (no longer falls back tocamera->isWorldPointInRect)4. Math Module Relocation
axmol/3d/→axmol/math/:AABB.h/.cpp,Frustum.h/.cpp,OBB.h/.cpp,Plane.h/.cpp,Ray.h/.cppAX_ENABLE_3Dguards)axmol/math/CMakeLists.txtupdated with new sources5. Types.h Simplification
Tex2F,Quad2,Quad3,V2F_T2F_C4B, etc.) moved fromaxmol/base/Types.htoaxmol/math/Vertex.hTypes.hnow includesVertex.hinstead of defining them inline6. Director Cleanup
Director::setProjection(Projection)Director::screenToWorld(Vec2)/Director::worldToScreen(Vec2)Director::EVENT_PROJECTION_CHANGEDand its dispatchaxmol.gl.projectionsupport_eventProjectionChangedmemberCamera::deprojectScreenToWorld()for world-space conversion7. CI / Tooling
tools/cmdline/check-sources.ps1— checks for UTF-8 BOM and cstd-header issues in source filesclang-format.ymlrenamed tosource-tidy.yml— now runs both clang-format and check-sources in a single workflowcheck-sources.ymldeleted (merged into source-tidy)check-cstd-headers.ymlrenamed tocheck-sources.yml→ then merged into source-tidy8. BOM Removal
\xEF\xBB\xBF) stripped from engine source files acrossaxmol/,tests/,extensions/,templates/.h,.cpp,.inl,.mm,.mfiles affectedsource-tidy.ps19. Lua Test Updates
tests/lua-tests/Content/src/files updated to use new PointerEvent API namesgetLocation()→getWorldPoint()(47 occurrences)getScreenLocation()→getPoint()(14 occurrences)10. 3D Project Template
templates/cpp/3d/— starter template for 3D projects withMainScene.cpp/.hFiles Changed
.github/workflows/check-cstd-headers.ymlclang-format.yml→source-tidy.yml, AABB/Frustum/OBB/Plane/Ray moved from3d/tomath/check-sources.ps1,PipelineDesc.h(in rhi/),MainScene.cpp/.hIssue ticket number and link
Checklist before requesting a review
For each PR
Add Copyright if it missed:
-
"Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."I have performed a self-review of my code.
Optional:
For core/new feature PR
Axmol 3.x ------------------------------------------------------------
For each 3.x PR