new AxFlightInputModel(context, transform, moveSpeed, moveResponsiveness, turnSpeed, turnResponsiveness, forwardInput, backwardInput, leftInput, rightInput, upInput, downInput, moveConditionInput, pitchUpInput, pitchDownInput, yawLeftInput, yawRightInput, rollLeftInput, rollRightInput, turnConditionInput)
Creates an input model, providing a free flight-like manipulation on a given transform
The flight model assumes no defined orientations and in contrast to the walk model, it turns around its local axes.
For example, an object in a free flight, who is turning left and right does so around its own local vertical axis, which changes its orientation with the viewier's rotation in space and would be oriented differently if the viewer is facing the horizon, the sky or the ground.
In contrast, a person walking on the ground would always turn around the orientation of the gravity vector (which is generally perpendicular to the ground) no matter whether that person is facing the horizon or the sky or the ground.
For multiple alternative inputs on the same control, enumerate all the input names, separated by comma.
Both digital and analog inputs are acceptable, such as keyboard, mouse, gamepad buttons as well as mouse coordinates and gamepad thumbsticks and triggers
For analog inputs, which provide positive and negative values, only one of two opposing controls is required. For example, when using the mouse to turn left and right, only the left or only the right control is sufficient in this case, because a negative value from the input would reverse the turning direction.
The model provides inputs to serve as conditions for moving and turning. If these inputs are provided, moving and turning respectively will only occur if the given conditional input is active. For example, to turn by moving the mouse, but only while mouse button is pressed, the mouse button must be provided as conditional input.
Parameters:
Name | Type | Description |
---|---|---|
context |
Axis | The instance of Axis, to which the model will be applied |
transform |
AxTransform | The transform for which to perform the manipulation of the input model |
moveSpeed |
Number | The transform for which to perform the manipulation of the input model |
moveResponsiveness |
Number | The transform for which to perform the manipulation of the input model |
turnSpeed |
Number | The transform for which to perform the manipulation of the input model |
turnResponsiveness |
Number | The transform for which to perform the manipulation of the input model |
forwardInput |
String | AxString | Names of the inputs to control the forward movement. Passing a null or empty string value would discard the control. |
backwardInput |
String | AxString | Names of the inputs to control the backward movement. Passing a null or empty string value would discard the control. |
leftInput |
String | AxString | Names of the inputs to control the left movement. Passing a null or empty string value would discard the control. |
rightInput |
String | AxString | Names of the inputs to control the right movement. Passing a null or empty string value would discard the control. |
upInput |
String | AxString | Names of the inputs to control the up movement. Passing a null or empty string value would discard the control. |
downInput |
String | AxString | Names of the inputs to control the down movement. Passing a null or empty string value would discard the control. |
moveConditionInput |
String | AxString | Names of the inputs to serve as a condition for allowing movement. Passing a null or empty string value would discard the condition. |
pitchUpInput |
String | AxString | Names of the inputs to control pitch up. Passing a null or empty string value would discard the control. |
pitchDownInput |
String | AxString | Names of the inputs to control pitch down. Passing a null or empty string value would discard the control. |
yawLeftInput |
String | AxString | Names of the inputs to control yaw to the left. Passing a null or empty string value would discard the control. |
yawRightInput |
String | AxString | Names of the inputs to control yaw to the right. Passing a null or empty string value would discard the control. |
rollLeftInput |
String | AxString | Names of the inputs to control roll to the left. Passing a null or empty string value would discard the control. |
rollRightInput |
String | AxString | Names of the inputs to control roll to the right. Passing a null or empty string value would discard the control. |
turnConditionInput |
String | AxString | Names of the inputs to serve as a condition for allowing turning. Passing a null or empty string value would discard the condition. |
Methods
Process()
Performs the input model routines