Class: StormEngineC

StormEngineC

new StormEngineC()

Engine contructor

Properties:
Name Type Description
target HTMLCanvasElement
$ JqueryDivElement
mousePosX Int

x mouse position on the canvas

mousePosY Int

y mouse position on the canvas

stormGLContext StormGLContext

object

clgl WebCLGL

WebCLGL object

utils StormUtils

StormUtils object

stormMesh StormMesh

StormMesh object

Source:

Methods

addHitRectRegion(jsonIn) → {Int}

Define a hit region in the canvas area

Parameters:
Name Type Description
jsonIn Object
Properties
Name Type Description
x Int

X pos.

y Int

Y pos.

width Int

Width.

height Int

Height.

fillStyle Hex

Fill color.

strokeStyle Hex

Stroke color.

lineWidth Int

Line width.

onclick function

On click function.

onmouseover function

On mouse over function.

onmouseout function

On mouse out function.

Source:
Returns:

id The id of the region object

Type
Int

clearScene()

Clear the actual scene

Source:

createCamera(position, distance) → {StormCamera}

Create camera. If distance is given the type of controller is 'targetcam' else 'freecam'.

Parameters:
Name Type Argument Default Description
position StormV3 <optional>
$V3([0.0,0.0,0.0])

The position

distance Float <optional>
undefined

Distance to camera target

Source:
Returns:
Type
StormCamera

createForceField(jsonIn) → {StormForceField}

Create force field

Parameters:
Name Type Description
jsonIn Object
Properties
Name Type Argument Default Description
direction StormV3 <optional>
$V3([0.0,-9.8,0.0])

The direction.

Source:
Returns:
Type
StormForceField

createGravityForce() → {StormForceField}

Create gravity force

Source:
Returns:
Type
StormForceField

createGroup() → {StormGroupNodes}

Create StormGroupNodes object

Source:
Returns:
Type
StormGroupNodes

createLight(jsonIn) → {StormLight}

Create light

Parameters:
Name Type Description
jsonIn Object
Properties
Name Type Argument Default Description
type String

'sun' or 'spot' (Max 10 spots lights)

position StormV3

The position. (Only for spot lights)

color Int <optional>
5770

Color in kelvins(1000K-15000K)

color StormV3 <optional>
5770

Color through vector

direction StormV3 <optional>
$V3([0.01,-0.5,0.01])

The direction vector. (If type is 'sun' only direction option).

Source:
Returns:
Type
StormLight

createLine(vecOrigin, vecEnd, vecOriginColor, vecEndColor) → {StormLine}

Create line

Parameters:
Name Type Argument Default Description
vecOrigin StormV3

Origin point

vecEnd StormV3

End point

vecOriginColor StormV3 <optional>
$V3([1.0,1.0,1.0])

Color of origin point

vecEndColor StormV3 <optional>
$V3([0.0,0.0,0.0])

Color of end point

Source:
Returns:
Type
StormLine

createMaterial() → {StormMaterial}

Create material

Source:
Returns:
Type
StormMaterial

createNetNode()

Make a websocket player

Source:

createNode() → {StormNode}

Create StormNode object

Source:
Returns:
Type
StormNode

createParticles() → {StormParticles}

Create particles

Source:
Returns:
Type
StormParticles

createPolarityPoint(jsonIn) → {StormPolarityPoint}

Create polarity point

Parameters:
Name Type Description
jsonIn Object
Properties
Name Type Argument Default Description
polarity Int <optional>
1

1=positive 0=negative

orbit Int <optional>
0

Orbit mode (0 or 1)

force Float <optional>
0.5

The force.

Source:
Returns:
Type
StormPolarityPoint

createVoxelizator() → {StormVoxelizator}

Create voxelizator

Source:
Returns:
Type
StormVoxelizator

createWebGL(jsonIn)

Init WebGL Context

Parameters:
Name Type Description
jsonIn Object
Properties
Name Type Argument Default Description
target HTMLCanvasElement | String

Name of the atribute ID of the canvas or one element HTMLCanvasElement.

callback function

Function fired at every frame

editMode Bool <optional>
true

