new PerspectiveCamera(scene [, fieldOfView] [, viewportWidth] [, viewportHeight])
Parameters:
| Name | Type | Argument | Default | Description | 
|---|---|---|---|---|
| scene | Phaser.Scene | [description] | ||
| fieldOfView | integer | <optional> | 80 | [description] | 
| viewportWidth | integer | <optional> | 0 | [description] | 
| viewportHeight | integer | <optional> | 0 | [description] | 
- Since: 3.0.0
- Source: plugins/camera3d/src/PerspectiveCamera.js (Line 14)
Extends
Members
- 
    fieldOfView :integer
- 
    
    [description] Type:- integer
 - Since: 3.0.0
- Default Value:
- 
		- 80
 
- Source: plugins/camera3d/src/PerspectiveCamera.js (Line 64)
 
- 
    viewportHeight :integer
- 
    
    [description] Type:- integer
 - Since: 3.0.0
- Default Value:
- 
		- 0
 
- Source: plugins/camera3d/src/PerspectiveCamera.js (Line 54)
 
- 
    viewportWidth :integer
- 
    
    [description] Type:- integer
 - Since: 3.0.0
- Default Value:
- 
		- 0
 
- Source: plugins/camera3d/src/PerspectiveCamera.js (Line 44)
 
- 
    x :number
- 
    
    [description] Type:- number
 - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 1006)
 
- 
    y :number
- 
    
    [description] Type:- number
 - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 1026)
 
- 
    z :number
- 
    
    [description] Type:- number
 - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 1046)
 
Methods
- 
    add(sprite3D)
- 
    
    [description] Parameters:Name Type Description sprite3DPhaser.GameObjects.Sprite3D [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 288)
 Returns:[description] 
- 
    clear()
- 
    
    [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 330)
 Returns:This Camera object. 
- 
    create(x, y, z, key, frame [, visible])
- 
    
    [description] Parameters:Name Type Argument Default Description xnumber [description] ynumber [description] znumber [description] keystring [description] framestring | number [description] visibleboolean <optional> 
 true [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 363)
 Returns:[description] 
- 
    createMultiple(quantity, key, frame [, visible])
- 
    
    [description] Parameters:Name Type Argument Default Description quantitynumber [description] keystring [description] framestring | number [description] visibleboolean <optional> 
 true [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 396)
 Returns:[description] - Type
- Array.<Phaser.GameObjects.Sprite3D>
 
- 
    createRect(size, spacing, key [, frame])
- 
    
    [description] Parameters:Name Type Argument Description sizenumber | Object [description] spacingnumber | Object [description] keystring [description] framestring | number <optional> 
 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 434)
 Returns:[description] - Type
- Array.<Phaser.GameObjects.Sprite3D>
 
- 
    destroy()
- 
    
    [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 941)
 
- 
    getChildren()
- 
    
    [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 350)
 Returns:[description] - Type
- array
 
- 
    getPickRay(x [, y])
- 
    
    [description] Parameters:Name Type Argument Description xnumber [description] ynumber <optional> 
 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 777)
 Returns:[description] - Type
- RayDef
 
- 
    getPointSize(vec, size, out)
- 
    
    This is a utility function for canvas 3D rendering, which determines the "point size" of a camera-facing sprite billboard given its 3D world position (origin at center of sprite) and its world width and height in x/y. We place into the output Vector2 the scaled width and height. If no outis specified, a new Vector2 will be created for convenience (this should be avoided in tight loops).Parameters:Name Type Description vecPhaser.Math.Vector2 The position of the 3D Sprite. sizePhaser.Math.Vector2 The x and y dimensions. outPhaser.Math.Vector2 The result, scaled x and y dimensions. - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 879)
 Returns:[description] - Type
- Phaser.Math.Vector2
 
- 
    lookAt(x [, y] [, z])
- 
    
    [description] Parameters:Name Type Argument Description xnumber | object [description] ynumber <optional> 
 [description] znumber <optional> 
 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 624)
 Returns:This Camera object. 
- 
    project(vec, out)
- 
    
    [description] Parameters:Name Type Description vecPhaser.Math.Vector3 [description] outPhaser.Math.Vector4 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 703)
 Returns:[description] - Type
