Better Camera, Cleaner Math, Tighter CI #3230
halx99
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We are excited to announce a significant refactoring batch that touches the core of the engine. PR #3228 improves camera handling, simplifies the math module, modernizes pointer events, and tightens our CI pipeline.
🎯 Camera Now in Control
The biggest change: the camera is no longer a second-class citizen driven by
Director::setProjection(). Instead,Camera::create()now accepts an explicitCameraModeparameter:auto camera = Camera::create(CameraMode::Classic);The old
initDefault()is renamed toinitClassic()to better reflect what it does. We also removed the deprecatedaxmol.gl.projectionenv var and theDirector::setProjection/Director::screenToWorld/Director::worldToScreenmethods — all camera math now lives on theCameraclass where it belongs.🖱️ PointerEvent Gets a Clean API
The PointerEvent API has been renamed for clarity. The confusing
getLocation()(which returned a world position) is nowgetWorldPoint(), andgetScreenLocation()is now simplygetPoint():getScreenLocation()getPoint()getPreviousScreenLocation()getPrevPoint()getStartScreenLocation()getStartPoint()getLocation()getWorldPoint()getPreviousLocation()getPrevWorldPoint()getStartLocation()getStartWorldPoint()World point computation now uses the per-camera ray (
Camera::screenToRay) instead of the oldDirector::screenToWorld(), producing more accurate results in multi-camera setups.🧮 Math Module Unlocked
AABB,Frustum,OBB,Plane, andRayhave moved fromaxmol/3d/toaxmol/math/— they are no longer gated behindAX_ENABLE_3D. This means 3D math types are available everywhere without conditional compilation.At the same time,
axmol/base/Types.hhas been slimmed down: vertex structs likeTex2F,Quad2,Quad3were moved toaxmol/math/Vertex.h.🔧 Hit Testing Simplified
The hit-testing path in
EventDispatcherwas streamlined. Thecameraparameter was removed fromonPointerHitTestcallbacks since the camera is already accessible viaevent->getCamera(). The ray is now set automatically on the event before dispatch, so nodes only need to checkevent->getRay().🧹 CI & Code Quality
check-sources.ps1— a new script validates that no source file contains a UTF-8 BOM and that all include guards follow the cstd convention.clang-format.ymlrenamed tosource-tidy.ymland now runs both clang-format and the source checks in one job.📦 Full Stats
templates/cpp/3d/Check the full diff for details.
All reactions