static int ShowShadowCamera(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); PTZCamera.ShowShadowCamera(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_Field(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PTZCamera obj = (PTZCamera)o; float ret = obj.Field; LuaDLL.lua_pushnumber(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Field on a nil value" : e.Message)); } }
static int get_Instence(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PTZCamera obj = (PTZCamera)o; PTZCamera ret = obj.Instence; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Instence on a nil value" : e.Message)); } }
static int set_FarClipPlane(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); PTZCamera obj = (PTZCamera)o; float arg0 = (float)LuaDLL.luaL_checknumber(L, 2); obj.FarClipPlane = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index FarClipPlane on a nil value" : e.Message)); } }
void OnEnable() { model = target as PTZCamera; }
static void Main(string[] args) { int max_speed = 100; int x_speed = 0; int y_speed = 0; bool speed_Changed; HttpClient client = new HttpClient(); PTZCamera cam = new PTZCamera("192.168.0.42", "admin", "1234", client); while (true) { speed_Changed = false; if (Keyboard.GetState().IsKeyDown(Key.Up)) { if (y_speed != max_speed) { y_speed = max_speed; speed_Changed = true; } } else if (Keyboard.GetState().IsKeyDown(Key.Down)) { if (y_speed != -max_speed) { y_speed = -max_speed; speed_Changed = true; } } else if (y_speed != 0) { y_speed = 0; speed_Changed = true; } if (Keyboard.GetState().IsKeyDown(Key.Left)) { if (x_speed != -max_speed) { x_speed = -max_speed; speed_Changed = true; } } else if (Keyboard.GetState().IsKeyDown(Key.Right)) { if (x_speed != max_speed) { x_speed = max_speed; speed_Changed = true; } } else if (x_speed != 0) { x_speed = 0; speed_Changed = true; } if (speed_Changed) { Console.WriteLine("x,y: " + x_speed + ", " + y_speed); cam.set_speeds(x_speed, y_speed); } } }
public override byte[] GetCameraImage(int height, int width) { PTZCamera camera = (PTZCamera)PTZCamera.GetObject(PTZCamera.sClassName, PTZCamera.port); return(camera.GetRawImage()); }
void Awake() { instence = this; m_Cameras = GetComponentsInChildren <Camera>(); UpdateAll(); }