2014-08-11 09:31:04 +08:00
--------------------------------
-- @module Camera
-- @extend Node
-- @parent_module cc
2015-05-05 11:31:53 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
-- get depth, camera with larger depth is drawn on top of camera with smaller depth, the depth of camera with CameraFlag::DEFAULT is 0, user defined camera is -1 by default
-- @function [parent=#Camera] getDepth
2015-05-05 11:31:53 +08:00
-- @param self
2015-06-11 14:16:36 +08:00
-- @return char#char ret (return value: char)
2015-05-05 11:31:53 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
-- get view projection matrix
-- @function [parent=#Camera] getViewProjectionMatrix
2015-05-05 11:31:53 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @return mat4_table#mat4_table ret (return value: mat4_table)
2015-06-11 14:16:36 +08:00
--------------------------------
--
-- @function [parent=#Camera] applyViewport
-- @param self
-- @return Camera#Camera self (return value: cc.Camera)
2015-08-21 11:59:12 +08:00
--------------------------------
-- set the background brush. See CameraBackgroundBrush for more information.<br>
-- param clearBrush Brush used to clear the background
-- @function [parent=#Camera] setBackgroundBrush
-- @param self
-- @param #cc.CameraBackgroundBrush clearBrush
-- @return Camera#Camera self (return value: cc.Camera)
2015-05-27 05:56:01 +08:00
--------------------------------
-- Make Camera looks at target<br>
-- param target The target camera is point at<br>
-- param up The up vector, usually it's Y axis
-- @function [parent=#Camera] lookAt
-- @param self
-- @param #vec3_table target
-- @param #vec3_table up
-- @return Camera#Camera self (return value: cc.Camera)
2015-05-05 11:31:53 +08:00
2015-06-11 14:16:36 +08:00
--------------------------------
-- Apply the FBO, RenderTargets and viewport.
-- @function [parent=#Camera] apply
-- @param self
-- @return Camera#Camera self (return value: cc.Camera)
2015-08-21 11:59:12 +08:00
--------------------------------
-- Get clear brush
-- @function [parent=#Camera] getBackgroundBrush
-- @param self
-- @return CameraBackgroundBrush#CameraBackgroundBrush ret (return value: cc.CameraBackgroundBrush)
2014-08-11 09:31:04 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Gets the camera's projection matrix.<br>
-- return The camera projection matrix.
2014-08-11 09:31:04 +08:00
-- @function [parent=#Camera] getProjectionMatrix
-- @param self
-- @return mat4_table#mat4_table ret (return value: mat4_table)
--------------------------------
2015-05-27 05:56:01 +08:00
-- Get object depth towards camera
-- @function [parent=#Camera] getDepthInView
2014-08-11 09:31:04 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @param #mat4_table transform
-- @return float#float ret (return value: float)
2014-08-11 09:31:04 +08:00
--------------------------------
2015-08-21 11:59:12 +08:00
-- Before rendering scene with this camera, the background need to be cleared. It clears the depth buffer with max depth by default. Use setBackgroundBrush to modify the default behavior
2015-05-29 14:31:00 +08:00
-- @function [parent=#Camera] clearBackground
2014-08-11 09:31:04 +08:00
-- @param self
2015-05-29 14:31:00 +08:00
-- @return Camera#Camera self (return value: cc.Camera)
2015-05-27 05:56:01 +08:00
--------------------------------
2015-06-11 14:16:36 +08:00
-- set additional matrix for the projection matrix, it multiplys mat to projection matrix when called, used by WP8
-- @function [parent=#Camera] setAdditionalProjection
-- @param self
-- @param #mat4_table mat
-- @return Camera#Camera self (return value: cc.Camera)
--------------------------------
-- Set Viewport for camera.
-- @function [parent=#Camera] setViewport
2015-05-27 05:56:01 +08:00
-- @param self
2015-06-11 14:16:36 +08:00
-- @param #cc.experimental::Viewport vp
2015-05-27 05:56:01 +08:00
-- @return Camera#Camera self (return value: cc.Camera)
--------------------------------
-- init camera
-- @function [parent=#Camera] initDefault
-- @param self
-- @return bool#bool ret (return value: bool)
2014-08-11 09:31:04 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- get & set Camera flag
2014-08-11 09:31:04 +08:00
-- @function [parent=#Camera] getCameraFlag
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2014-09-02 13:45:07 +08:00
-- Gets the type of camera.<br>
-- return The camera type.
2014-08-11 09:31:04 +08:00
-- @function [parent=#Camera] getType
-- @param self
-- @return int#int ret (return value: int)
2015-02-27 11:54:42 +08:00
--------------------------------
--
2015-05-29 14:31:00 +08:00
-- @function [parent=#Camera] initOrthographic
2015-02-27 11:54:42 +08:00
-- @param self
2015-05-29 14:31:00 +08:00
-- @param #float zoomX
-- @param #float zoomY
-- @param #float nearPlane
-- @param #float farPlane
-- @return bool#bool ret (return value: bool)
2015-02-27 11:54:42 +08:00
2015-06-11 14:16:36 +08:00
--------------------------------
-- get rendered order
-- @function [parent=#Camera] getRenderOrder
-- @param self
-- @return int#int ret (return value: int)
2015-05-18 13:43:08 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
-- Is this aabb visible in frustum
-- @function [parent=#Camera] isVisibleInFrustum
2015-05-18 13:43:08 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @param #cc.AABB aabb
2015-05-18 13:43:08 +08:00
-- @return bool#bool ret (return value: bool)
2014-12-26 15:52:27 +08:00
--------------------------------
2015-06-11 14:16:36 +08:00
-- set depth, camera with larger depth is drawn on top of camera with smaller depth, the depth of camera with CameraFlag::DEFAULT is 0, user defined camera is -1 by default
-- @function [parent=#Camera] setDepth
2014-12-26 15:52:27 +08:00
-- @param self
2015-06-11 14:16:36 +08:00
-- @param #char depth
2015-05-27 05:56:01 +08:00
-- @return Camera#Camera self (return value: cc.Camera)
2014-12-26 15:52:27 +08:00
2014-08-11 09:31:04 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
-- Set the scene,this method shall not be invoke manually
-- @function [parent=#Camera] setScene
2014-08-11 09:31:04 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @param #cc.Scene scene
2015-01-21 17:33:26 +08:00
-- @return Camera#Camera self (return value: cc.Camera)
2014-08-11 09:31:04 +08:00
2015-05-29 14:31:00 +08:00
--------------------------------
--
-- @function [parent=#Camera] projectGL
-- @param self
-- @param #vec3_table src
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2014-08-11 09:31:04 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
-- Gets the camera's view matrix.<br>
-- return The camera view matrix.
-- @function [parent=#Camera] getViewMatrix
2014-08-11 09:31:04 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @return mat4_table#mat4_table ret (return value: mat4_table)
2014-08-11 09:31:04 +08:00
2014-12-26 15:46:45 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
-- Get the frustum's near plane.
-- @function [parent=#Camera] getNearPlane
2014-12-26 15:46:45 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @return float#float ret (return value: float)
2014-12-26 15:46:45 +08:00
2015-05-05 11:31:53 +08:00
--------------------------------
--
2015-05-27 05:56:01 +08:00
-- @function [parent=#Camera] project
2015-05-05 11:31:53 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @param #vec3_table src
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2015-05-05 11:31:53 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
--
-- @function [parent=#Camera] setCameraFlag
2015-05-05 11:31:53 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @param #int flag
2015-05-05 11:31:53 +08:00
-- @return Camera#Camera self (return value: cc.Camera)
2014-08-11 09:31:04 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
-- Get the frustum's far plane.
-- @function [parent=#Camera] getFarPlane
2015-02-15 19:53:55 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @return float#float ret (return value: float)
2015-02-15 19:53:55 +08:00
2015-06-11 14:16:36 +08:00
--------------------------------
--
-- @function [parent=#Camera] applyFrameBufferObject
-- @param self
-- @return Camera#Camera self (return value: cc.Camera)
--------------------------------
-- Set FBO, which will attacha several render target for the rendered result.
-- @function [parent=#Camera] setFrameBufferObject
-- @param self
-- @param #cc.experimental::FrameBuffer fbo
-- @return Camera#Camera self (return value: cc.Camera)
2015-07-30 17:23:06 +08:00
--------------------------------
-- Whether or not the viewprojection matrix was updated since the last frame.<br>
-- return True if the viewprojection matrix was updated since the last frame.
-- @function [parent=#Camera] isViewProjectionUpdated
-- @param self
-- @return bool#bool ret (return value: bool)
2015-02-15 19:53:55 +08:00
--------------------------------
2015-05-27 05:56:01 +08:00
--
-- @function [parent=#Camera] initPerspective
2015-02-15 19:53:55 +08:00
-- @param self
2015-05-27 05:56:01 +08:00
-- @param #float fieldOfView
-- @param #float aspectRatio
-- @param #float nearPlane
-- @param #float farPlane
-- @return bool#bool ret (return value: bool)
2015-02-15 19:53:55 +08:00
2015-06-11 14:16:36 +08:00
--------------------------------
-- Creates an orthographic camera.<br>
-- param zoomX The zoom factor along the X-axis of the orthographic projection (the width of the ortho projection).<br>
-- param zoomY The zoom factor along the Y-axis of the orthographic projection (the height of the ortho projection).<br>
-- param nearPlane The near plane distance.<br>
-- param farPlane The far plane distance.
-- @function [parent=#Camera] createOrthographic
-- @param self
-- @param #float zoomX
-- @param #float zoomY
-- @param #float nearPlane
-- @param #float farPlane
-- @return Camera#Camera ret (return value: cc.Camera)
--------------------------------
-- Get the visiting camera , the visiting camera shall be set on Scene::render
-- @function [parent=#Camera] getVisitingCamera
-- @param self
-- @return Camera#Camera ret (return value: cc.Camera)
2015-02-15 19:53:55 +08:00
--------------------------------
-- create default camera, the camera type depends on Director::getProjection, the depth of the default camera is 0
2014-08-11 09:31:04 +08:00
-- @function [parent=#Camera] create
-- @param self
-- @return Camera#Camera ret (return value: cc.Camera)
--------------------------------
2014-09-02 13:45:07 +08:00
-- Creates a perspective camera.<br>
-- param fieldOfView The field of view for the perspective camera (normally in the range of 40-60 degrees).<br>
-- param aspectRatio The aspect ratio of the camera (normally the width of the viewport divided by the height of the viewport).<br>
-- param nearPlane The near plane distance.<br>
-- param farPlane The far plane distance.
2014-08-11 09:31:04 +08:00
-- @function [parent=#Camera] createPerspective
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float fieldOfView
-- @param #float aspectRatio
-- @param #float nearPlane
-- @param #float farPlane
2014-08-11 09:31:04 +08:00
-- @return Camera#Camera ret (return value: cc.Camera)
--------------------------------
2015-06-11 14:16:36 +08:00
--
-- @function [parent=#Camera] getDefaultViewport
2014-08-11 09:31:04 +08:00
-- @param self
2015-06-11 14:16:36 +08:00
-- @return experimental::Viewport#experimental::Viewport ret (return value: cc.experimental::Viewport)
2014-08-11 09:31:04 +08:00
2015-01-14 11:43:27 +08:00
--------------------------------
2015-06-11 14:16:36 +08:00
--
-- @function [parent=#Camera] setDefaultViewport
2015-01-14 11:43:27 +08:00
-- @param self
2015-06-11 14:16:36 +08:00
-- @param #cc.experimental::Viewport vp
-- @return Camera#Camera self (return value: cc.Camera)
2015-01-14 11:43:27 +08:00
2014-08-11 09:31:04 +08:00
--------------------------------
2015-06-11 14:16:36 +08:00
-- Get the default camera of the current running scene.
-- @function [parent=#Camera] getDefaultCamera
2014-08-11 09:31:04 +08:00
-- @param self
-- @return Camera#Camera ret (return value: cc.Camera)
2015-07-30 17:23:06 +08:00
--------------------------------
--
-- @function [parent=#Camera] visit
-- @param self
-- @param #cc.Renderer renderer
-- @param #mat4_table parentTransform
-- @param #unsigned int parentFlags
-- @return Camera#Camera self (return value: cc.Camera)
2015-05-05 11:31:53 +08:00
--------------------------------
--
-- @function [parent=#Camera] Camera
-- @param self
-- @return Camera#Camera self (return value: cc.Camera)
2014-08-11 09:31:04 +08:00
return nil