aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/scene/icamera.cpp
diff options
context:
space:
mode:
authorAlexander <alex@cogarr.net>2020-06-29 15:29:03 -0400
committerAlexander <alex@cogarr.net>2020-06-29 15:29:03 -0400
commit80789508b9655d25629223b9dcc84b4cfb77ce45 (patch)
tree37e140e532af61c1ca4699c8b6254cf2cb07ed02 /src/client/lua_api/scene/icamera.cpp
parent44a1421c393632978d59c0698a93ae22243b97e9 (diff)
downloadbrokengine-80789508b9655d25629223b9dcc84b4cfb77ce45.tar.gz
brokengine-80789508b9655d25629223b9dcc84b4cfb77ce45.tar.bz2
brokengine-80789508b9655d25629223b9dcc84b4cfb77ce45.zip
Updates for mdoc
Also more tests
Diffstat (limited to 'src/client/lua_api/scene/icamera.cpp')
-rw-r--r--src/client/lua_api/scene/icamera.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/client/lua_api/scene/icamera.cpp b/src/client/lua_api/scene/icamera.cpp
index 003f2ad..34b3447 100644
--- a/src/client/lua_api/scene/icamera.cpp
+++ b/src/client/lua_api/scene/icamera.cpp
@@ -22,6 +22,20 @@ using namespace core;
extern IrrlichtDevice* device;
+/***
+Create a maya camera
+Creates a camera that can be controlled with maya style controls by default,
+click and drag rotates the camera, while right click and mouse up/down zooms
+in or out.
+@function scene.newmayacamera()
+@treturn iscenemayacamera
+*/
+/***
+A maya camera.
+A camera that can be controlled similar to the 3d modeling software "Maya"
+@class iscenemayacamera
+@inherits iscenecamera
+*/
static int newiscenemayacamera(lua_State* L){
printf("createing maya camera!\n");
ISceneManager* smgr = device->getSceneManager();
@@ -38,6 +52,20 @@ static int newiscenemayacamera(lua_State* L){
return 1;
}
+/***
+Create an fps camera.
+Create a camera with default first person shooter controls. The camera and
+be rotated with the mouse, and moved with the arrow keys.
+@function scene.newfpscamera()
+@treturn iscenefpscamera The camera
+*/
+/***
+A camera with default FPS controls
+An FPS camera can be controlled with the arrow keys, and rotated with the mouse
+by default.
+@class iscenefpscamera
+@inherits iscenecamera
+*/
// ifpscamera.new()
static int newiscenefpscamera(lua_State* L){//
ISceneManager* smgr = device->getSceneManager();
@@ -60,6 +88,21 @@ static int newiscenefpscamera(lua_State* L){//
return 1;
}
+/***
+Create a new camera
+Creates a new camera at the given position.
+@function scene.newiscenecamera(vector3d position, vector3d lookat, iscenenode parent)
+@tparam vector3d position The position to create the camera in
+@tparam vector3d lookat A vector for the camera to look at. Use this to set it's rotation.
+@tparam? iscenenode parent A node to parent this camera to. If the parent moves, the camera will move with it.
+@treturn iscenecamera The camera
+*/
+/***
+A camera.
+The world is rendered through cameras.
+@class iscenecamera
+@inherits iscenenode
+*/
//iscenecamera.new(Vector position, Vector lookat,{node=parent})
static int newiscenecamera(lua_State* L){
printf("Createing camera!\n");
@@ -98,6 +141,12 @@ static int newiscenecamera(lua_State* L){
return 1;
}
+/***
+Lock on
+Should the camera be locked on to something?
+@function iscenecamera:bindtarget(boolean bind)
+@tparam boolean bind Should the camera be locked on to it's "lookat"?
+*/
//camera:bind_target(bool) :: nil
static int icamerabindtarget(lua_State *L){
int should_bind = lua_toboolean(L,-1);//{node=ud_cam},bool_shouldbind
@@ -110,6 +159,12 @@ static int icamerabindtarget(lua_State *L){
return 0;
}
+/***
+Gets the target of a camera
+Gets the vector that a camera is looking at
+@function iscenecamera:gettarget()
+@treturn vector3d The vector that the camera is looking at
+*/
//camera:gettarget() :: v3f
static int icameragettarget(lua_State *L){
lua_getfield(L,-1,"node");
@@ -120,6 +175,12 @@ static int icameragettarget(lua_State *L){
return 1;
}
+/***
+Set the camera's target
+Forcefully set the rotation the camera should be looking
+@function iscenecamera:settarget(vector3d target)
+@tparam vector3d target The vector that the camera should be looking at
+*/
//camera:settarget(v3f)
static int icamerasettarget(lua_State *L){
double x,y,z;