Created
June 21, 2021 08:20
-
-
Save noppefoxwolf/c9b5520bbdb7f4f24f0c2397927803df to your computer and use it in GitHub Desktop.
perfectsync.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (arFaceManager.subsystem is ARKitFaceSubsystem subsystem) { | |
using(var blendShapes = subsystem.GetBlendShapeCoefficients(face.trackableId, Allocator.Temp)) { | |
view.SetBlendShapes(blendShapes); | |
} | |
} | |
private void SetBlendShapes(NativeArray < ARKitBlendShapeCoefficient > blendShapes) { | |
foreach(var blendShape in blendShapes) { | |
float x = 0.0 f; | |
float fixedCoefficient = 0.0 f; | |
cubicBezier.Eval(blendShape.coefficient, ref x, ref fixedCoefficient); | |
var location = blendShape.blendShapeLocation.ToString(); | |
var key = BlendShapeKey.CreateUnknown(location); | |
blendShapeProxy.AccumulateValue(key, fixedCoefficient); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment