public void ObjectDefocused(DeckObject deckObject) { if (selectionGrid.SelectedRows.Count != 0) { selectionGrid.ClearSelection(); } }
public void EvictCard(DeckObject destination) { //destination.CreateNewCard(cardObject); //cardObject.Destroy(); //card.Destroy(); //isOccupied = false; }
public void OnObjectUpdate(DeckObject deckObject) { if (objectId == deckObject.ObjectId) { RefreshUserInterfaceValues(deckObject); } }
public void OnObjectRemove(DeckObject deckObject) { int hordeId = m_objectIdHordeIdDictionary[deckObject.ObjectId]; h3d.removeNode(hordeId); m_objectIdHordeIdDictionary.Remove(deckObject.ObjectId); m_hordeIdObjectIdDictionary.Remove(hordeId); }
private void deleteObjectButton_Click(object sender, EventArgs e) { DeckObject deckObject = DeckProgram.DeckSelection.GetFocus(); if (deckObject != null) { DeckProgram.DeckEngine.RequestObjectDelete(deckObject.ObjectId); } }
public void ObjectDeselected(DeckObject deckObject) { DataRow row = m_selectionTable.Rows.Find(deckObject.ObjectId); if (row != null) { m_selectionTable.Rows.Remove(row); } }
private void zTextBox_Leave(object sender, EventArgs e) { DeckObject deckObject = DeckProgram.DeckScene.GetObject(objectId); Vector3 location = new Vector3(); location.X = deckObject.NetworkLocation.X; location.Y = deckObject.NetworkLocation.Y; location.Z = Convert.ToSingle(zTextBox.Text); DeckProgram.DeckEngine.RequestObjectUpdate(objectId, deckObject.ObjectName, location, deckObject.NetworkOrientation, deckObject.Radius); }
public void OnChatMessage(DeckObject sourceObject, string message) { textBox1.Text += sourceObject.ObjectName + " - " + message + Environment.NewLine; textBox1.Select(textBox1.Text.Length - 1, 0); textBox1.ScrollToCaret(); if (this.Visible == false) { this.Visible = true; } }
public void OnObjectAdd(DeckObject deckObject) { string modelUrl = deckObject.ModelUrl; int hordeId = h3d.addNodes(h3d.H3DRootNode, DeckProgram.AssetManager.GetAssetRendererId(deckObject.ModelUrl)); deckObject.RenderId = hordeId; m_hordeIdObjectIdDictionary.Add(hordeId, deckObject.ObjectId); m_objectIdHordeIdDictionary.Add(deckObject.ObjectId, hordeId); }
private void RefreshUserInterfaceValues(DeckObject deckObject) { objectId = deckObject.ObjectId; objectNameTextBox.Text = deckObject.ObjectName; typeNameTextBox.Text = deckObject.TypeName; xTextBox.Text = deckObject.NetworkLocation.X.ToString(); yTextBox.Text = deckObject.NetworkLocation.Y.ToString(); zTextBox.Text = deckObject.NetworkLocation.Z.ToString(); scaleTextBox.Text = deckObject.Radius.ToString(); }
private void insertObjectButton_Click(object sender, EventArgs e) { DeckObjectType objectType = (DeckObjectType)typeComboBox.SelectedItem; if (objectType == null) { return; } DeckObject avatarObject = DeckProgram.DeckScene.GetObject(DeckProgram.DeckEngine.AvatarId); DeckProgram.DeckEngine.RequestObjectInsert(objectType.TypeId, avatarObject.RenderLocation, Quaternion.Identity); }
public void ObjectFocused(DeckObject deckObject) { if (this.Visible == false) { this.Visible = true; } DataRow row = m_selectionTable.Rows.Find(deckObject.ObjectId); int rowIndex = m_selectionTable.Rows.IndexOf(row); if (selectionGrid.Rows.Count > rowIndex) { selectionGrid.Rows[rowIndex].Selected = true; } }
private void rollSubButton_Click(object sender, EventArgs e) { DeckObject deckObject = DeckProgram.DeckScene.GetObject(objectId); Quaternion originalOrientation = deckObject.NetworkOrientation; Matrix originalOrientationMatrix; Common.Rotate(out originalOrientationMatrix, ref originalOrientation); Matrix resultOrientationMatrix; Common.RotateZ(out resultOrientationMatrix, ref originalOrientationMatrix, -Common.DegreesToRadians(Convert.ToSingle(orientationStepTextBox.Text))); Quaternion resultOrientation; Common.Rotate(out resultOrientation, ref resultOrientationMatrix); DeckProgram.DeckEngine.RequestObjectUpdate(objectId, deckObject.ObjectName, deckObject.NetworkLocation, resultOrientation, deckObject.Radius); }
private void selectionGrid_CellClick(object sender, DataGridViewCellEventArgs e) { DataRow row = m_selectionTable.Rows[e.RowIndex]; DeckObject deckObject = (DeckObject)row["Object"]; if (Control.ModifierKeys == Keys.Control) { if (DeckProgram.DeckSelection.GetSelection().Contains(deckObject)) { DeckProgram.DeckSelection.DeselectObject(deckObject); } } else { if (DeckProgram.DeckSelection.GetFocus() != deckObject) { DeckProgram.DeckSelection.FocusObject(deckObject); } } }
public void OnObjectUpdate(DeckObject deckObject) { int hordeId = m_objectIdHordeIdDictionary[deckObject.ObjectId]; Matrix orientationMatrix; Quaternion orientation = deckObject.RenderOrientation; Common.Rotate(out orientationMatrix, ref orientation); Matrix translationMatrix = Matrix.CreateTranslation(deckObject.RenderLocation.X, deckObject.RenderLocation.Y, deckObject.RenderLocation.Z); Matrix scaleMatrix = Matrix.CreateScale(deckObject.RenderScale.X, deckObject.RenderScale.Y, deckObject.RenderScale.Z); Matrix transformationMatrix = Matrix.Multiply(scaleMatrix, Matrix.Multiply(Matrix.RotationY(Common.DegreesToRadians(180)) * orientationMatrix, translationMatrix)); h3d.setNodeTransMat(hordeId, transformationMatrix.ToArray(MatrixElementOrder.RowMajor)); if (deckObject.ObjectId == DeckProgram.DeckEngine.AvatarId) { DeckProgram.DeckRudder.AvatarCurrentLocation = deckObject.RenderLocation; DeckProgram.DeckRudder.AvatarCurrentOrientationMatrix = orientationMatrix; } }
private void renderPanel_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (Control.ModifierKeys != Keys.Control) { DeckProgram.DeckSelection.ClearSelection(); } DeckObject deckObject = DeckProgram.DeckRenderer.GetPointedObject(); if (deckObject != null) { if (DeckProgram.DeckSelection.GetSelection().Contains(deckObject)) { DeckProgram.DeckSelection.DeselectObject(deckObject); } else { DeckProgram.DeckSelection.FocusObject(deckObject); } } } }
private void objectNameTextBox_Leave(object sender, EventArgs e) { DeckObject deckObject = DeckProgram.DeckScene.GetObject(objectId); DeckProgram.DeckEngine.RequestObjectUpdate(objectId, objectNameTextBox.Text, deckObject.NetworkLocation, deckObject.NetworkOrientation, deckObject.Radius); }
public void ObjectDefocused(DeckObject deckObject) { this.Visible = false; }
private void Start() { Deck = GameObject.FindGameObjectWithTag("Deck").GetComponent <DeckObject>(); }
private void resetOrientationButton_Click(object sender, EventArgs e) { DeckObject deckObject = DeckProgram.DeckScene.GetObject(objectId); DeckProgram.DeckEngine.RequestObjectUpdate(objectId, deckObject.ObjectName, deckObject.NetworkLocation, Quaternion.Identity, deckObject.Radius); }
private void scaleTextBox_Leave(object sender, EventArgs e) { DeckObject deckObject = DeckProgram.DeckScene.GetObject(objectId); DeckProgram.DeckEngine.RequestObjectUpdate(objectId, deckObject.ObjectName, deckObject.NetworkLocation, deckObject.NetworkOrientation, Convert.ToSingle(scaleTextBox.Text)); }
public void ObjectDefocused(DeckObject deckObject) { deleteObjectButton.Enabled = false; }
private void scaleSubButton_Click(object sender, EventArgs e) { DeckObject deckObject = DeckProgram.DeckScene.GetObject(objectId); DeckProgram.DeckEngine.RequestObjectUpdate(objectId, deckObject.ObjectName, deckObject.NetworkLocation, deckObject.NetworkOrientation, deckObject.Radius * (1 - Convert.ToSingle(scaleStepTextBox.Text) / 100.0f)); }
public void ObjectSelected(DeckObject deckObject) { m_selectionTable.Rows.Add(new object[] { deckObject.ObjectId, deckObject.ObjectName, deckObject.TypeName, deckObject }); }
public void ObjectFocused(DeckObject deckObject) { RefreshUserInterfaceValues(deckObject); this.Visible = true; }
public void Process() { if (m_objectUpdateQueue.Count > 0) { foreach (Guid objectId in m_objectUpdateQueue) { CloudObject cloudObject = DeckProgram.CloudView.CloudCache.GetObject(objectId); OmModelPrimitiveExt modelPrimitiveExt = cloudObject.GetExtension <OmModelPrimitiveExt>(); Vector3 location = new Vector3(cloudObject.Location.X, cloudObject.Location.Y, cloudObject.Location.Z); Quaternion orientation = new Quaternion(cloudObject.Orientation.W, cloudObject.Orientation.X, cloudObject.Orientation.Y, cloudObject.Orientation.Z); Vector3 scale = new Vector3(cloudObject.BoundingSphereRadius * modelPrimitiveExt.Scale, cloudObject.BoundingSphereRadius * modelPrimitiveExt.Scale, cloudObject.BoundingSphereRadius * modelPrimitiveExt.Scale); bool isNewAvatar = objectId == AvatarId && !DeckProgram.DeckScene.ContainsObject(objectId); if (!DeckProgram.DeckScene.ContainsObject(objectId)) { if (IsSynchronizing) { CurrentObjectSynchronizationCount++; if (ExpectedObjectSynchronizationCount <= CurrentObjectSynchronizationCount) { CurrentObjectSynchronizationCount = 0; ExpectedObjectSynchronizationCount = 0; Thread.Sleep(200); } } DeckProgram.DeckScene.AddObject(new DeckObject(objectId, cloudObject.ObjectName, cloudObject.TypeName, modelPrimitiveExt.ModelUrl, modelPrimitiveExt.Scale, location, orientation, cloudObject.BoundingSphereRadius, scale)); } DeckObject deckObject = DeckProgram.DeckScene.GetObject(cloudObject.ObjectId); if (isNewAvatar) { Matrix orientationMatrix; Common.Rotate(out orientationMatrix, ref orientation); DeckProgram.DeckRudder.AvatarTargetLocation = location; DeckProgram.DeckRudder.AvatarCurrentLocation = location; DeckProgram.DeckRudder.AvatarTargetOrientationMatrix = orientationMatrix; DeckProgram.DeckRudder.AvatarCurrentOrientationMatrix = orientationMatrix; DeckProgram.DeckRudder.UpdateCameraTransformation(); DeckProgram.DeckRudder.SynchronizeCameraCurrentLocationWithTargetLocation(); } deckObject.ObjectName = cloudObject.ObjectName; deckObject.NetworkLocation = location; deckObject.NetworkOrientation = orientation; deckObject.Radius = cloudObject.BoundingSphereRadius; deckObject.ModelScale = modelPrimitiveExt.Scale; deckObject.NetworkScale = scale; DeckProgram.DeckScene.UpdateObject(deckObject); DeckProgram.DeckScene.ActivateObject(objectId); } m_objectUpdateQueue.Clear(); } if (DeckProgram.DeckRudder.IsSteered && DateTime.Now.Subtract(m_lastSteeringUpdate).TotalMilliseconds > 100) { m_lastSteeringUpdate = DateTime.Now; if (DeckProgram.CloudView.CloudCache.GetObject(AvatarId) != null) { ModifyRequestMessage modifyRequestMessage = new ModifyRequestMessage(); modifyRequestMessage.ObjectFragment.ObjectId = AvatarId; modifyRequestMessage.ObjectFragment.OwnerId = ParticipantId; modifyRequestMessage.ObjectFragment.TypeId = Guid.Empty; modifyRequestMessage.ObjectFragment.ObjectName = ParticipantNickName; modifyRequestMessage.ObjectFragment.TypeName = "Avatar"; modifyRequestMessage.ObjectFragment.BoundingSphereRadius = 2f; modifyRequestMessage.ObjectFragment.Mass = 2f; modifyRequestMessage.ObjectFragment.Location.X = (float)DeckProgram.DeckRudder.AvatarTargetLocation.X; modifyRequestMessage.ObjectFragment.Location.Y = (float)DeckProgram.DeckRudder.AvatarTargetLocation.Y; modifyRequestMessage.ObjectFragment.Location.Z = (float)DeckProgram.DeckRudder.AvatarTargetLocation.Z; Matrix rotationMatrix = DeckProgram.DeckRudder.AvatarTargetOrientationMatrix; Quaternion quaternion; Common.Rotate(out quaternion, ref rotationMatrix); modifyRequestMessage.ObjectFragment.Orientation.X = (float)quaternion.I; modifyRequestMessage.ObjectFragment.Orientation.Y = (float)quaternion.J; modifyRequestMessage.ObjectFragment.Orientation.Z = (float)quaternion.K; modifyRequestMessage.ObjectFragment.Orientation.W = (float)quaternion.W; OmModelPrimitiveExt modelPrimitiveExt = new OmModelPrimitiveExt(); modelPrimitiveExt.ModelUrl = "http://assets.bubblecloud.org/Collada/Seymour/Seymour_triangulate.dae"; modelPrimitiveExt.Scale = (float)0.1f; modifyRequestMessage.SetExtension(modelPrimitiveExt); DeckProgram.CloudView.ModifyObject(modifyRequestMessage); DeckProgram.DeckRudder.IsSteered = false; } } }
public void ObjectFocused(DeckObject deckObject) { deleteObjectButton.Enabled = true; this.Visible = true; }