Shaku

Shaku JS

Back To Table of Content

Sprite Batch 3D

SpriteBatch3D

3D Sprites batch renderer. Responsible to drawing 3D quads with textures on them.

Kind: global class

new SpriteBatch3D([batchSpritesCount], [enableNormals], [enableBinormals], [enableTangents])

Create the 3d sprites batch.

Param Type Description
[batchSpritesCount] Number Internal buffers size, in sprites count (sprite = 4 vertices). Bigger value = faster rendering but more RAM.
[enableNormals] Boolean If true (not default) will support vertex normals.
[enableBinormals] Boolean If true (not default) will support vertex binormals.
[enableTangents] Boolean If true (not default) will support vertex tangents.

spriteBatch3D.camera ⇒ Camera

Get camera instance.

Kind: instance property of SpriteBatch3D
Returns: Camera - Camera instance.

spriteBatch3D.supportVertexColor

Kind: instance property of SpriteBatch3D

spriteBatch3D.defaultEffect

Kind: instance property of SpriteBatch3D

spriteBatch3D.setPerspectiveCamera([fieldOfView], [aspectRatio], [zNear], [zFar])

Set perspective camera.

Kind: instance method of SpriteBatch3D

Param Type Description
[fieldOfView] Number Camera field of view.
[aspectRatio] Number Camera aspect ratio
[zNear] Number Z near plane.
[zFar] Number Z far plane.

spriteBatch3D.setCamera(camera)

Set the camera for this batch.

Kind: instance method of SpriteBatch3D

Param Type Description
camera Camera Camera object to apply when drawing, or null if you want to set the camera manually.