MotionController constructor
MotionController([
- XRInputSource? xrInputSource,
- Map<
String, dynamic> ? profile, - String? assetUrl
@param {Object} xrInputSource - The XRInputSource to build the MotionController around @param {Object} profile - The best matched profile description for the supplied xrInputSource @param {string} assetUrl
Implementation
MotionController([this.xrInputSource, this.profile, this.assetUrl]) {
id = profile?['profileId'];
// Build child components as described in the profile description
layoutDescription = profile?['layouts'][xrInputSource?.handedness];
layoutDescription['components'].forEach((componentId,value){
final componentDescription = layoutDescription['components'][componentId];
components[componentId] = Component(componentId, componentDescription);
});
// Initialize components based on current gamepad state
updateFromGamepad();
}