Class: PerspectiveCamera

Phaser.Cameras.Sprite3D. PerspectiveCamera

[description]


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
sprite3D Phaser.GameObjects.Sprite3D

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 288)
Returns:

[description]

Type
Phaser.GameObjects.Sprite3D

clear()

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 330)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

create(x, y, z, key, frame [, visible])

[description]

Parameters:
Name Type Argument Default Description
x number

[description]

y number

[description]

z number

[description]

key string

[description]

frame string | number

[description]

visible boolean <optional>
true

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 363)
Returns:

[description]

Type
Phaser.GameObjects.Sprite3D

createMultiple(quantity, key, frame [, visible])

[description]

Parameters:
Name Type Argument Default Description
quantity number

[description]

key string

[description]

frame string | number

[description]

visible boolean <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
size number | Object

[description]

spacing number | Object

[description]

key string

[description]

frame string | 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
x number

[description]

y number <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 out is specified, a new Vector2 will be created for convenience (this should be avoided in tight loops).

Parameters:
Name Type Description
vec Phaser.Math.Vector2

The position of the 3D Sprite.

size Phaser.Math.Vector2

The x and y dimensions.

out Phaser.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
x number | object

[description]

y number <optional>

[description]

z number <optional>

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 624)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

project(vec, out)

[description]

Parameters:
Name Type Description
vec Phaser.Math.Vector3

[description]

out Phaser.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
scale number <optional>
1

[description]

sprites Array.<Phaser.GameObjects.Sprite3D> <optional>

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 503)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

randomSphere( [radius] [, sprites])

[description]

Parameters:
Name Type Argument Default Description
radius number <optional>
1

[description]

sprites Array.<Phaser.GameObjects.Sprite3D> <optional>

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 480)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

remove(child)

[description]

Parameters:
Name Type Description
child Phaser.GameObjects.GameObject

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 310)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

rotate(radians, axis)

[description]

Parameters:
Name Type Description
radians number

[description]

axis Phaser.Math.Vector3

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 661)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

rotateAround(point, radians, axis)

[description]

Parameters:
Name Type Description
point Phaser.Math.Vector3

[description]

radians number

[description]

axis Phaser.Math.Vector3

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 680)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setFOV(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Source: plugins/camera3d/src/PerspectiveCamera.js (Line 77)
Returns:

[description]

Type
Phaser.Cameras.Sprite3D.PerspectiveCamera

setPixelScale(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 271)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setPosition(x, y, z)

[description]

Parameters:
Name Type Description
x number

[description]

y number

[description]

z number

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 235)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setScene(scene)

[description]

Parameters:
Name Type Description
scene Phaser.Scene

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 254)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setViewport(width, height)

Sets the width and height of the viewport. Does not update any matrices.

Parameters:
Name Type Description
width number

[description]

height number

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 572)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setX(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 955)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setY(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 972)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setZ(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 989)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

transformChildren(mat4, sprites)

[description]

Parameters:
Name Type Description
mat4 Phaser.Math.Matrix4

[description]

sprites Array.<Phaser.GameObjects.Sprite3D>

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 549)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

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
x number | object

[description]

y number <optional>

[description]

z number <optional>

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 591)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

translateChildren(vec3, sprites)

[description]

Parameters:
Name Type Description
vec3 Phaser.Math.Vector3

[description]

sprites Array.<Phaser.GameObjects.Sprite3D>

[description]

Since: 3.0.0
Inherited From:
Source: plugins/camera3d/src/Camera.js (Line 526)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

unproject(vec, out)

[description]

Parameters:
Name Type Description
vec Phaser.Math.Vector4

[description]

out Phaser.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]

Type
Phaser.Cameras.Sprite3D.PerspectiveCamera

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.

Type
Phaser.Cameras.Sprite3D.Camera