示例#1
0
 private static void GetCameraProps(IScene editingScene,
                                    out PlaneOrthoBoundControlledCamera.Props props,
                                    out PlaneOrthoBoundControlledCamera.CameraBounds bounds)
 {
     // todo: use StoryFlowchartEditSceneComponent.DefaultViewpointMechanism
     props = PlaneOrthoBoundControlledCamera.Props.Default;
     bounds.PlaneBounds = editingScene.Root.ChildNodes.First().GetComponent <StoryFlowchartNodeGizmoComponent>().GlobalRectangle;
     bounds.MaxDistance = Math.Max(bounds.PlaneBounds.Width, bounds.PlaneBounds.Height) / 2 / MathHelper.Tan(MathHelper.Pi / 8);
     bounds.MinDistance = 2;
     props.Distance     = bounds.MaxDistance;
 }
 public OrthoDefaultViewpointMechanism(ISceneNode node, PlaneOrthoBoundControlledCamera.Props props)
 {
     this.node   = node;
     this.props  = props;
     FixedCamera = CreateControlledViewpoint();
 }