SRanipal Unreal SDK  1.3.2.0
SRanipal Unreal SDK document
SRanipal_AvatarLipSample_v2.h
1 // ========= Copyright 2018, HTC Corporation. All rights reserved. ===========
2 
3 #pragma once
4 
5 #include "SRanipal_Lip_v2.h"
6 
7 #include "CoreMinimal.h"
8 #include "GameFramework/Actor.h"
9 #include "SRanipal_AvatarLipSample_v2.generated.h"
10 
11 
16 UCLASS()
17 class SRANIPAL_API ASRanipal_AvatarLipSample_v2 : public AActor
18 {
19  GENERATED_BODY()
20 
21 public:
22  // Sets default values for this actor's properties
24 
25  // Declare your avatar component here.
26  UPROPERTY(EditAnywhere)
27  USceneComponent *Root;
28  // The mesh components.
29  UPROPERTY(EditAnywhere)
30  USkeletalMeshComponent *HeadModel;
31  UPROPERTY(EditAnywhere)
32  USkeletalMeshComponent *EyeLeft;
33  UPROPERTY(EditAnywhere)
34  USkeletalMeshComponent *EyeRight;
35 
36  // Set your model's morph target and choose relative prediction weighting with it.
37  UPROPERTY(EditAnywhere)
38  TMap<FName, LipShape_v2> LipShapeTable;
39 
40 protected:
41  // Called when the game starts or when spawned
42  virtual void BeginPlay() override;
43 
44 public:
45  // Called every frame
46  virtual void Tick(float DeltaTime) override;
47 #if WITH_EDITOR
48  virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
49 #endif WITH_EDITOR
50 
51 private:
52  // Used TMap to save return weightings.
53  TMap<LipShape_v2, float> LipWeighting;
54 
55  void UpdateLipShapes();
56  void RenderModelLipShape(USkeletalMeshComponent* Model, TMap<FName, LipShape_v2> LipShapeTable, TMap<LipShape_v2, float> Weighting);
57 };
Definition: SRanipal_AvatarLipSample_v2.h:17