MotionController constructor

MotionController([
  1. XRInputSource? xrInputSource,
  2. Map<String, dynamic>? profile,
  3. 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();
}