Example #1
0
        public static BaseComponent LoadFromDefinition(ContentManager content, string definitionPath, BaseEntity parent)
        {
            FreeCameraInputComponentDefinition compDef = content.Load <FreeCameraInputComponentDefinition>(definitionPath);

            FreeCameraInputComponent newComponent = new FreeCameraInputComponent(parent, compDef);

            return(newComponent);
        }
Example #2
0
        /// <summary>
        /// Creates an input controller to handle a camera in such a way that is behaves as an
        /// Free-moving Camera.
        /// </summary>
        /// <param name="parent">Entity this component is attached to</param>
        public FreeCameraInputComponent(BaseEntity parent, FreeCameraInputComponentDefinition compDef)
            : base(parent)
        {
            ActivateComponent();

            this.inverted                = compDef.Inverted;
            this.speed                   = compDef.Speed;
            this.turboSpeedModifier      = compDef.TurboSpeedModifier;
            this.leftThumbStickModifier  = compDef.LeftThumbStickModifier;
            this.rightThumbStickModifier = compDef.RightThumbStickModifier;
        }