Camera3D
new Camera3D()public frustrum:Frustumpublic viewport:Viewportpublic function resize(p_nWidth:Number, p_nHeight:Number):VoidUpdate the screen viewport dimensions
public function moveSideways(d:Number):VoidAllow the camera to translate along its side vector. If you imagine yourself in a game, it would be a step on your right or on your left
d | Number Move the camera along its side vector |
public function moveUpwards(d:Number):VoidAllow the camera to translate along its up vector. If you imagine yourself in a game, it would be a jump on the direction of your body (so not always the vertical!)
d | Number Move the camera along its up vector |
public function moveForward(d:Number):VoidAllow the camera to translate along its view vector. If you imagine yourself in a game, it would be a step in the direction you look at. If you look the sky you will translate upwards ! So be careful with its use.
d | Number Move the camera along its viw vector |
public function moveHorizontally(d:Number):VoidAllow the camera to translate horizontally If you imagine yourself in a game, it would be a step in the direction you look at but without changing your altitude.
d | Number Move the camera horizontally |
public function moveVertically(d:Number):VoidAllow the camera to translate vertically If you imagine yourself in a game, it would be a jump strictly vertical.
d | Number Move the camera vertically |
public function translate(px:Number, py:Number, pz:Number):VoidTranslate the camera from it's actual position with the offset values pased in parameters
px | x offset that will be added to the x coordinate of the camera |
py | y offset that will be added to the y coordinate position of the camera |
pz | z offset that will be added to the z coordinate position of the camera |
public function moveLateraly(d:Number):VoidAllow the camera to translate lateraly If you imagine yourself in a game, it would be a step on the right with a positiv parameter and to the left with a negative parameter
d | Number Move the camera lateraly |
public function rotateAxis(ax:Number, ay:Number, az:Number, nAngle:Number):VoidRotate the camera around a specific axis by an angle passed in parameter
ax | Number The x coordinate of the axis |
ay | Number The y coordinate of the axis |
az | Number The z coordinate of the axis |
nAngle | Number The amount of rotation. This angle is in degrees. |
public function lookAt(px:Number, py:Number, pz:Number):VoidMake the camera look at a specific position. Useful to follow a moving object or a static object while the camera is moving.
px | Number The x position to look at |
py | Number The y position to look at |
pz | Number The z position to look at |
public function rotateX(nAngle:Number):VoidRotateX - Rotation around the global X axis of the camera frame
nAngle | Number The angle of rotation in degree. |
Void
public function rotateY(nAngle:Number):VoidrotateY - Rotation around the global Y axis of the camera frame
nAngle | Number The angle of rotation in degree. |
Void
public function rotateZ(nAngle:Number):VoidrotateZ - Rotation around the global Z axis of the camera frame
nAngle | Number The angle of rotation in degree between : [ -180; 180 ]. |
public function tilt(nAngle:Number):VoidTilt - Rotation around the local X axis of the camera frame Range from -90 to +90 where 0 = Horizon, +90 = straight up and –90 = straight down.
nAngle | Number The angle of rotation in degree. |
Void
public function pan(nAngle:Number):VoidPan - Rotation around the local Y axis of the camera frame Range from 0 to 360 where 0=North, 90=East, 180=South and 270=West.
nAngle | Number The angle of rotation in degree. |
Void
public function roll(nAngle:Number):Voidroll - Rotation around the local Z axis of the camera frame Range from -180 to +180 where 0 means the plane is aligned with the horizon, +180 = Full roll right and –180 = Full roll left. In both cases, when the roll is 180 and –180, the plane is flipped on its back.
nAngle | Number The angle of rotation in degree. |
public function setPosition(x:Number, y:Number, z:Number):VoidSet the position of the camera. Basically apply a translation.
x | x position of the camera |
y | y position of the camera |
z | z position of the camera |
public function getPosition(Void):VectorGet the position of the camera.
the position of the camera as a Vector
public function setInterpolator(i:Interpolator3D):BooleanSet an interpolator to the camera. Currently the camera handles only a Path interpolator or a Position interpolation.
i | Interpolator3D The interpolator you want to apply to the camera. It must be a Path interpolator or a Position interpolation |
Boolean True is the operation goes well, false otherwise
public function removeInterpolator(Void):BooleanREmove the interpolator is exist. remove also the listeners.
Void |
Boolean True is the operation goes well, false otherwise.
public function isModified(Void):BooleanThis method helps you to know if something has changed in the camera, and if you need to compile it again to take care about the modifications.
Void |
Boolean True value is returned if something has changed, false otherwise.
public function compile(Void):VoidCompile the camera transformations by multiplicating the matrix together. Be carefull to call isModified method before to save computations.
public function getProjectionMatrix(Void):Matrix4Return the projection matrix.
Matrix4
public function getProjectionMatrixInverse(Void):Matrix4Returns the inverse of the projection matrix
public function getTransformMatrix(Void):Matrix4Return the transformation matrix.
Matrix4
public function setPerspectiveProjection(fovY:Number, aspectRatio:Number, zNear:Number, zFar:Number):VoidSet a projection matrix with perspective. This projection allows a more human visual representation of objects.
fovY | The angle of view in degress. Default value: 45. |
aspectRatio | The ratio between vertical and horizontal pixels. Default value: the screeen ratio (width/height) |
zNear | The distance between the camera position and the near plane. Default value: 50. |
zFar | The distance between the camera position and the far plane. Default value: 3,000. |