コード例 #1
0
        public static BaseComponent LoadFromDefinition(ContentManager content, string definitionPath, BaseEntity parent)
        {
            ArcBallCameraInputComponentDefinition compDef = content.Load <ArcBallCameraInputComponentDefinition>(definitionPath);

            ArcBallCameraInputComponent newComponent = new ArcBallCameraInputComponent(parent, compDef);

            return(newComponent);
        }
コード例 #2
0
        /// <summary>
        /// Creates an input controller to handle a camera in such a way that is behaves as an
        /// Arc-Ball Camera.
        /// </summary>
        /// <param name="parent">Entity this component is attached to</param>
        public ArcBallCameraInputComponent(BaseEntity parent, ArcBallCameraInputComponentDefinition compDef)
            : base(parent)
        {
            ActivateComponent();

            // Setting these through their accessors will update 'zoomRange'.
            this.ZoomMax = compDef.ZoomMax;
            this.ZoomMin = compDef.ZoomMin;

            this.RightThumbStickModifier = compDef.RightThumbStickModifier;

            this.HorizontalAngle   = compDef.HorizontalAngle;
            this.VerticalAngle     = compDef.VerticalAngle;
            this.verticalAngleMin  = compDef.VerticalAngleMin;
            this.verticalAngleMax  = compDef.VerticalAngleMax;
            this.Zoom              = compDef.StartingZoom;
            this.triggerModifier   = compDef.TriggerModifier;
            this.LookAheadDistance = compDef.LookAheadDistance;
            this.LookAboveDistance = compDef.LookAboveDistance;

            this.LeftThumbStickModifier  = compDef.LeftThumbStickModifier;
            this.RightThumbStickModifier = compDef.RightThumbStickModifier;
        }