Defines an interface for bridging various input methods into a unified control scheme.

The PlayerControllerInput serves as an abstraction layer that enables an application to process input data from different sources such as keyboards, game controllers, and VR controllers in a consistent manner. Implementations of this interface should provide mechanisms to interpret and translate these diverse inputs into a set of standardized movement and rotation vectors that the application can easily use for navigation and interaction within a 3D environment.

Example

export class CustomInput extends Component implements PlayerControllerInput {
static TypeName = InputBridgeTypename;

/** @override */
getRotationAxis(out: vec3) {
// Always rotate by 10 degrees around the. You can input your own values here,
// coming from a keyboard, the network, etc...
out[1] = 10;
return out;
}

/** @override */
getMovementAxis(out: vec3) {
// Always move to the right. You can input your own values here,
// coming from a keyboard, the network, etc...
out[0] = 1;
return out;
}
}
interface PlayerControllerInput {
    getMovementAxis(out): vec3;
    getRotationAxis(out): vec3;
}

Hierarchy

  • Component
    • PlayerControllerInput

Implemented by

Methods