Edit mode

resizable Int <optional>
2

0:No resizable, 1:resizable(maintain the aspect ratio), 2:resizable, 3:screen autoadjust(maintain the aspect ratio)

enableRender Bool <optional>
true

Enable render

Source:

dataGAEMsg(params)

Emit GAE Channel Msg to everybody

Parameters:
Name Type Description
params String
Source:

get2DContext() → {CanvasRenderingContext2D}

Get the 2D context

Source:
Returns:

CanvasRenderingContext2D

Type
CanvasRenderingContext2D

getDeviceAlpha() → {Float}

Get the device orientation dir (ALPHA Z)

Source:
Returns:

Float dir.

Type
Float

getDeviceBeta() → {Float}

Get the device orientation tiltFrontBack (BETA Y)

Source:
Returns:

Float tiltFB.

Type
Float

getDeviceGamma() → {Float}

Get the device orientation tiltLeftRight (GAMMA X)

Source:
Returns:

Float tiltLR.

Type
Float

getSelectedNode() → {StormNode}

Get the selected node

Source:
Returns:
Type
StormNode

getServerStatus() → {String}

Return websocket status for Game Server

Source:
Returns:
Type
String

getWebGL() → {WebGLRenderingContext}

Get the WebGL context

Source:
Returns:

WebGLRenderingContext

Type
WebGLRenderingContext

getWebGLCam() → {StormCamera}

Get the current active camera

Source:
Returns:

cameraNode Active camera node

Type
StormCamera

removeHitRectRegion(id)

Remove a hit region in the canvas area

Parameters:
Name Type Description
id Int

The id of the region object

Source:

setAmbientColor(color)

Set the ambient color

Parameters:
Name Type Description
color StormV3

Set the ambient color through a normalized vector

Source:

setDebugValue(idx, value, text)

Add debug information for displaying values

Parameters:
Name Type Argument Default Description
idx Int
value StormM16 | StormV3 | Int | Float
text String <optional>
""
Source:

setPrincipalNetNode()

Make this client the principal Net Player

Source:

setWebGLBackground(value)

Set the WebGL background. Disable by default.

Parameters:
Name Type Description
value String | StormV3

'transparent','environmentMap','ambientColor' or StormV3 color. Default: 'ambientColor'

Source:

setWebGLCam(cameraNode)

Making a camera takes the view

Parameters:
Name Type Description
cameraNode StormCamera
Source:

setWebGLEnvironmentMap(fileURL)

WebGL environment map

Parameters:
Name Type Description
fileURL String

File URL

Source:

setWebGLpause(pause)

Pause or unpause the execution.

Parameters:
Name Type Description
pause Bool

Pause or unpause

Source:

setWebGLResize(width, height)

WebGL resize

Parameters:
Name Type Description
width Int

The width

height Int

The height

Source:

setWebGLSSAO(enable, level)

Enable AO

Parameters:
Name Type Description
enable Bool

Enable or disable AO

level Float

The level of AO

Source:

shadows(active)

Set the visibility of the WebGL shadows

Parameters:
Name Type Description
active Bool
Source:

transformMode(mode)

Set the tranform

Parameters:
Name Type Argument Default Description
mode Int <optional>
0

0 for world transform; 1 for local transform

Source:

update2DContext()

Update the 2D context

Source:

upGAEChannel(userId, userNickname, scene, token)

Up Google App Engine Channel

Parameters:
Name Type Description
userId String

Google userId

userNickname String

Google userNickname

scene String

Name for the scene

token String

Token generated by Java object StormNetScene

Source:

upWebsocket(ip, port)

Up Websocket Game Server

Parameters:
Name Type Description
ip String
port Int
Source:

upWebsocketPathTracing(ip, port)

Up Websocket PathTracing Server

Parameters:
Name Type Description
ip String
port Int
Source:
StormEngineC 1.2 API DOC
2010 Roberto Gonzalez. http://stormcolour.appspot.com
Documentation generated by JSDoc 3.3.0-alpha2 on Mon Apr 14 2014 19:36:58 GMT+0200 (CEST) using the DocStrap template.