Exemple #1
0
        public FaceControlConfigurationReceiver(IMessageReceiver receiver, FaceControlConfiguration config)
        {
            receiver.AssignCommandHandler(
                VmmCommands.EnableFaceTracking,
                message =>
            {
                _enableWebCamTracking = message.ToBoolean();
                SetFaceControlMode();
            });
            receiver.AssignCommandHandler(
                VmmCommands.ExTrackerEnable,
                message =>
            {
                _enableExTracker = message.ToBoolean();
                SetFaceControlMode();
            });

            void SetFaceControlMode()
            {
                config.ControlMode =
                    _enableExTracker ? FaceControlModes.ExternalTracker :
                    _enableWebCamTracking ? FaceControlModes.WebCam :
                    FaceControlModes.None;
            }
        }
        public void Initialize(
            IVRMLoadable vrmLoadable,
            Camera mainCam,
            IKTargetTransforms ikTargets,
            FaceControlConfiguration faceControlConfig)
        {
            _camera            = mainCam.transform;
            _lookAtTarget      = ikTargets.LookAt;
            _faceControlConfig = faceControlConfig;

            vrmLoadable.VrmLoaded += info =>
            {
                _head          = info.animator.GetBoneTransform(HumanBodyBones.Head);
                _lookAtIk      = info.vrmRoot.GetComponent <LookAtIK>();
                _vrmLookAtHead = info.vrmRoot.GetComponent <VRMLookAtHead>();
                _hasModel      = true;
            };
            vrmLoadable.VrmDisposing += () =>
            {
                _hasModel      = false;
                _lookAtIk      = null;
                _vrmLookAtHead = null;
                _head          = null;
            };
        }
Exemple #3
0
 public void Initialize(IVRMLoadable vrmLoadable, FaceTracker faceTracker, FaceControlConfiguration config)
 {
     _config                   = config;
     _faceTracker              = faceTracker;
     vrmLoadable.VrmLoaded    += OnVrmLoaded;
     vrmLoadable.VrmDisposing += OnVrmDisposing;
 }
 public void Initialize(IVRMLoadable vrmLoadable, IMessageReceiver receiver,
                        IKTargetTransforms ikTargets, FaceControlConfiguration faceControlConfig)
 {
     _bodyIk                   = ikTargets.Body;
     _faceControlConfig        = faceControlConfig;
     vrmLoadable.VrmLoaded    += OnVrmLoaded;
     vrmLoadable.VrmDisposing += OnVrmDisposing;
     var _ = new BodyMotionManagerReceiver(receiver, this);
 }
 public void Initialize(FaceTracker faceTracker, FaceControlConfiguration config)
 {
     _faceTracker = faceTracker;
     _config      = config;
     faceTracker.FaceDetectionUpdated    += OnFaceDetectionUpdated;
     faceTracker.FaceLandmarksUpdated    += OnFaceLandmarksUpdated;
     faceTracker.CalibrationRequired     += OnCalibrationRequired;
     faceTracker.CalibrationDataReceived += OnCalibrationDataReceived;
 }
 public void Initialize(
     IVRMLoadable vrmLoadable,
     ExternalTrackerDataSource exTracker,
     FaceControlConfiguration config)
 {
     _config                   = config;
     _exTracker                = exTracker;
     vrmLoadable.VrmLoaded    += OnVrmLoaded;
     vrmLoadable.VrmDisposing += OnVrmDisposing;
 }
Exemple #7
0
        public void Initialize(IVRMLoadable vrmLoadable, IMessageReceiver receiver, IMessageSender sender, FaceControlConfiguration config)
        {
            _config = config;
            vrmLoadable.VrmLoaded    += OnVrmLoaded;
            vrmLoadable.VrmDisposing += OnVrmDisposing;

            var _ = new FaceControlConfigurationReceiver(receiver, config);

            _messageIo = new FaceControlManagerMessageIo(receiver, sender, this);
        }
        public void Initialize(IVRMLoadable vrmLoadable, FaceControlConfiguration config)
        {
            _config = config;

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

            vrmLoadable.VrmDisposing += () =>
            {
                _hasModel   = false;
                _blendShape = null;
            };
        }
Exemple #9
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;
            };
        }
Exemple #10
0
 public void Initialize(FaceControlConfiguration config)
 {
     _config = config;
 }
Exemple #11
0
 public void Initialize(FaceControlConfiguration config, ExternalTrackerDataSource externalTracker)
 {
     _config          = config;
     _externalTracker = externalTracker;
 }