Docs for Version: 1.0a
Show:
Extends Aex
Module: Game

Main Class for constructing groups and hierarchy

Constructor

Pivot

()

Example:

 wheel = new Pivot()
                                 wheel2 = new Pivot()
                                 axis = new Pivot()
                                 wheel.add(rim).add(tire)
                                 wheel2.add(rim2).add(tire2)
                                 rear_axis.add(wheel).add(wheel2)

Methods

add

(
  • aex
)
Pivot

Method to add children Aex objects to

Parameters:

  • aex Object

Returns:

addChilds

(
  • mobject
)

Inherited from MObject:

Sets parent on MObject and unbinds current parent in RenderTree

Parameters:

  • mobject MObject

    mobject object to add as a child to RenderTree

centerPivot

()

Inherited from Aex:

Centers pivot of an Aex to parent Mesh

draw

()

Inherited from Aex:

Draw the Aex inside draw function of your Scene

move

(
  • x
  • y
  • z
  • r
)

Inherited from Aex:

Move object

Parameters:

  • x Object
    • x axis
  • y Object
    • y axis
  • z Object
    • z axis
  • r Object
    • relative transform

Example:

 var aex = new Aex()
                                             aex.move(0,1,2)

remove

()

Inherited from MObject:

Removes MObject from RenderTree

rotate

(
  • x
  • y
  • z
  • r
)

Inherited from Aex:

Rotate object

Parameters:

  • x Object
    • angle around x axis
  • y Object
    • angle around y axis
  • z Object
    • angle around z axis
  • r Object
    • relative transform

Example:

 var aex = new Aex()
                                             aex.rotate(0,1,2)

rotateAroundPoint

(
  • center
  • angle
  • x
  • y
  • z
)

Inherited from Aex:

Rotate object around point

Parameters:

  • center Vector

    pivot point location

  • angle Object
    • rotation in degrees
  • x Object
    • usage of x axis
  • y Object
    • usage of y axis
  • z Object
    • usage of z axis

Example:

 var aex = new Aex()
                                             aex.rotateAroundPoint(new Vector(0,1,1),90,0,1,0)

scale

(
  • x
  • y
  • z
  • r
)

Inherited from Aex:

Scale object

Parameters:

  • x Object
    • x axis
  • y Object
    • y axis
  • z Object
    • z axis
  • r Object
    • relative transform

Example:

 var aex = new Aex()
                                             aex.scale(0,1,2)

setModelView

() Pivot

Inherited from Aex but overwritten in

Sets modelview of pivot and its children items

Returns:

setParent

(
  • parent
)

Inherited from MObject:

Sets parent on MObject and unbinds current parent in RenderTree. Usually this is done inside GameObject, but you have also possibility to construct RenderTree by yourself.

Parameters:

Example:

world = new Scene() gshader = new basicShader() someMaterial = new Material({}) gshader.setParent(world) someMaterial.setParent(world)

setPivot

(
  • v
)
Pivot

Sets pivot to desired Vector in 3d space without moving the object

Parameters:

  • v Object

Returns:

setPivotToCenter

() Pivot

Sets pivot to center of contained objects

Returns:

setUniforms

()

Inherited from Aex:

Force set shader uniforms

Example:

 var aex = new Aex()
                                             aex.setUniforms()

Properties

position

Vector

Inherited from Aex:

Position of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.position = new Vector(1.0,2.0,3.0)

rotation

Vector

Inherited from Aex:

Rotation of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.rotation = new Vector(0.0,90.0,0.0)

rotX

Float

Inherited from Aex:

x Rotation of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.rotX = 20.0

rotY

Float

Inherited from Aex:

y Rotation of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.rotY = 20.0

rotZ

Float

Inherited from Aex:

z Rotation of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.rotZ = 20.0

scaleX

Float

Inherited from Aex:

x scale of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.scaleX = 2.0

scaleY

Float

Inherited from Aex:

y scale of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.scaleY = 2.0

scaleZ

Float

Inherited from Aex:

z scale of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.scaleZ = 2.0

x

Float

Inherited from Aex:

x Position of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.x = 20.0

y

Float

Inherited from Aex:

y Position of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.y = 20.0

z

Float

Inherited from Aex:

z Position of object

Example:

world = new Scene()
                                            game = new Aex()
                                            game.z = 20.0