IEnumerator FindProjectorData(int projectorNumber) { yield return(new WaitUntil(() => EnsembleManager.Manager != null)); ProjectorData projectorData = EnsembleManager.Manager.data.projectors.ElementAt(projectorNumber); Projector = new ProjectorCamera(projectorData); }
public Task ProjectAsync(Test.CreditChanged message, ProjectorData data) { var transaction = read.Get <Transaction>(message.StreamId); transaction.Credit = message.Credit; write.Save(transaction); var p = GetFun(); return(Task.CompletedTask); }
public Task ProjectAsync(Test.TransactionAdded message, ProjectorData data) { var newTran = new Transaction { Id = message.StreamId, Name = message.Name, Credit = message.Credit }; write.Save(newTran); return(Task.CompletedTask); // throw new NotImplementedException(); }
public async Task ProjectAsync(Domain.COURSE.CourseCreated message, ProjectorData data) { var collection = _ds.GetCollection <CourseModel>(); var item = new CourseModel { Id = message.StreamId.ToString(), Name = message.Name, Credit = message.Credit, }; await collection.InsertOneAsync(item); // throw new NotImplementedException(); }
public ProjectorCamera(ProjectorData projectorData) { // Take the inverse because we need to map projector's center to origin. Matrix4x4 worldToCameraMatrix = projectorData.pose.inverse; // Reflect in z axis because worldToCameraMatrix is OpenGL convention. // It uses negative z axis as the direction the camera looks in. worldToCameraMatrix = Matrix4x4.Scale(new Vector3(1, 1, -1)) * worldToCameraMatrix; // Flip x translation, and y, z rotations to account for left-handedness worldToCameraMatrix[0, 3] = -worldToCameraMatrix[0, 3]; worldToCameraMatrix[0, 1] = -worldToCameraMatrix[0, 1]; worldToCameraMatrix[1, 0] = -worldToCameraMatrix[1, 0]; worldToCameraMatrix[0, 2] = -worldToCameraMatrix[0, 2]; worldToCameraMatrix[2, 0] = -worldToCameraMatrix[2, 0]; Camera.main.worldToCameraMatrix = worldToCameraMatrix; Matrix4x4 projectionMatrix = GraphicsTransforms.ProjectionFromIntrinsicCamera( projectorData.cameraMatrix, projectorData.width, projectorData.height); Camera.main.projectionMatrix = projectionMatrix; ProjectedRect = new ProjectionRect(GetProjectedPoints()); }