Pivot Class
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)
Item Index
Methods
Methods
addChilds
-
mobject
Sets parent on MObject and unbinds current parent in RenderTree
Parameters:
-
mobjectMObjectmobject object to add as a child to RenderTree
centerPivot
()
Centers pivot of an Aex to parent Mesh
draw
()
Draw the Aex inside draw function of your Scene
move
-
x -
y -
z -
r
Move object
Parameters:
-
xObject- x axis
-
yObject- y axis
-
zObject- z axis
-
rObject- relative transform
Example:
var aex = new Aex()
aex.move(0,1,2)
remove
()
Removes MObject from RenderTree
rotate
-
x -
y -
z -
r
Rotate object
Parameters:
-
xObject- angle around x axis
-
yObject- angle around y axis
-
zObject- angle around z axis
-
rObject- relative transform
Example:
var aex = new Aex()
aex.rotate(0,1,2)
rotateAroundPoint
-
center -
angle -
x -
y -
z
Rotate object around point
Parameters:
-
centerVectorpivot point location
-
angleObject- rotation in degrees
-
xObject- usage of x axis
-
yObject- usage of y axis
-
zObject- 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
Scale object
Parameters:
-
xObject- x axis
-
yObject- y axis
-
zObject- z axis
-
rObject- relative transform
Example:
var aex = new Aex()
aex.scale(0,1,2)
setParent
-
parent
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:
-
parentMObjectparent object
Example:
world = new Scene() gshader = new basicShader() someMaterial = new Material({}) gshader.setParent(world) someMaterial.setParent(world)
setPivot
-
v
Sets pivot to desired Vector in 3d space without moving the object
Parameters:
-
vObject
Returns:
setUniforms
()
Force set shader uniforms
Example:
var aex = new Aex()
aex.setUniforms()
Properties
position
Vector
Position of object
Example:
world = new Scene()
game = new Aex()
game.position = new Vector(1.0,2.0,3.0)
rotation
Vector
Rotation of object
Example:
world = new Scene()
game = new Aex()
game.rotation = new Vector(0.0,90.0,0.0)
rotX
Float
x Rotation of object
Example:
world = new Scene()
game = new Aex()
game.rotX = 20.0
rotY
Float
y Rotation of object
Example:
world = new Scene()
game = new Aex()
game.rotY = 20.0
rotZ
Float
z Rotation of object
Example:
world = new Scene()
game = new Aex()
game.rotZ = 20.0
scaleX
Float
x scale of object
Example:
world = new Scene()
game = new Aex()
game.scaleX = 2.0
scaleY
Float
y scale of object
Example:
world = new Scene()
game = new Aex()
game.scaleY = 2.0
scaleZ
Float
z scale of object
Example:
world = new Scene()
game = new Aex()
game.scaleZ = 2.0
x
Float
x Position of object
Example:
world = new Scene()
game = new Aex()
game.x = 20.0
y
Float
y Position of object
Example:
world = new Scene()
game = new Aex()
game.y = 20.0
z
Float
z Position of object
Example:
world = new Scene()
game = new Aex()
game.z = 20.0
Docs for Version: 1.0a