When loadScene is called with a URL whose cached Scene is the current active
scene, resourceManager.load returned the same instance, then destroyOldScene
branch destroyed it and re-added it—leaving rootEntities empty and the native
PhysicsScene released. Now evict the cached Scene asset before load so a fresh
Scene instance is created, matching director.loadScene semantics in Cocos.
Previously `Signal._addListener` applied bound arguments first and runtime
signal args last, producing `method(...boundArgs, ...signalArgs)`. This made
the event object's position shift with the number of bound arguments and
diverged from the DOM / Cocos `(event, customEventData)` convention.
Flip the order so the listener method receives runtime args first and bound
args last: `method(...signalArgs, ...boundArgs)`. The event object now always
sits at index 0, making migrated Cocos scripts with `(event, customData)`
signatures work without rewrites.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Single-root GLTF scenes no longer wrap the root node in a GLTF_ROOT
container, which avoids redundant nesting and fixes animation path
resolution for models like Mixamo characters.
- GLTFSceneParser: single-root scenes use the node directly as scene root
- GLTFAnimationParser: remove single-root path prefixing (no longer needed)
- Entity.findByPath: prefer real same-name child over legacy self-name prefix
- Add AGENTS.md to .gitignore
Remove single-root vs multi-root branching in GLTFSceneParser, always
creating a GLTF_ROOT wrapper entity. This ensures animation bone paths
are consistent across different glTF files, fixing cross-file animation
clip retargeting.
When sizeMode is set to Automatic, the UITransform size is automatically
synchronized to the sprite's natural dimensions when the sprite changes.
This matches Cocos Creator's Sprite.SizeMode.TRIMMED behavior.
- Add SpriteSizeMode enum (Custom / Automatic)
- Add sizeMode property to Image with getter/setter
- Sync UITransform.size in set sprite and _onSpriteChange
- Export SpriteSizeMode from component index
AnimatorState.speed is part of the shared AnimatorController asset.
Modifying it at runtime pollutes all Animator instances sharing the
same controller, causing animation speed corruption after cloning.
- Add speed field to AnimatorStatePlayData, initialized from AnimatorState.speed on reset
- Add proxy properties (name/clip/wrapMode/transitions/addStateMachineScript)
- Change speed calculation to playData.speed * animator.speed
- findAnimatorState now returns per-instance AnimatorStatePlayData
- Export AnimatorStatePlayData for consumer code
The viewMatrix getter intentionally ignores the camera entity's world scale
(using Matrix.rotationTranslation), but _getInvViewProjMat() was using the
full entity.transform.worldMatrix which includes inherited scale. This
inconsistency causes screenPointToRay to produce incorrect world-space rays
when the camera inherits scale from a parent entity (e.g. UICanvas in
ScreenSpaceCamera mode with camera as a child of canvas).
Closes#2748
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GLES100 visitJumpStatement converted `return expr;` to `gl_FragColor = expr`
without a trailing semicolon, causing WebGL compilation errors. Only triggered
when fragment entry returns vec4 (Cocos pattern), not void (standard Galacean).
- Suppress `uniform` output for global struct-typed variables (e.g. `Varyings o;`)
- Register global struct vars in both per-function and cross-stage maps
- Unify macro member access scanning into callback-based _forEachMacroMemberAccess
- Add registerStructVar() encapsulation in VisitorContext
- Add Cocos VSOutput pattern test (global-varying-var)
Build a combined _globalStructVarMap in visitShaderProgram by scanning
both vertex and fragment entry functions, so global #define values like
`attr.POSITION` or `o.v_uv` are correctly transformed in all stages.
Rewrite define-struct-access tests to use snapshot file comparison
against expected/ GLSL outputs for clearer verification.