camera is a class that contains 3 properties, 2 methods and 0 events.
This class cannot be constructed, it is managed by Teverse.
In teverse, the user views the 3D scene through a camera. You can control the camera's position, orientation and field of view to alter what part of the scene the user can see.
With our Lua api, you can access the camera singleton through
teverse.scene.camera. Note that your tevapp manifest should have permissions to access the scene singleton.
field of viewCODE SAMPLE
camera.fov = 1.0 print(camera.fov) --> 1.0
camera.position = vector3(10, 10, 10) print(camera.position) --> vector3(10, 10, 10)
camera.rotation = quaternion print(camera.rotation) --> quaternion
Returns a 3d vectorCODE SAMPLE
camera:screenToWorld(vector2(10, 10)) --> vector3(10, 10, 10), number
Returns a 2d screen space vector and a number representing depthCODE SAMPLE
camera:worldToScreen(vector3(10, 10, 10)) --> vector2(10, 10), number