public void Initialize(
     IVRMLoadable vrmLoadable,
     ExternalTrackerDataSource exTracker,
     FaceControlConfiguration config)
 {
     _config                   = config;
     _exTracker                = exTracker;
     vrmLoadable.VrmLoaded    += OnVrmLoaded;
     vrmLoadable.VrmDisposing += OnVrmDisposing;
 }
Example #2
0
        public void Initialize(IVRMLoadable vrmLoadable, ExternalTrackerDataSource externalTracker)
        {
            _tracker = externalTracker;

            vrmLoadable.VrmLoaded += info =>
            {
                _rightEye        = info.animator.GetBoneTransform(HumanBodyBones.RightEye);
                _leftEye         = info.animator.GetBoneTransform(HumanBodyBones.LeftEye);
                _hasValidEyeBone = (_rightEye != null && _leftEye != null);
            };

            vrmLoadable.VrmDisposing += () =>
            {
                _hasValidEyeBone = false;
                _rightEye        = null;
                _leftEye         = null;
            };
        }
Example #3
0
        public void Initialize(IVRMLoadable vrmLoadable, ExternalTrackerDataSource externalTracker)
        {
            _externalTracker = externalTracker;

            vrmLoadable.VrmLoaded += info =>
            {
                var animator = info.animator;
                _neck     = animator.GetBoneTransform(HumanBodyBones.Neck);
                _head     = animator.GetBoneTransform(HumanBodyBones.Head);
                _hasNeck  = _neck != null;
                _hasModel = true;
            };
            vrmLoadable.VrmDisposing += () =>
            {
                _hasModel = false;
                _hasNeck  = false;
                _neck     = null;
                _head     = null;
            };
        }
Example #4
0
        public void Initialize(
            IVRMLoadable vrmLoadable,
            FaceControlConfiguration config,
            ExternalTrackerDataSource externalTracker,
            EyeBonePostProcess eyeBoneResetter
            )
        {
            _config          = config;
            _externalTracker = externalTracker;
            _eyeBoneResetter = eyeBoneResetter;

            vrmLoadable.VrmLoaded += info =>
            {
                _hasModel = true;
            };

            vrmLoadable.VrmDisposing += () =>
            {
                _hasModel = false;
            };
        }
        public void Initialize(
            IVRMLoadable vrmLoadable,
            ExternalTrackerDataSource exTracker,
            BlendShapeInitializer initializer,
            WordToMotionBlendShape wtmBlendShape
            )
        {
            _exTracker     = exTracker;
            _initializer   = initializer;
            _wtmBlendShape = wtmBlendShape;

            vrmLoadable.VrmLoaded += info =>
            {
                _blendShape = info.blendShape;
                _hasModel   = true;
            };

            vrmLoadable.VrmDisposing += () =>
            {
                _hasModel   = false;
                _blendShape = null;
            };
        }
Example #6
0
 public ExternalTrackerSettingReceiver(IMessageReceiver receiver, ExternalTrackerDataSource dataSource)
 {
     receiver.AssignCommandHandler(
         VmmCommands.ExTrackerEnable,
         c => dataSource.EnableTracking(c.ToBoolean())
         );
     receiver.AssignCommandHandler(
         VmmCommands.ExTrackerCalibrate,
         _ => dataSource.Calibrate()
         );
     receiver.AssignCommandHandler(
         VmmCommands.ExTrackerSetCalibrateData,
         c => dataSource.SetCalibrationData(c.Content)
         );
     receiver.AssignCommandHandler(
         VmmCommands.ExTrackerSetSource,
         c => dataSource.SetSourceType(c.ToInt())
         );
     receiver.AssignCommandHandler(
         VmmCommands.ExTrackerSetFaceSwitchSetting,
         c => dataSource.SetFaceSwitchSetting(c.Content)
         );
 }
Example #7
0
 public void Initialize(FaceControlConfiguration config, ExternalTrackerDataSource externalTracker)
 {
     _config          = config;
     _externalTracker = externalTracker;
 }
Example #8
0
 public void Initialize(ExternalTrackerDataSource externalTracker)
 {
     _externalTracker = externalTracker;
 }