Commit Graph

49 Commits

Author SHA1 Message Date
qiuguohua
be5eae04f5 Add ‘screen.on’ interface to listen to screen-related events. (#15080)
* 1、Add ‘screen.on’ interface to listen to screen-related events.
2、Deprecate ‘setResizeCallback’ interface

* Modify comment errors
2023-05-17 17:36:54 +08:00
PP
0b353b6e14 feat: support general WASM module in engine (#14974)
* support pal/wasm module

pal/wasm

* support sys.Feature.WASM and WASM_SUPPORT_MODE

# Conflicts:
#	pal/system-info/web/system-info.ts

# Conflicts:
#	pal/system-info/web/system-info.ts

# Conflicts:
#	pal/system-info/web/system-info.ts

* optimize bullet module


* update physx module

update

* revert tsconfig

* optimize WebGPU wasm import

* fix native wasm instantiate

* support wasm in EDITOR and PREVIEW

* optimize variable name

* update comment

* optimize code

* Update cocos/misc/webassembly-support.ts

* add physx wasm (#11) by yiwenxue

* add physx wasm

* update physx wasm instantiate.

* update, rename, etc.

* download external in CI

* fix physX wasm init

* move out external wasm type

* update external-config.json

* expand node max-old-space-size

* use console.debug

---------

Co-authored-by: Yiwen <15225434259xue@gmail.com>
2023-05-08 18:02:17 +08:00
minggo
a22d16bbe6 Merge branch 'v3.7.3' into merge_v3.7.3 2023-04-24 11:26:58 +08:00
fqamic
36b69d4fd7 engine support to webxr (#14861)
* feat: input support to webxr
1.new webxr gamepad event
2.new webxr handle pose event
3.support webxr hmd pose event

* feat: split the frameMove function to support xr readability

* feat:Add webxrFrameMove for webxr

* improve:xr stands for globalThis.globalXR

* improve(xr):format code

* fix: webxr gamepad update cache error

* fix: webxr gamepad update cache error

* fix: code naming error

* fix: update cache right gamepad data error

* improve: any is enough for any | undefined

* improve: modify interface PoseInfo and IGamepadCacheInfo

* improve: declare IGamepadCacheInfo

* fix: globalThis.__globalXR is undefined

---------

Co-authored-by: linyuanyi <1111>
2023-04-20 23:23:15 +08:00
qiuguohua
ee86fc40bd Native platform modifies exit process (#14141) 2023-02-15 17:11:28 +08:00
fqamic
1f928364f4 fix some xr devices stretch when splash-screen logo and add handle device key (#13915)
* fix: some xr devices stretch when splash-screen logo

* feat: xr handle device support button menu and button start
2022-12-28 11:56:35 +08:00
mmyduckx
2efe60a576 fix game.init assetDB-warning (#13809)
* fix game.init assetDB-warning
2022-12-14 14:31:14 +08:00
minggo
8d8c283b59 Merge branch 'v3.6.3' into merge-v3.6.3 2022-11-28 13:37:25 +08:00
fqamic
2316dc77c1 improve(xr):Rename Handset to Handheld (#13558)
Co-authored-by: linyuanyi <1111>
2022-11-28 11:30:27 +08:00
fqamic
d4055f7e32 new basic capabilities of supporting handset ar and webxr (#13420)
* feat: add the basic capability of handset ar native

* feat: add handset input device, for ar camera pose

* feat: native pack tool supports xr platform name

* feat: web gl context supports webxr

* feat: webxr has been converted to screen coordinates via camera

* fix: pr ts-expect-error undefined xr

* feat: support webxr, and remove ar redundant code

* fix:xr-spaces gradlew permission error

* feat: revert redundant ar engine feature

* fix: eslint check error

* feat: remove redundant code

* fix: eslint check warning

* adjust armodule process in forward stage, mtl texture and jsb

* fix: exlint warning, and add license

* adjust ar lib and interfaces

* change webxr check interface

* merge external arlib header and move it to engine

* improve: update native external version

* move ar background stage to xr/rendering and move its init to webxr device in xr plugin

* fix format error

* fix format error

* adjust jsb_ar_manual, ARModule, ARBackground

* adjust arbackground

Co-authored-by: Parryzhai <1306895355@qq.com>
Co-authored-by: MoHai <1192652394@qq.com>
2022-11-24 13:33:50 +08:00
ycg
827a3f0640 Fix: Update the implementation of the supportWebp on minigame. (#13165)
* Fix: Update the implementation of the supportWebp on minigame.
Optimize: Adjust the initialization of the System-info module.

* Add return type of the sys-init function.

* Add try-catch to _supportsWebp method
2022-10-28 10:44:16 +08:00
ycg
31ad5ab9e1 Adapter System-info on Taobao (#12867)
* Adapter System-info on Taobao

* add  'zh_CN'  for  iPad
2022-09-27 09:52:30 +08:00
QingliWang
6a8f53b186 Add features for XR developement. (#12413)
* Change Android mainloop, add global config and template projects for XR.

* Change gfx/gles device's process flow for XR, working with other PRs, waiting.

* Change gfx/Vulkan device's process flow for XR, working with other PRs, waiting.

* Change render process for XR.

* Develop XR input and events.

* Develop 3D feature of UI widgets and raycast effect for XR.

Co-authored-by: fqamic <fqamic@vip.qq.com>
2022-08-22 16:34:45 +08:00
Santy-Wang
7bc135e1c7 adjust initialization process (#11143)
* adjust init process

* fix bugs

* restructure

* tweak

* delete useless code

* fix ci

* support more platform and fix some bugs

* mark internal

* tweak

* add docs

* add docs and little adjustment

* fix bugs

* adjust decorator execute order

fix mesh error

* fix bugs

* revert some change

* revert auto-generated code

* revert auto-generated code
2022-07-03 21:16:09 +08:00
PP
1fccb90926 support audio PCMData and sampleRate getter (#11470)
* support audio buffer and sampleRate getter

update comment

update interface

update

update comment

update jsb.d.ts

update

* support getPCMData

update

support on native

support on miningame

update

* update comment

* add example doc
2022-06-29 13:39:05 +08:00
PP
e5511822eb support game.end() on Minigame (#11473) 2022-06-14 16:13:51 +08:00
PP
d0bd6b7376 support input dispatch event for Editor (#11471)
* support input dispatch event for Editor

* update internal

* fix eslint

* fix bug

* update
2022-06-14 16:10:18 +08:00
PP
a3f997dfda optimize text baseline on runtime platform (#10751)
* optimize text baseline on runtime platform

* move into minigame module
2022-04-14 16:42:40 +08:00
santy-wang
7ffe1bc031 Merge branch 'v3.4.1' of https://gitlab.cocos.net/publics/engine into v3.5.0 2022-01-06 14:41:28 +08:00
PP
1f58fbff6c cache systemInfo on Cocos Play platform (#9856)
* cache systemInfo on Cocos Play platform

* resize swapChain
2021-12-23 11:40:00 +08:00
santy-wang
6cde877e5b Merge branch 'v3.4.0' of https://gitlab.cocos.net/publics/engine into v3.5.0 2021-11-24 14:23:21 +08:00
PP
1abbc90c23 compability for PROPORTIONAL_TO_FRAME container strategy (#9642)
* support isProportionalToFrame field on screen-adapter

update

stash

* rename _setupContainer to _setupCanvas

* optimize view.setResolutionPolicy()

* remove TIME_OUT to handle resize event

* compability for PROPORTIONAL_TO_FRAME container strategy

comp

update

* add NOTE

* optimize 'window-resize'

resize

* deprecate game.frame && game.container

deprecate

game

* close screen.resolutionScale interface

close

* fix npm test

* fix view unit test

* space
2021-11-11 19:24:39 +08:00
Yun Hsiao Wu
c4827857ad gfx: import from pal/system-info directly (#9595) 2021-11-03 13:49:32 +08:00
PP
51989a1b76 get exactFitScreen option from game initialization (#9594)
* get exactFitScreen option from game initialization

* set HTML5 as true by default

* optimize editor scene resize
2021-11-02 10:25:49 +08:00
PP
1ed2a9833e optimize screen adaption on Web platform (#9580)
* optimize screen._init

* support WindowType on Web platform

* optimize fullscreen adaption

* optimize frame resize

update

* set timeout to handle screen event

* fix esLint

* fix esLint

* fix spelling

* fix number type

* EVENT_TIMEOUT

* fix esLint

* revert naming 'OrientationMap'
2021-11-01 00:01:49 +08:00
PP
f5511f4c87 Revert "Revert "optimize interface in screen module (#9176)"" (#9490)
This reverts commit b88d4845cc.
2021-10-15 10:21:04 +08:00
pandamicro
b88d4845cc Revert "optimize interface in screen module (#9176)"
This reverts commit 4735476945.
2021-10-14 23:07:23 +08:00
PP
4735476945 optimize interface in screen module (#9176)
* optimize interface in screen module

* remove DPR calculating

* update screen-adapter init

* set screen.resolutionScale as 1 by default

* remove pixelRatio getter in system-info

* remove sys.windowPixelRatio access

* optimize screen.windowSize

update

* convertToCocosScreenSpace

* change resolution-change to window-resize

* fix native UI

update

update UI

update UI

* optimize screen init

* fix subContextView

* fix root resize

* fix precision issue on Metal render end

* sys.windowPixelRatio

* use warnID

* remove screen.convertToCocosScreenSpace

* put private property and method together after public ones

* warnID

* fix landScape on CocosPlay

* fix DPR on vivo platform

* fix CI
2021-10-14 22:16:34 +08:00
PP
f433551d1d support system feature query (#9428)
* support feature query in pal/system-info

* support sys.hasFeature and deprecate sys.capabilities

* remove deprecated usage

* support input feature query

update

* IMAGE_BITMAP

* INPUT_TOUCH

* WEBGL

* support WEB_VIEW, VIDEO_PLAYER, SAFE_AREA query

* rename INPUT_XXX  to EVENT_XXX

* support device-manager

update

update

update

* add NOTE

* export deviceManager from gfx

* fix circular dependency

* fix wechat devtools

update

* Revert "fix circular dependency"

This reverts commit ba8a6c0e2e.

* Revert "export deviceManager from gfx"

This reverts commit 14b26ca0e3.

* Revert "support device-manager"

This reverts commit 010a910e56.

# Conflicts:
#	pal/system-info/enum-type/feature.ts

* update

update

* use INPUT_TOUCH for sys.capabilities

* update
2021-10-14 10:29:36 +08:00
PP
81fdaf346d support input module (#9327)
* support input module

* don't export eventManager
2021-09-18 19:25:08 +08:00
PP
ccd505ad14 migrate Engine Input Event into PAL (#9320)
* optimize input module

* rename

* fix CI

* update input-box.d.ts
2021-09-15 13:51:38 +08:00
PP
8188d27405 fix npm install (#9315) 2021-09-10 16:35:04 +08:00
PP
97b3657549 migrate input module out of platform (#9296)
* migrate input module out of platform

* revert EventKeyboard.isPressed deprecation

* fix CI
2021-09-07 15:24:43 +08:00
PP
5a4bed2379 support inputManager.frameDispatchEvents() in main loop (#8954)
* support pollEvent() API on pal/input

update

update pal

* support inputManager.frameDispatchEvents() in main loop

* remove event-manager module

* fix CI

* fix _glView

* fix CI

* fix director pause

* update for
2021-07-16 13:45:01 +08:00
PP
d7067c29c8 deprecate interface in View module && support pal/screenManager (#8836)
* remove BrowserGetter

* deprecated view.adjustViewportMeta

* deprecate view.enableAutoFullScreen and view.isAutoFullScreenEnabled

* remove view._adjustSizeKeepCanvasSize

* remove view._convertMouseToLocation, view._convertTouchWidthScale and view._convertTouchesWithScale

* remove view._originalDesignResolutionSize

* deprecate cc.winSize and cc.visibleRect

update

* access local winSize

* access local visibleRect

* deprecate view.getVisibleOrigin view.getVisibleOriginInPixel

* Revert "deprecate view.getVisibleOrigin view.getVisibleOriginInPixel"

This reverts commit 1ae9e1d5c51d8c701eaa2e4a65cd4c17e5f6d971.

* Revert "deprecate cc.visibleRect"

* optimize screen module

update

* update

update

* optimize deprecation info

* rename pal/system to pal/systemInfo

* update pal/systemInfo access in engine layer

* support pal/screenManager

* update pal/screenManager access in engine layer

* fix bug

* optimize deprecation info

* fix auto fullscreen

* fix ci

* fix ci

* update change request

update

update

* fix CI
2021-07-09 18:57:03 +08:00
PP
40789fa069 implement WebAudio on ByteDance platform (#8802)
* rename AudioPlayerMinigame

* optimize Show Hide

* support ByteDanceAPI

* support WebAudio on ByteDance

remove maxAudioChannel

* cache audio buffer
2021-06-24 18:57:42 +08:00
PP
d85cee16df remove legacy adapter in Wechat PC game (#8626)
* support keyboardEvent on wx pc game

update

update

# Conflicts:
#	pal/input/minigame/keyboard.ts

* support mouse event

* move in gl.useProgram adapting

* remove legacy adapter

update

* update

update

update

update

* rename interface

* bind method
2021-06-24 11:37:16 +08:00
PP
7e55ddf133 support SystemEvent.Keyboard enum type (#8785)
* support SystemEvent.Keyboard enum type

update

update

update

update

# Conflicts:
#	cocos/core/platform/event-manager/system-event.ts

update pal

mark macro.KEY as warning

mark

update

update

* support right shift, alt and ctrl enum

* support web keyCode map

# Conflicts:
#	pal/input/web/keyboard.ts

* support num enter key enum

* rename num_slash to num_divide

* support native keyCode map

# Conflicts:
#	pal/input/native/keyboard.ts

* update enum

* rename Keyboard to KeyCode

* update deprecated

* update
2021-06-09 15:12:51 +08:00
PP
4914116834 optimize SystemEventType and NodeEventType (#8678)
* remove recomendation for usage of string type of event

* deprecate KEY_DOWN KEY_UP event

* support SystemEventType.KEYBOARD_DOWN && SystemEventType.KEYBOARD_UP

* deprecate some useless properties

* implement keyboard pal

* remove SystemEventType toString()

update

* fix instantiating EventTouch

* optimize deprecated info

* support native keyboard KEYBOARD_DOWN event

* remove usage of event code

* fix deprecating pure value properties

* optimize deprecating Event type

* optimize deprecating getEventCode()

update

* optimize deprecating eventType

* optimize deprecating isPressed

* optimize deprecating keybaord event

* optimize deprecating rawEvent

* Revert "fix deprecating pure value properties"

This reverts commit 60d586532496fa1f422f05c54a922b86d1dc96ee.

* fix deprecate pure value properties

* Revert "fix deprecate pure value properties"

This reverts commit a83f1725fedfbd7af445892912aacab8e8502147.

* fix deprecating pure value property

* update

updaate

* deprecate some EventType enum in SystemEventType and NodeEventType

* optimize

* update

update

* update

* update

* fix CI

* fix CI

* fix Circular dependency

* fix Circular dependency
2021-06-07 19:06:29 +08:00
PP
6c03fd936a support system.onClose(cb) && system.close() (#8674)
* support `system.onClose(cb)`

update

* optimize game.end()

* update
2021-06-02 14:47:40 +08:00
PP
420c9f59d4 support system.getSafeAreaEdge() (#8654)
* support system.getSafeAreaEdge()

* remove legacy adapter

* remove code

* update
2021-05-17 18:12:13 +08:00
PP
c89fe8bfdd compatible movement data in MouseEvent on Web && fix keyCode in keydown event (#8578)
* compatible movement data in MouseEvent on Web

* revert keypress Event to keydown
2021-04-28 17:28:50 +08:00
PP
cd1548d3f6 fix Audio bug (#8515)
* support AudioPlayer.loadOneShotAudio

* support native

* support minigame

* support createInnerAudioContextPolyfill

update

* fix audioLoading on runtime

* fix Safari doesn't support promise based decodeAudioData

* optimize interface design

* add onPlay polyfill for vivo

* fix setting AudioSource.clip concurrently

* add createInnerAudioContextPolyfill for Xiaomi

* add createInnerAudioContextPolyfill on Baidu

* fix web audio player currentTime
2021-04-23 18:07:58 +08:00
PP
cf554645f0 fix touch event on alipay (#8507)
update
2021-04-20 19:54:31 +08:00
PP
86f20da0f0 support pal/input (#8472)
* support pal/input

update

* update

* fix esLint

* support minigame

* support  pal/input on  minigame

* remove minigame.isSubContext

* support native

update

* deprecate static property on EventMouse

* deprecated static property in  EventTouch

* remove TODO

* remove  x y position in MouseWheel Event

* remove TODO

* remove temp code

* fix esLint

* update AccelerometerIntervalMode

* remove legacy code in JSB

* fix esLint

* optimize AccelerometerInputSource.setInterval

* fix esLint

* optimize code

* add more details for documentation

* update

* don't pass game.canvas to inputManager.registerSystemEvent

* optimize

* Revert "remove  x y position in MouseWheel Event"

This reverts commit b521ec4948.

# Conflicts:
#	@types/pal/input.d.ts

* update

* fix esLint

* fix esLint
2021-04-19 16:24:42 +08:00
PP
9bb4c4f8ea support pal/system (#8441)
* support pal/app

update

update

* remove 'QQ_PLAY' and 'FB_PLAYABLE_ADS'

* rename system

update

* rename Language

* update

* update

* bind function in Game.ts

* rename system

* support system.getBatteryLevel()

* support pal/system on native

* support pal/system on minigame

* update

* fix esLint

* fix Circular dependency

* fix esLint

* use math/Size
2021-04-15 11:00:54 +08:00
Leslie Leigh (李的序)
2987cecd9a Optimize the document on pal/audio (#8402)
* Optimize the document on pal/audio

* Update @types/pal/audio.d.ts

Co-authored-by: PP <chinese1236@qq.com>

* Update @types/pal/audio.d.ts

Co-authored-by: PP <chinese1236@qq.com>

* Update @types/pal/audio.d.ts

Co-authored-by: PP <chinese1236@qq.com>

Co-authored-by: PP <chinese1236@qq.com>
Co-authored-by: Santy-Wang <wh19930829@qq.com>
2021-04-14 13:55:18 +08:00
PP
831722c121 optimize pal (#8405)
* rename mg

* optimize audioMgr

* remove implement class

update

* add src property for AudioPlayer

* fix multiple audioSource reference the same audioClip

* support operation-queue

update

* fix operation deadlock

* update

* fix esLint

update

update

* remove ensureStop

remove stop in play

* fix audio-dom loading

* optimize operation queue in AudioSource component

* HACK on runtime

* fix esLint

* update esLint

* HACK on WeChat DevTools

* lowercase enqueueOperationDecorator

* remve ! with @ts-expect-error

* Revert "HACK on WeChat DevTools"

This reverts commit 230a2ec922.

* fix esLint

* rename clip.ts to audio-clip.ts

* add audio meta

* use fastRemoveAt

* change ClassDecorator to MethodDecorator

* remove  player reference in audio-clip

* destroy temporary AudioPlayer after loading

* optimize syncPlayer

* fix esLint

* fix esLint

* optimize audio-manager

* optimize operation-queue

update

* fix eslint
2021-04-09 15:21:11 +08:00
PP
cd7e644694 implement audio on pal (#8255)
* Update logo in README

* add pal/audio

* deprecate property

* support wechat  game AudioPlayer

* unify minigame interface

* optimize module name

* support  native audio

# Conflicts:
#	@types/jsb.d.ts

* add runtime platform

* fix module

* support build native virtual module

update

update

* update module name

* remove jsb-audio.js

* revert @rollup/plugin-alias

* add quickCompiler field in cc.config.json

* fix audio can't stop when paused

* fix esLint & ci

* fix ci

update

* update ccConfigJson

* add NOTE

* readonly maxAudioChannel

* add description for interface OneShotAudio

* volume range

* range for seeking

* loadNative return Promise<unknown>

* remove quickCompile field in cc.config.json

Co-authored-by: pandamicro <lphuabin@gmail.com>
Co-authored-by: Jare Guo <jareguo@users.noreply.github.com>
2021-03-25 14:30:13 +08:00