- Phaser.Math.Vector4
 
- 
    randomCube( [scale] [, sprites])
- 
    
    [description] Parameters:Name Type Argument Default Description scalenumber <optional> 
 1 [description] spritesArray.<Phaser.GameObjects.Sprite3D> <optional> 
 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 503)
 Returns:This Camera object. 
- 
    randomSphere( [radius] [, sprites])
- 
    
    [description] Parameters:Name Type Argument Default Description radiusnumber <optional> 
 1 [description] spritesArray.<Phaser.GameObjects.Sprite3D> <optional> 
 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 480)
 Returns:This Camera object. 
- 
    remove(child)
- 
    
    [description] Parameters:Name Type Description childPhaser.GameObjects.GameObject [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 310)
 Returns:This Camera object. 
- 
    rotate(radians, axis)
- 
    
    [description] Parameters:Name Type Description radiansnumber [description] axisPhaser.Math.Vector3 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 661)
 Returns:This Camera object. 
- 
    rotateAround(point, radians, axis)
- 
    
    [description] Parameters:Name Type Description pointPhaser.Math.Vector3 [description] radiansnumber [description] axisPhaser.Math.Vector3 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 680)
 Returns:This Camera object. 
- 
    setFOV(value)
- 
    
    [description] Parameters:Name Type Description valuenumber [description] - Since: 3.0.0
- Source: plugins/camera3d/src/PerspectiveCamera.js (Line 77)
 Returns:[description] 
- 
    setPixelScale(value)
- 
    
    [description] Parameters:Name Type Description valuenumber [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 271)
 Returns:This Camera object. 
- 
    setPosition(x, y, z)
- 
    
    [description] Parameters:Name Type Description xnumber [description] ynumber [description] znumber [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 235)
 Returns:This Camera object. 
- 
    setScene(scene)
- 
    
    [description] Parameters:Name Type Description scenePhaser.Scene [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 254)
 Returns:This Camera object. 
- 
    setViewport(width, height)
- 
    
    Sets the width and height of the viewport. Does not update any matrices. Parameters:Name Type Description widthnumber [description] heightnumber [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 572)
 Returns:This Camera object. 
- 
    setX(value)
- 
    
    [description] Parameters:Name Type Description valuenumber [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 955)
 Returns:This Camera object. 
- 
    setY(value)
- 
    
    [description] Parameters:Name Type Description valuenumber [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 972)
 Returns:This Camera object. 
- 
    setZ(value)
- 
    
    [description] Parameters:Name Type Description valuenumber [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 989)
 Returns:This Camera object. 
- 
    transformChildren(mat4, sprites)
- 
    
    [description] Parameters:Name Type Description mat4Phaser.Math.Matrix4 [description] spritesArray.<Phaser.GameObjects.Sprite3D> [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 549)
 Returns:This Camera object. 
- 
    translate(x [, y] [, z])
- 
    
    Translates this camera by a specified Vector3 object or x, y, z parameters. Any undefined x y z values will default to zero, leaving that component unaffected. If you wish to set the camera position directly call setPosition instead. Parameters:Name Type Argument Description xnumber | object [description] ynumber <optional> 
 [description] znumber <optional> 
 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 591)
 Returns:This Camera object. 
- 
    translateChildren(vec3, sprites)
- 
    
    [description] Parameters:Name Type Description vec3Phaser.Math.Vector3 [description] spritesArray.<Phaser.GameObjects.Sprite3D> [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 526)
 Returns:This Camera object. 
- 
    unproject(vec, out)
- 
    
    [description] Parameters:Name Type Description vecPhaser.Math.Vector4 [description] outPhaser.Math.Vector3 [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 757)
 Returns:[description] - Type
- Phaser.Math.Vector3
 
- 
    update()
- 
    
    [description] - Since: 3.0.0
- Overrides:
- Source: plugins/camera3d/src/PerspectiveCamera.js (Line 94)
 Returns:[description] 
- 
    updateBillboardMatrix()
- 
    
    [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 838)
 
- 
    updateChildren()
- 
    
    [description] - Since: 3.0.0
- Inherited From:
- Source: plugins/camera3d/src/Camera.js (Line 804)
 Returns:This Camera object. 
