From ab97ba243a93d2b6325032c1a6affa80017eda92 Mon Sep 17 00:00:00 2001 From: "jiaxin.lai" Date: Mon, 18 Nov 2019 10:41:28 +0800 Subject: [PATCH 1/3] revert splash ios adapt (#5753) --- cocos/core/splash-image.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/cocos/core/splash-image.ts b/cocos/core/splash-image.ts index 870f8c3438..a2313cdfeb 100644 --- a/cocos/core/splash-image.ts +++ b/cocos/core/splash-image.ts @@ -166,27 +166,13 @@ export class SplashScreen { this.effect.shaders = this.program.shaders; this.effect.onLoaded(); - this.callBack = null; this.cancelAnimate = false; this.startTime = -1; this.clearColors = [this.setting.clearColor]; this.device = device; - - /** IOS adapt, use native size */ this.screenWidth = this.device.width; this.screenHeight = this.device.height; - if (this.device.nativeWidth < this.device.nativeHeight) { - if (this.device.width > this.device.height) { - this.screenWidth = this.device.height; - this.screenHeight = this.device.width; - } - } else { - if (this.device.width < this.device.height) { - this.screenWidth = this.device.height; - this.screenHeight = this.device.width; - } - } this.image = new Image(); this.image.onload = this.init.bind(this); From 5ad3cb047af9d90c8386c0af750bf3ca7732f0cb Mon Sep 17 00:00:00 2001 From: "jiaxin.lai" Date: Mon, 18 Nov 2019 17:34:26 +0800 Subject: [PATCH 2/3] fix rayResultSingleModel getter of render-scene (#5758) --- cocos/core/renderer/scene/render-scene.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/core/renderer/scene/render-scene.ts b/cocos/core/renderer/scene/render-scene.ts index 1c5a8f193c..51781ffded 100644 --- a/cocos/core/renderer/scene/render-scene.ts +++ b/cocos/core/renderer/scene/render-scene.ts @@ -111,7 +111,7 @@ export class RenderScene { * 获取 raycastSingleModel 后的检测结果 */ get rayResultSingleModel () { - return this.rayResultSingleModel; + return resultSingleModel; } public static registerCreateFunc (root: Root) { From 38069d74add8a467d4bb5c08fa571bbfe5322cff Mon Sep 17 00:00:00 2001 From: "jiaxin.lai" Date: Mon, 18 Nov 2019 18:39:47 +0800 Subject: [PATCH 3/3] reset physics raycast default max distance (#5760) * fix rayResultSingleModel getter of render-scene * reset physics raycast default max distance --- cocos/physics/components/physics-system.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/physics/components/physics-system.ts b/cocos/physics/components/physics-system.ts index 6b0988da4c..83d59a623b 100644 --- a/cocos/physics/components/physics-system.ts +++ b/cocos/physics/components/physics-system.ts @@ -149,7 +149,7 @@ export class PhysicsSystem extends System { 'group': -1, 'mask': -1, 'queryTrigger': true, - 'maxDistance': Infinity + 'maxDistance': 10000000 } private readonly raycastResultPool = new RecyclePool(() => { @@ -198,12 +198,12 @@ export class PhysicsSystem extends System { * 检测所有的碰撞盒,并记录所有被检测到的结果,通过 PhysicsSystem.instance.raycastResults 访问结果 * @param worldRay 世界空间下的一条射线 * @param mask 掩码 - * @param maxDistance 最大检测距离 + * @param maxDistance 最大检测距离,目前请勿传入 Infinity 或 Number.MAX_VALUE * @param queryTrigger 是否检测触发器 * @return boolean 表示是否有检测到碰撞盒 * @note 由于目前 Layer 还未完善,mask 暂时失效,请留意更新公告 */ - public raycast (worldRay: ray, mask: number = Layers.Enum.DEFAULT, maxDistance = Infinity, queryTrigger = true): boolean { + public raycast (worldRay: ray, mask: number = Layers.Enum.DEFAULT, maxDistance = 10000000, queryTrigger = true): boolean { this.raycastResultPool.reset(); this.raycastResults.length = 0; this.raycastOptions.mask = mask; @@ -217,12 +217,12 @@ export class PhysicsSystem extends System { * 检测所有的碰撞盒,并记录与射线距离最短的检测结果,通过 PhysicsSystem.instance.raycastClosestResult 访问结果 * @param worldRay 世界空间下的一条射线 * @param mask 掩码 - * @param maxDistance 最大检测距离 + * @param maxDistance 最大检测距离,目前请勿传入 Infinity 或 Number.MAX_VALUE * @param queryTrigger 是否检测触发器 * @return boolean 表示是否有检测到碰撞盒 * @note 由于目前 Layer 还未完善,mask 暂时失效,请留意更新公告 */ - public raycastClosest (worldRay: ray, mask: number = Layers.Enum.DEFAULT, maxDistance = Infinity, queryTrigger = true): boolean { + public raycastClosest (worldRay: ray, mask: number = Layers.Enum.DEFAULT, maxDistance = 10000000, queryTrigger = true): boolean { this.raycastOptions.mask = mask; this.raycastOptions.maxDistance = maxDistance; this.raycastOptions.queryTrigger = queryTrigger;