Skip to content

Commit 9ed8968

Browse files
berosominggo
authored andcommitted
Set camera type accordingly in Camera's init methods (#17809)
1 parent 6753c6e commit 9ed8968

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cocos/2d/CCCamera.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ bool Camera::initPerspective(float fieldOfView, float aspectRatio, float nearPla
236236
Mat4::createPerspective(_fieldOfView, _aspectRatio, _nearPlane, _farPlane, &_projection);
237237
_viewProjectionDirty = true;
238238
_frustumDirty = true;
239+
_type = Type::PERSPECTIVE;
239240

240241
return true;
241242
}
@@ -249,6 +250,7 @@ bool Camera::initOrthographic(float zoomX, float zoomY, float nearPlane, float f
249250
Mat4::createOrthographicOffCenter(0, _zoom[0], 0, _zoom[1], _nearPlane, _farPlane, &_projection);
250251
_viewProjectionDirty = true;
251252
_frustumDirty = true;
253+
_type = Type::ORTHOGRAPHIC;
252254

253255
return true;
254256
}

0 commit comments

Comments
 (0)