Class: Camera

Phaser.Cameras.Sprite3D. Camera

[description]


new Camera(scene)

Parameters:
Name Type Description
scene Phaser.Scene

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 34)

Members


x :number

[description]

Type:
  • number
Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 1007)

y :number

[description]

Type:
  • number
Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 1027)

z :number

[description]

Type:
  • number
Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 1047)

Methods


add(sprite3D)

[description]

Parameters:
Name Type Description
sprite3D Phaser.GameObjects.Sprite3D

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 289)
Returns:

[description]

Type
Phaser.GameObjects.Sprite3D

clear()

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 331)
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
Source: plugins/camera3d/src/Camera.js (Line 364)
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
Source: plugins/camera3d/src/Camera.js (Line 397)
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
Source: plugins/camera3d/src/Camera.js (Line 435)
Returns:

[description]

Type
Array.<Phaser.GameObjects.Sprite3D>

destroy()

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 942)

getChildren()

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 351)
Returns:

[description]

Type
array

getPickRay(x [, y])

[description]

Parameters:
Name Type Argument Description
x number

[description]

y number <optional>

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 778)
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
Source: plugins/camera3d/src/Camera.js (Line 880)
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
Source: plugins/camera3d/src/Camera.js (Line 625)
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
Source: plugins/camera3d/src/Camera.js (Line 704)
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
Source: plugins/camera3d/src/Camera.js (Line 504)
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
Source: plugins/camera3d/src/Camera.js (Line 481)
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
Source: plugins/camera3d/src/Camera.js (Line 311)
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
Source: plugins/camera3d/src/Camera.js (Line 662)
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
Source: plugins/camera3d/src/Camera.js (Line 681)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setPixelScale(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 272)
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
Source: plugins/camera3d/src/Camera.js (Line 236)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setScene(scene)

[description]

Parameters:
Name Type Description
scene Phaser.Scene

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 255)
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
Source: plugins/camera3d/src/Camera.js (Line 573)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setX(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 956)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setY(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 973)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

setZ(value)

[description]

Parameters:
Name Type Description
value number

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 990)
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
Source: plugins/camera3d/src/Camera.js (Line 550)
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
Source: plugins/camera3d/src/Camera.js (Line 592)
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
Source: plugins/camera3d/src/Camera.js (Line 527)
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
Source: plugins/camera3d/src/Camera.js (Line 758)
Returns:

[description]

Type
Phaser.Math.Vector3

update()

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 826)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera

updateBillboardMatrix()

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 839)

updateChildren()

[description]

Since: 3.0.0
Source: plugins/camera3d/src/Camera.js (Line 805)
Returns:

This Camera object.

Type
Phaser.Cameras.Sprite3D.Camera