Lua API
0.4.0
Game Engine
|
Functions | |
changeCurrentCamera (object) | |
Changes the current active camera. More... | |
getCurrentCamera () | |
Retrieves the active camera. More... | |
getCameraClearColor (object) | |
Retrieves the clear color from the given camera. More... | |
getCameraFov (object) | |
Retrieves the field of view from the given camera. More... | |
getCameraNear (object) | |
Retrieves the distance to the near plane from the given camera. More... | |
getCameraFar (object) | |
Retrieves the distance to the far plane from the given camera. More... | |
getCameraFogDistance (object) | |
Retrieves the distance to the fog from the given camera. More... | |
isCameraOrtho (object) | |
Checks if the given camera is configured to be orthographic. More... | |
isCameraFogEnabled (object) | |
Checks if the given camera is configured to render fog. More... | |
setCameraClearColor (object,{r, g, b}) | |
setCameraFov (object, fov) | |
Changes the field of view of the given camera. More... | |
setCameraNear (object, near) | |
Changes the distance to the near plane of the given camera. More... | |
setCameraFar (object, far) | |
Changes the distance to the far plane of the given camera. More... | |
setCameraFogDistance (object, fogDistance) | |
Changes the distance to the fog rendered by the given camera. More... | |
enableCameraOrtho (object, ortho) | |
Updates the cameras matrix setup to allow orthographic rendering. More... | |
enableCameraFog (object, fog) | |
Enables fog rendering for the given camera. More... | |
enableCameraLayer (object, scene) | |
Turns the image that the given scene renders into an overlay over the given camera. More... | |
disableCameraLayer (object) | |
Disables the scene overlay attached to the given camera. More... | |
enableRenderToTexture (object, texturePath, renderWidth, renderHeight) | |
Enables render to texture for the given camera. More... | |
disableRenderToTexture (object) | |
Disables render to texture for the given camera. More... | |
getProjectedPoint (object, point) | |
Converts global vector to a projected vector inside the given camera viewport. More... | |
getUnProjectedPoint (object, point) | |
Converts a projected vector to a global vector using the given camera. More... | |
changeCurrentCamera | ( | object | ) |
Changes the current active camera.
This change will apply in the next frame and not immediately.
object | The new active camera. |
disableCameraLayer | ( | object | ) |
Disables the scene overlay attached to the given camera.
object | The camera with the scene layer. |
disableRenderToTexture | ( | object | ) |
Disables render to texture for the given camera.
object | The camera. |
enableCameraFog | ( | object | , |
fog | |||
) |
Enables fog rendering for the given camera.
object | The camera. |
fog | A boolean value representing the new state. |
enableCameraLayer | ( | object | , |
scene | |||
) |
Turns the image that the given scene renders into an overlay over the given camera.
For rendering the scene as an overlay the default camera in that scene is used.
object | The camera. |
scene | The scene to overlay. |
enableCameraOrtho | ( | object | , |
ortho | |||
) |
Updates the cameras matrix setup to allow orthographic rendering.
object | The camera. |
ortho | A boolean value representing the new state. |
enableRenderToTexture | ( | object | , |
texturePath | , | ||
renderWidth | , | ||
renderHeight | |||
) |
Enables render to texture for the given camera.
This function allows you to setup any camera to render to a specific material. For this you specify the texture path to the texture you want to replace. Attention: This will not modify the texture on disk!
All surfaces referencing this texture file will be replaced by the rendered image.
object | The camera which is used to render the scene. |
texturePath | The path to the texture file to replace. |
renderWidth | The width of the render target in pixel (does not need to match the actual texture file) |
renderHeight | The width of the render target in pixel (does not need to match the actual texture file) |
getCameraClearColor | ( | object | ) |
Retrieves the clear color from the given camera.
Example:
getCameraFar | ( | object | ) |
Retrieves the distance to the far plane from the given camera.
object | The distance as a number. |
getCameraFogDistance | ( | object | ) |
Retrieves the distance to the fog from the given camera.
object | The distance as a number. |
getCameraFov | ( | object | ) |
Retrieves the field of view from the given camera.
object | The FOV as a number. |
getCameraNear | ( | object | ) |
Retrieves the distance to the near plane from the given camera.
object | The distance as a number. |
getCurrentCamera | ( | ) |
Retrieves the active camera.
getProjectedPoint | ( | object | , |
point | |||
) |
Converts global vector to a projected vector inside the given camera viewport.
object | The camera. |
point | A vec3 containing positional data. |
getUnProjectedPoint | ( | object | , |
point | |||
) |
Converts a projected vector to a global vector using the given camera.
This conversion uses the camera to determine the global coordinates for a perspectively transformed point. This can be used to generate a ray for use in raytracing as shown in the example.
object | The camera to use. |
point | A vec3 containing positional data. |
isCameraFogEnabled | ( | object | ) |
Checks if the given camera is configured to render fog.
object | The camera. |
isCameraOrtho | ( | object | ) |
Checks if the given camera is configured to be orthographic.
object | The camera. |
setCameraClearColor | ( | object | , |
{r, g, b} | |||
) |
setCameraFar | ( | object | , |
far | |||
) |
Changes the distance to the far plane of the given camera.
object | The camera. |
far | The new distance. |
setCameraFogDistance | ( | object | , |
fogDistance | |||
) |
Changes the distance to the fog rendered by the given camera.
object | The camera. |
fogDistance | The new distance. |
setCameraFov | ( | object | , |
fov | |||
) |
Changes the field of view of the given camera.
object | The camera. |
fov | The new field of view. |
setCameraNear | ( | object | , |
near | |||
) |
Changes the distance to the near plane of the given camera.
object | The camera. |
near | The new distance. |