Camera Class
Camera class
Constructor
Camera
-
[near]
-
[far]
-
[angle]
Parameters:
-
[near]
Float optionalnear Plane
-
[far]
Float optionalfar Plane
-
[angle]
Float optionalangle of perspective camera
Example:
world = new Scene()
camera = new Camera()
camera.position = new Vector(0.1, -1, -10);
Item Index
Methods
Methods
addChilds
-
mobject
Sets parent on MObject and unbinds current parent in RenderTree
Parameters:
-
mobject
MObjectmobject 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
forward
-
f
Move camera forward & backward
Parameters:
-
f
Floatdistance to move
lookAt
-
e
-
c
-
u
put the camera at the eye point looking e
toward the center point c
with an up direction of u
.
Returns:
Result matrix
move
-
x
-
y
-
z
-
r
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)
on
()
Turn on standard camera mouse and WSAD operating
on
-
factor
DEPRECATED use setters instead Turn on standard camera mouse and WSAD operating
Parameters:
-
factor
Floatsensitivity of camera
pitch
-
change
Rotate on local x axis
Parameters:
-
change
Floatrotation
pitch
-
change
DEPRECATED use setters instead Rotate on local y axis
Parameters:
-
change
Floatrotation
pitch
-
change
Rotate on local y axis
Parameters:
-
change
Floatrotation
pitch
-
change
DEPRECATED use setters instead Rotate on local x axis
Parameters:
-
change
Floatrotation
remove
()
Removes MObject from RenderTree
roll
-
change
Rotate on local z axis
Parameters:
-
change
Floatrotation
roll
-
change
DEPRECATED use setters instead Rotate on local z axis
Parameters:
-
change
Floatrotation
rotate
-
x
-
y
-
z
-
r
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
Rotate object around point
Parameters:
-
center
Vectorpivot 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
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)
setCameraPosition
()
Set camera position
setCameraPosition
()
Set camera position
setDisplay
()
Set table with screen dimensions and coordinates for 2D games
setDisplay
()
Set table with screen dimensions and coordinates for 2D games
setModelView
()
Sets aex modelview and Normal matrix. Internal function done after transformations as move, rotate etc..
setOrthoPerspective
()
set orthographic projection for camera
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:
-
parent
MObjectparent object
Example:
world = new Scene() gshader = new basicShader() someMaterial = new Material({}) gshader.setParent(world) someMaterial.setParent(world)
setPerspective
()
set perspective projection for camera
setUniforms
()
Force set shader uniforms
Example:
var aex = new Aex()
aex.setUniforms()
side
-
f
DEPRECATED use setters instead Move camera left & right
Parameters:
-
f
Floatdistance to move
side
-
f
Move camera left & right
Parameters:
-
f
Floatdistance to move
transforms
()
this method is called as the first method in scene draw call transforming the gl.projectionMatrix
updown
-
f
Move camera up & down
Parameters:
-
f
Floatdistance to move
updown
-
f
DEPRECATED use setters instead Move camera up & down
Parameters:
-
f
Floatdistance to move
Properties
position
Vector
Position of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.position = new Vector(1.0,2.0,3.0)
rotation
Vector
Rotation of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.rotation = new Vector(0.0,90.0,0.0)
rotX
Float
x Rotation of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.rotX = 20.0
rotY
Float
y Rotation of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.rotY = 20.0
rotZ
Float
z Rotation of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.rotZ = 20.0
scaleX
Float
x scale of object
Example:
world = new Scene()
cam = new Aex()
cam.scaleX = 2.0
scaleY
Float
y scale of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.scaleY = 2.0
scaleZ
Float
z scale of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.scaleZ = 2.0
x
Float
x Position of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.x = 20.0
y
Float
y Position of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.y = 20.0
z
Float
z Position of object
Example:
world = new Scene()
cam = new Camera(0.1,100,45)
cam.z = 20.0