private void OnSelectedObjectChanged(object seneder, SelectEventArgs e) { if (e.SelectedObject == null) { MousePole.DropHandlers(); MousePole.Show(false); return; } var item = e.SelectedObject as CollisionObject; if (item != null) { var objectBlock = item.UserObject as ObjectBlock; if (objectBlock == null) { return; } MousePole.Show(true); MousePole.DropHandlers(); MousePole.WorldMatrix = item.WorldTransform; MousePole.WorldMatrixChanged += delegate(object sender, MatrixChangedEventArgs args) { CollisionManager.Move(item, args.Matrix.ClearScale( )); //Manager.UpdateInstance( objectBlock, item.UserIndex, item.WorldTransform ); }; } }
private void GetSelectedInstance(SelectEventArgs e) { var item = e.SelectedObject as CollisionObject; if (item == null || item == selectedCollisionObject) { selectedCollisionObject = null; selectedScenarioObject = null; return; } var scenarioObject = item.UserObject as ObjectBlock; if (scenarioObject == null) { selectedCollisionObject = null; selectedScenarioObject = null; return; } selectedScenarioObject = new ScenarioObjectAxisAlignedWrapper(scenarioObject); selectedCollisionObject = item; }
public void OnSelectedObjectChanged(object sender, SelectEventArgs e) { GetSelectedInstance(e); }