mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
commit files
This commit is contained in:
@@ -290,8 +290,6 @@ export abstract class RenderPipeline {
|
||||
}
|
||||
|
||||
protected updateUBOs (view: RenderView) {
|
||||
const camera = view.camera as Camera;
|
||||
camera.update();
|
||||
|
||||
// update UBOGlobal
|
||||
_vec4Array[0] = this._root.frameTime;
|
||||
@@ -312,27 +310,27 @@ export abstract class RenderPipeline {
|
||||
_vec4Array[3] = 1.0;
|
||||
this._uboGlobal.view.set(_vec4Array, UBOGlobal.SCREEN_SCALE_OFFSET);
|
||||
|
||||
mat4.array(_mat4Array, camera.matView);
|
||||
mat4.array(_mat4Array, view.camera.matView);
|
||||
this._uboGlobal.view.set(_mat4Array, UBOGlobal.MAT_VIEW_OFFSET);
|
||||
|
||||
mat4.invert(_outMat, camera.matView);
|
||||
mat4.invert(_outMat, view.camera.matView);
|
||||
mat4.array(_mat4Array, _outMat);
|
||||
this._uboGlobal.view.set(_mat4Array, UBOGlobal.MAT_VIEW_INV_OFFSET);
|
||||
|
||||
mat4.array(_mat4Array, camera.matProj);
|
||||
mat4.array(_mat4Array, view.camera.matProj);
|
||||
this._uboGlobal.view.set(_mat4Array, UBOGlobal.MAT_PROJ_OFFSET);
|
||||
|
||||
mat4.invert(_outMat, camera.matProj);
|
||||
mat4.invert(_outMat, view.camera.matProj);
|
||||
mat4.array(_mat4Array, _outMat);
|
||||
this._uboGlobal.view.set(_mat4Array, UBOGlobal.MAT_PROJ_INV_OFFSET);
|
||||
|
||||
mat4.array(_mat4Array, camera.matViewProj);
|
||||
mat4.array(_mat4Array, view.camera.matViewProj);
|
||||
this._uboGlobal.view.set(_mat4Array, UBOGlobal.MAT_VIEW_PROJ_OFFSET);
|
||||
|
||||
mat4.array(_mat4Array, camera.matViewProjInv);
|
||||
mat4.array(_mat4Array, view.camera.matViewProjInv);
|
||||
this._uboGlobal.view.set(_mat4Array, UBOGlobal.MAT_VIEW_PROJ_INV_OFFSET);
|
||||
|
||||
vec3.array(_vec4Array, camera.node && camera.node.getPosition());
|
||||
vec3.array(_vec4Array, view.camera.node && view.camera.node.getPosition());
|
||||
_vec4Array[3] = 1.0;
|
||||
this._uboGlobal.view.set(_vec4Array, UBOGlobal.CAMERA_POS_OFFSET);
|
||||
|
||||
@@ -352,7 +350,7 @@ export abstract class RenderPipeline {
|
||||
// filter model by view visibility
|
||||
if (view.visibility > 0 && model.viewID !== view.visibility ||
|
||||
!model.isEnable() ||
|
||||
!model.node.active) {
|
||||
!model.node.activeInHierarchy) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,10 @@ export class Camera {
|
||||
}
|
||||
|
||||
public update () {
|
||||
if (!this._node) { return; }
|
||||
if (!this._node) {
|
||||
return;
|
||||
}
|
||||
|
||||
// view matrix
|
||||
this.node.getWorldRT(this._matView);
|
||||
mat4.invert(this._matView, this._matView);
|
||||
|
||||
@@ -184,15 +184,14 @@ export class BaseNode extends CCObject {
|
||||
get active () {
|
||||
return this._active;
|
||||
}
|
||||
set active (value) {
|
||||
value = !!value;
|
||||
if (this._active !== value) {
|
||||
this._active = value;
|
||||
set active (isActive: boolean) {
|
||||
if (this._active !== isActive) {
|
||||
this._active = isActive;
|
||||
const parent = this._parent;
|
||||
if (parent) {
|
||||
const couldActiveInScene = parent._activeInHierarchy;
|
||||
if (couldActiveInScene) {
|
||||
cc.director._nodeActivator.activateNode(this, value);
|
||||
cc.director._nodeActivator.activateNode(this, isActive);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user