/// <summary> /// 摄像头的选择改变事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void camera_CheckChanged(object sender, EventArgs e) { ToolStripMenuItem menu_item = sender as ToolStripMenuItem; CameraEntity cameraEntity = menu_item.Tag as CameraEntity; camera.BindCamera(cameraEntity.Name); }
void RenderResults(RenderMode renderMode, MatrixTransforms transforms, CameraEntity currentCamera) { _timeAttenuationHandle.SetValue(new xna.Vector4(100 * (float)Math.Cos(_appTime * (1.0f / SCAN_INTERVAL)), 0, 0, 1)); // render impact points as a quad xna.Matrix inverseViewRotation = currentCamera.ViewMatrix; inverseViewRotation.M41 = inverseViewRotation.M42 = inverseViewRotation.M43 = 0; xna.Matrix.Invert(ref inverseViewRotation, out inverseViewRotation); xna.Matrix localTransform = xna.Matrix.CreateFromAxisAngle(new xna.Vector3(1, 0, 0), (float)-Math.PI / 2) * inverseViewRotation; SimulationEngine.GlobalInstance.Device.RenderState.DepthBufferWriteEnable = false; for (int i = 0; i < _lastResults.ImpactPoints.Count; i++) { xna.Vector3 pos = new xna.Vector3(_lastResults.ImpactPoints[i].Position.X, _lastResults.ImpactPoints[i].Position.Y, _lastResults.ImpactPoints[i].Position.Z); xna.Vector3 resultDir = pos - Position; resultDir.Normalize(); localTransform.Translation = pos - .02f * resultDir; transforms.World = localTransform; base.Render(renderMode, transforms, Meshes[0]); } SimulationEngine.GlobalInstance.Device.RenderState.DepthBufferWriteEnable = true; }
private void AddCamera(CameraEntity camera, bool select) { if (camera != null) { // Store camera entity and subscribe to it to receive images CameraInfo ci = new CameraInfo() { Camera = camera }; subscribeCamera(ci); // Add it to the camera list Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new ThreadStart(delegate() { SimCamBox.Items.Add(new ComboBoxItem() { Content = (camera.EntityState != null ? camera.EntityState.Name : "Unnamed camera"), Tag = ci }); if (select) { SimCamBox.SelectedIndex = SimCamBox.Items.Count - 1; } // Trigger the SimulatorFound event if this is the first camera found if (SimCamBox.Items.Count == 1) { SimulatorFound.Invoke(this, new EventArgs()); } })); } }
private void CreateEntities() { var tiledMap = content.Load <TiledMap>(_settings.MapTile); String[] tiledMapLayers = new[] { TiledImportCollisionLayers.BACK_WALLS, TiledImportCollisionLayers.SIDE_WALLS, TiledImportCollisionLayers.NET }; int[] tiledMapPhysicsLayers = new[] { PhysicsLayers.BACK_WALLS, PhysicsLayers.SIDE_WALLS, PhysicsLayers.NET }; var tiledMapComponent = new Handy.Components.TiledMapComponent(tiledMap, tiledMapLayers, tiledMapPhysicsLayers, true); var entity = new Entity(); entity.name = "Map"; tiledMapComponent.renderLayer = RenderLayers.BACKGROUND; entity.addComponent(tiledMapComponent); addEntity(entity); var gameState = new GameState(); gameState.StateEnum = GameStates.Ready; gameState.Players = new Player.Player[_settings.NumPlayers]; for (var i = 0; i < _settings.NumPlayers; i++) { var playerSettings = _settings.Players[i]; var player = new Player.Player(playerSettings); addEntity(player); gameState.Players[i] = player; } var ball = new Ball.Ball(); addEntity(ball); gameState.Ball = ball; GameStateEntity = new Entity(); GameStateEntity.name = "Game"; GameStateEntity.addComponent(new GameStateComponent(gameState)); GameStateEntity.addComponent(new TimerComponent()); GameStateEntity.addComponent(new HitStopComponent()); var scoreboard = new UICanvas(); scoreboard.name = "scoreboard"; scoreboard.renderLayer = RenderLayers.FOREGROUND; GameStateEntity.addComponent(scoreboard); addEntity(GameStateEntity); // add camera var cam = new Camera(); var cameraShake = new CameraShakeComponent(); CameraEntity.addComponent(cam); CameraEntity.addComponent(cameraShake); CameraEntity.name = "Camera"; addEntity(CameraEntity); }
protected override void Start() { base.Start(); mainCamera = mainCameraComponent; cameraEntity = mainCamera.GetComponent <CameraEntity>(); cameraMovable = mainCamera.GetComponent <Movable>(); lastOrthoSize = OrthographicSize; tileMapManager.UpdateDimensions(OrthographicSize); }
public async Task <IActionResult> Save([FromBody] CameraViewModel model) { try { CameraEntity entity = null; if (!ModelState.IsValid) { return(Ok(new ResponseModel() { Result = ResultCode.NotValidData })); } var item = await _dm.CameraAccessor.GetCamera(model.Producer, model.Model); if (item != null && item.Id != model.Id) { return(Ok(new ResponseModel() { Result = ResultCode.AlreadyExists })); } if (model.Id <= 0) { entity = new CameraEntity(); } else { entity = await _dm.CameraAccessor.GetCamera(model.Id); if (entity == null) { return(Ok(new ResponseModel() { Result = ResultCode.AlreadyExists })); } } var entityToSave = model.ToCameraEntity(); await _dm.CameraAccessor.SaveCamera(entityToSave); return(Ok(new ResponseModel() { Result = ResultCode.Success })); } catch (Exception ex) { return(Ok(new ResponseModel() { Result = ResultCode.ServerError, Description = ex.Message })); } }
public async Task <CameraEntity> SaveCamera(CameraEntity entity) { var _item = await Query.Where(e => e.Id == entity.Id).FirstOrDefaultAsync(); if (_item == null) { _item = (await SaveEntity(entity.ToCamera(null))); } else { _item = (await SaveEntity(entity.ToCamera(_item))); } return(await GetCamera(_item.Id)); }
public static CameraViewModel ToCameraViewModel(this CameraEntity entity) { CameraViewModel model = new CameraViewModel(); model.Id = entity.Id; model.Model = entity.Model; model.Objective = entity.Objective; model.Producer = entity.Producer; model.FocalLength = entity.FocalLength; model.MatrixType = entity.MatrixType; model.DescriptionFORM = entity.Description; model.Name = entity.Producer; return(model); }
private void DrawCamera(CameraEntity cameraEntity) { var windowWidth = ImGui.GetWindowSize().X; var windowHeight = ImGui.GetWindowSize().Y; var camera = cameraEntity.GetComponent <CameraComponent>(); var ratio = camera.Resolution.X / camera.Resolution.Y; var image = camera.Framebuffer.ColorTexture; var cameraScale = 1.0f; ImGui.Image( (IntPtr)image, new System.Numerics.Vector2(windowHeight * ratio, windowHeight) * cameraScale, new System.Numerics.Vector2(0, 1), new System.Numerics.Vector2(1, 0)); }
private void Initialize() { LogOffCommand = new DelegateCommand(OnLogOffCommand); CameraEntity = new CameraEntity(); CameraEntity.Eye = "OD"; SaveCommand = new DelegateCommand(OnSaveCommand); CamStartCommand = new DelegateCommand(OnCamStartCommand); CamStopCommand = new DelegateCommand(OnCamStopCommand); CamPosteriorCommand = new DelegateCommand(OnCamPosteriorCommand); CamAnteriorCommand = new DelegateCommand(OnCamAnteriorCommand); CaptureCommand = new DelegateCommand(OnCaptureCommand); ReportViewCommand = new DelegateCommand(OnReportViewCommand); BackCommand = new DelegateCommand(OnBackCommand); PatientReport = new PatientReport(); ConnectCamera(); }
public static CameraEntity ToCameraEntity(this CameraViewModel model) { CameraEntity entity = new CameraEntity(); if (model.Id > 0) { entity.Id = model.Id; } entity.Model = model.Model; entity.Objective = model.Objective; entity.Producer = model.Producer; entity.FocalLength = model.FocalLength; entity.MatrixType = model.MatrixType; entity.Description = model.DescriptionFORM; return(entity); }
public static Camera ToCamera(this CameraEntity newEntity, Camera oldEntity = null) { Camera entity = oldEntity; if (entity == null) { entity = new Camera(); } entity.Producer = newEntity.Producer; entity.Model = newEntity.Model; entity.Objective = newEntity.Objective; entity.FocalLength = newEntity.FocalLength; entity.MatrixType = newEntity.MatrixType; entity.Description = newEntity.Description; return(entity); }
public static CameraEntity ToCameraEntity(this Camera model) { if (model == null) { return(null); } CameraEntity entity = new CameraEntity(); entity.Id = model.Id; entity.Producer = model.Producer; entity.Model = model.Model; entity.Objective = model.Objective; entity.FocalLength = model.FocalLength; entity.MatrixType = model.MatrixType; entity.Description = model.Description; return(entity); }
private void CreateEntities() { var gameState = new PracticeGameState(); gameState.StateEnum = PracticeGameStates.WaitingForPlayersToJoin; // to start we don't have any choosers or players! GameStateEntity = new Entity(); GameStateEntity.name = "PracticeGame"; GameStateEntity.addComponent(new PracticeGameStateComponent(gameState)); addEntity(GameStateEntity); // add camera var cam = new Camera(); var cameraShake = new CameraShakeComponent(); CameraEntity.addComponent(cam); CameraEntity.addComponent(cameraShake); CameraEntity.name = "Camera"; addEntity(CameraEntity); }
void AddScribblerRobot(Vector3 position) { ScribblerRobot robotBaseEntity = CreateScribblerMotorBase(ref position); // Create bumper array entity and start simulated bumper service BumperArrayEntity bumperArray = CreateBumperArray(); // insert as child of motor base robotBaseEntity.InsertEntity(bumperArray); // create Camera Entity ans start SimulatedWebcam service CameraEntity camera = CreateCamera(); // insert as child of motor base robotBaseEntity.InsertEntity(camera); // Finaly insert the motor base and its two children // to the simulation SimulationEngine.GlobalInstancePort.Insert(robotBaseEntity); }
private CameraEntity CreateCamera() { // low resolution, wide Field of View CameraEntity cam = new CameraEntity(320, 240, ((float)Math.PI * 0.4f)); cam.State.Name = "ScribblerCamera"; // just on top of the bot cam.State.Pose.Position = new Vector3(0.0f, 0.127f, 0.0f); // camera renders in an offline buffer at each frame // required for service cam.IsRealTimeCamera = true; // Start simulated webcam service //simwebcam.Contract.CreateService( // ConstructorPort, // Microsoft.Robotics.Simulation.Partners.CreateEntityPartner( // "http://localhost/" + cam.State.Name) //); return(cam); }
public void DrawSkybox(CameraEntity camera) { Gl.Disable(EnableCap.CullFace); var modelMatrix = Matrix4x4.Identity; var scale = 10000.0f; modelMatrix *= Matrix4x4.CreateScale(scale); skyboxShader.Use(); skyboxShader.SetMatrix("projMatrix", camera.GetComponent <CameraComponent>().ProjMatrix); skyboxShader.SetMatrix("viewMatrix", camera.GetComponent <CameraComponent>().ViewMatrix); skyboxShader.SetMatrix("modelMatrix", modelMatrix); skyboxShader.SetInt("environmentMap", 0); Gl.ActiveTexture(TextureUnit.Texture0); Gl.BindTexture(TextureTarget.TextureCubeMap, skybox.Id); skyboxCube.Draw(); Gl.BindTexture(TextureTarget.TextureCubeMap, 0); Gl.Enable(EnableCap.CullFace); }
private CameraEntity CreateCamera() { // low resolution, wide Field of View CameraEntity cam = new CameraEntity(320, 240, ((float)Math.PI * 0.4f)); cam.State.Name = "ScribblerCamera"; // just on top of the bot cam.State.Pose.Position = new Vector3(0.0f, 0.127f, 0.0f); // camera renders in an offline buffer at each frame // required for service cam.IsRealTimeCamera = true; // Start simulated webcam service //simwebcam.Contract.CreateService( // ConstructorPort, // Microsoft.Robotics.Simulation.Partners.CreateEntityPartner( // "http://localhost/" + cam.State.Name) //); return cam; }
private void AddCamera(CameraEntity camera, bool select) { if (camera != null) { // Store camera entity and subscribe to it to receive images CameraInfo ci = new CameraInfo() { Camera = camera }; subscribeCamera(ci); // Add it to the camera list Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new ThreadStart(delegate() { SimCamBox.Items.Add(new ComboBoxItem() { Content = (camera.EntityState != null ? camera.EntityState.Name : "Unnamed camera"), Tag = ci }); if (select) SimCamBox.SelectedIndex = SimCamBox.Items.Count - 1; // Trigger the SimulatorFound event if this is the first camera found if (SimCamBox.Items.Count == 1) SimulatorFound.Invoke(this, new EventArgs()); })); } }
/// <summary> /// Frame render /// </summary> public override void Render(RenderMode renderMode, MatrixTransforms transforms, CameraEntity currentCamera) { if ((int)(Flags & VisualEntityProperties.DisableRendering) > 0) { return; } if (_lastResults != null) { RenderResults(renderMode, transforms, currentCamera); } }
/* // TT - Changed in V1.5 with different parameters /// <summary> /// Render entities stored as fields /// </summary> /// <param name="device"></param> /// <param name="transforms"></param> /// <param name="currentCamera"></param> public override void Render(xnagrfx.GraphicsDevice device, MatrixTransforms transforms, Microsoft.Robotics.Simulation.Engine.CameraEntity currentCamera) { _leftWheel.Render(device, transforms, currentCamera); _rightWheel.Render(device, transforms, currentCamera); base.Render(device, transforms, currentCamera); } */ /// <summary> /// Render entities stored as fields /// </summary> public override void Render(RenderMode renderMode, MatrixTransforms transforms, CameraEntity currentCamera) { _leftWheel.Render(renderMode, transforms, currentCamera); _rightWheel.Render(renderMode, transforms, currentCamera); base.Render(renderMode, transforms, currentCamera); }
/// <summary> /// Frame render /// </summary> public override void Render(RenderMode renderMode, MatrixTransforms transforms, CameraEntity currentCamera) { if ((int)(Flags & VisualEntityProperties.DisableRendering) > 0) return; if (_lastResults != null) RenderResults(renderMode, transforms, currentCamera); }
// TT - Copied from Oct CTP private CameraEntity CreateCamera() { // low resolution, wide Field of View CameraEntity cam = new CameraEntity(320, 240, ((float)Math.PI * 0.4f)); //CameraEntity cam = new CameraEntity(320, 240); // TT Dec-2006 - Remove slash for V1.0 cam.State.Name = "robocam"; // just on top of the bot cam.State.Pose.Position = new Vector3(0.0f, 0.5f, 0.0f); // reverse the orientation // TT Dec-2006 - No longer necessary to reverse the orientation // because it was only a temporary hiccup in the CTPs //cam.State.Pose.Orientation = Quaternion.FromAxisAngle(0, 1, 0, (float)(Math.PI)); // camera renders in an offline buffer at each frame // required for service cam.IsRealTimeCamera = true; // Start simulated webcam service // TT Dec-2006 - Subtle change for V1.0 //CreateService( // simwebcam.Contract.Identifier, // Microsoft.Robotics.Simulation.Partners.CreateEntityPartner( // "http://localhost" + cam.State.Name) //); simwebcam.Contract.CreateService( ConstructorPort, Microsoft.Robotics.Simulation.Partners.CreateEntityPartner( "http://localhost/" + cam.State.Name) ); return cam; }
void InsertEntityNotificationHandler(InsertSimulationEntity ins) { _observer = (CameraEntity)ins.Body; _observer.Subscribe(_bitmapPort); }
public void Add(CameraEntity camera) { ctx.Cameras.Add(camera); ctx.SaveChanges(); }
public override void WriteToFile(MemoryStream stream, bool isBigEndian) { base.WriteToFile(stream, isBigEndian); CameraEntity.WriteToFile(stream, isBigEndian); TargetCameraEntity.WriteToFile(stream, isBigEndian); }
public override void ReadFromFile(MemoryStream stream, bool isBigEndian) { base.ReadFromFile(stream, isBigEndian); CameraEntity.ReadFromFile(stream, isBigEndian); TargetCameraEntity.ReadFromFile(stream, isBigEndian); }
/// <summary> /// 1添加设备 2初次添加设备通道 /// </summary> /// <returns>ResponseBaseDto</returns> public ResponseBaseDto AddDevice(string deviceName, string serialNumber, string customerToken) { ResponseBaseDto dto = new ResponseBaseDto(); TokenCacheProperty tcp = new TokenCacheProperty(); UserTokenCache utc = UserTokenCache.GetInstance(); OperaterLog oLog = new OperaterLog(); oLog.Action = " 添加设备 "; try { dto = bllHelper.CheckCustomer(dto, customerToken, ref tcp); //获取 判定token if (utc.IsValid(customerToken) == false) { dto.Code = (int)CodeEnum.ServerNoToken; dto.Message = "Token已失效"; } else { Device device = new Device(); device.SerialNumber = serialNumber; IList <Device> deviceFlag = deviceServer.SelectDeviceSerialNumber(device); if (device != null && deviceFlag.Count != 0) { //设备被添加过 dto.Code = (int)CodeEnum.NoHardWare; dto.Message = "此设备正在被使用中"; oLog.Result = dto.Code; oLog.Remarks = dto.Message; bllHelper.AddOperaterLog(oLog, tcp); return(dto); } //参数 0=IP 3等于 CN AddDeviceResponseDto result = AddDeviceMethod(serialNumber); if (result != null && result.Success == true) { //添加本地设备列表 Bsr.Cloud.Model.Entities.Device dev = new Model.Entities.Device(); dev.SerialNumber = result.DeviceDto.AddDeviceEntity.SerialNumber; dev.BPServerDeviceId = result.DeviceDto.AddDeviceEntity.Id; if (deviceName == null || deviceName == "") { deviceName = "BStar"; } dev.DeviceName = deviceName; // 序列号添加时填3,需用IDeviceEntity.getDeviceType获取真正实际类型 dev.DeviceType = result.DeviceDto.AddDeviceEntity.AddMode; dev.HardwareType = result.DeviceDto.AddDeviceEntity.HardwareType; dev.CustomerId = tcp.CustomerId; dev.UserName = result.DeviceDto.AddDeviceEntity.User; dev.PassWord = result.DeviceDto.AddDeviceEntity.Password; //以规则需要定义服务器位置 BPServerConfig bpServerConfig = new BPServerConfig(); bpServerConfig.Domain = "default"; IList <BPServerConfig> bpServerConfigFlag = bpServerConfigServer.GetBPServerConfigByDomain(bpServerConfig); if (bpServerConfigFlag != null && bpServerConfigFlag.Count != 0) { dev.BPServerConfigId = bpServerConfigFlag[0].BPServerConfigId; } else { dev.BPServerConfigId = 1; //需修改 } int deviceId = deviceServer.InsertDevice(dev); //日志动作的目标对象Id oLog.TargetId = deviceId; //通道添加 IList <CameraEntity> channelFlag = result.DeviceDto.AddDeviceEntity.Cameras; for (int i = 0; i < channelFlag.Count; i++) { Bsr.Cloud.Model.Entities.Channel channel = new Model.Entities.Channel(); CameraEntity ce = channelFlag[i]; channel.DeviceId = deviceId; channel.ChannelNumber = ce.ChannelNo; channel.ChannelName = ce.Name; channel.IsEnable = 1; channel.BPServerChannelId = ce.Id; channel.ImagePath = "default.jpg"; channelServer.InsertChannel(channel); } dto.Code = (int)CodeEnum.Success; dto.Message = "设备" + deviceName + "已添加完成!"; } else { dto.Code = (int)CodeEnum.NoHardWare; dto.Message = result.Message; } } } catch (Exception ex) { dto.Code = (int)CodeEnum.ApplicationErr; dto.Message = "网络异常,添加设备时,远程连接超时!"; myLog.ErrorFormat("AddDevice方法异常,设备名:{0}, 设备序列号:{1}", ex, deviceName, serialNumber); } oLog.TargetType = (int)OperaterLogEnum.Device; oLog.Result = dto.Code; oLog.Remarks = dto.Message; bllHelper.AddOperaterLog(oLog, tcp); return(dto); }
/// <summary> /// Renders 4x4 body and all of its four wheels /// </summary> /// <param name="renderMode"></param> /// <param name="transforms"></param> /// <param name="currentCamera"></param> public override void Render(RenderMode renderMode, MatrixTransforms transforms, CameraEntity currentCamera) { _leftFrontWheel.Render(renderMode, transforms, currentCamera); _rightFrontWheel.Render(renderMode, transforms, currentCamera); _leftRearWheel.Render(renderMode, transforms, currentCamera); _rightRearWheel.Render(renderMode, transforms, currentCamera); base.Render(renderMode, transforms, currentCamera); }
void DeleteEntityNotificationHandler(DeleteSimulationEntity del) { _observer = null; }
public GameWorld() { Camera = new CameraEntity(new Vector3(0, 0, -10.0f), Quaternion.FromAxisAngle(Vector3.UnitZ, 0)); Entities = new List <Entity>(); Instance = this; }
/// <summary> /// 刷新当前机器状态 /// </summary> internal static void refreshDeviceInfo() { #region 刷新摄像头状态 var remindCamera = XmlHelper.XmlHelper.FindAll <CameraEntity>(); if (remindCamera == null) { remindCamera = new List <CameraEntity>(); } //当前可以获取到的所有摄像头 DsDevice[] findCamera = GetAllVideoDevice(); if (findCamera == null || findCamera.Length == 0) { //更新集合 if (remindCamera?.Count > 0) { //所有的摄像头不可用 remindCamera.ForEach(m => { m.Status = 3; } ); XmlHelper.XmlHelper.SaveList <CameraEntity>(remindCamera); } throw new Exception("未找到可用的摄像头"); } List <DsDevice> findCameraList = findCamera.ToList(); //遍历已经记录的摄像,在当前可寻找到的摄像头中查找 foreach (var item in remindCamera) { DsDevice CameraDevice = findCameraList.Find(m => m.Name == item.Name); if (CameraDevice == null) { item.Status = 3; } } //遍历寻找到的摄像头,在记录的摄像头中进行寻找 foreach (var item in findCameraList) { CameraEntity cameraEntity = remindCamera.Find(m => m.Name == item.Name); if (cameraEntity == null) { cameraEntity = new CameraEntity(); cameraEntity.Name = item.Name; cameraEntity.Status = 0; remindCamera.Add(cameraEntity); } } XmlHelper.XmlHelper.SaveList <CameraEntity>(remindCamera); #endregion #region 刷新音频状态 var remindAudio = XmlHelper.XmlHelper.FindAll <AudioEntity>(); if (remindAudio == null) { remindAudio = new List <AudioEntity>(); } //当前可以获取到的所有摄像头 DsDevice[] findAudio = GetAllAudioDevice(); if (findAudio == null || findAudio.Length == 0) { //更新集合 if (remindAudio?.Count > 0) { //所有的摄像头不可用 remindAudio.ForEach(m => { m.Status = 3; } ); XmlHelper.XmlHelper.SaveList <AudioEntity>(remindAudio); } throw new Exception("未找到可用的音频"); } List <DsDevice> findAudioList = findAudio.ToList(); //遍历已经记录的摄像,在当前可寻找到的摄像头中查找 foreach (var item in remindAudio) { DsDevice CameraDevice = findAudioList.Find(m => m.Name == item.Name); if (CameraDevice == null) { item.Status = 3; } } //遍历寻找到的摄像头,在记录的摄像头中进行寻找 foreach (var item in findAudioList) { AudioEntity audioEntity = remindAudio.Find(m => m.Name == item.Name); if (audioEntity == null) { audioEntity = new AudioEntity(); audioEntity.Name = item.Name; audioEntity.Status = 0; remindAudio.Add(audioEntity); } XmlHelper.XmlHelper.SaveList <AudioEntity>(remindAudio); } #endregion }
/// <summary> /// The render method gets called every frame iteration to render the new frame /// </summary> /// <param name="renderMode">The current render mode</param> /// <param name="transforms">The matrix transformations to be applied</param> /// <param name="currentCamera">The curren camera</param> public override void Render(VisualEntity.RenderMode renderMode, MatrixTransforms transforms, CameraEntity currentCamera) { // Render the propeller shape RenderShape(renderMode, transforms, propellerShapeProperties, Meshes[0]); }
/// <summary> /// 释放资源 /// </summary> public void Dispose() { if (VerStarPreview()) { CameraEntity camera = new CameraEntity(); camera.Name = this._bindCameraName; camera.Status = 0; camera.Save(); } if (_mediaControl != null) { _mediaControl.Stop(); _mediaControl = null; } if (_graphBuilder != null) { Marshal.ReleaseComObject(_graphBuilder); _graphBuilder = null; } if (_captureGraphBuilder != null) { Marshal.ReleaseComObject(_captureGraphBuilder); _captureGraphBuilder = null; } if (sampleGrabber != null) { Marshal.ReleaseComObject(sampleGrabber); sampleGrabber = null; } if (_theCamera != null) { Marshal.ReleaseComObject(_theCamera); _theCamera = null; } if (_theCameraCompressor != null) { Marshal.ReleaseComObject(_theCameraCompressor); _theCameraCompressor = null; } if (_theAudio != null) { Marshal.ReleaseComObject(_theAudio); _theAudio = null; } if (_theAudioCompressor != null) { Marshal.ReleaseComObject(_theAudioCompressor); _theAudioCompressor = null; } if (mux != null) { Marshal.ReleaseComObject(mux); mux = null; } if (sink != null) { Marshal.ReleaseComObject(sink); sink = null; } //DisposeDevice(dsVideoDevice);//释放视频设备 //DisposeDevice(dsVideoCompressorCategory);//释放视频解码器设备 //DisposeDevice(dsAudioInputDevice);//释放语音设备 //DisposeDevice(dsAudioCompressorCategory);//释放语音解码器设备 }
public static IObservable <StateChange <CameraEntity, EntityState <CameraAttributes> > > StateAllChangesWithCurrent(this CameraEntity entity) { return(entity.StateAllChangesWithCurrent <CameraEntity, EntityState <CameraAttributes>, CameraAttributes>()); }
public override void onStart() { findEntity("Map").transform.position = new Vector2(-232, -40); findEntity(EntityNames.BALL).transform.position = new Vector2(400, 400); camera = CameraEntity.getComponent <Camera>(); }