언리얼에서 블라즈핸드 돌렸고

이제 블라즈 핸드로 손제어하는걸 만들려고 한다.

 

손 모델을 오큘러스에 있는 손을 구하려고 찾아보다가 본 영상

oculus vr 깃헙에서 손을 받을수 있어보였다.

 

https://www.youtube.com/watch?v=CKIdogPFZg8

 

 

 

위 영상에 나온데로 깃헙에 들어가려고하면 404가 나오는데

에픽 게임즈에 깃헙 계정을 등록안했기 때문

 

 

https://developer.oculus.com/documentation/unreal/unreal-compatibility-matrix/

 

Oculus Source Distribution for Unreal Engine | Oculus Developers

 

developer.oculus.com

 

여기서 시키는대로 에픽게임즈에 깃헙아이디 등록하고

깃헙 주소로 바로들어가려고해도 안될텐데

깃헙 이메일 주소로 에픽게임즈 연결 메일을 확인까지 해줘야 들어가진다.

 

 

 

 

들어와진건 좋은데

아직 VR을 다룰 능력은 안되고

손모델만 찾으러 왔는데

 

 

 

 

 

여기로 들어오면 언리얼 핸드샘플들을 구할수 있음

 

https://github.com/oculus-samples/Unreal-HandSample

 

 

 

BP대신 여기있는 모델들을 가져와서 사용

https://github.com/oculus-samples/Unreal-HandSample/tree/main/Content/Hands/Models

 

 

 

OculusHand_L.uasset

를 열면 이런식으로 나오는데

어두운 뼈들은 왜 있는질 잘 모르겠음.

보기 지저분하니 

 

 

 

 

 

Hand_L 스켈레탈 메시 복사로 따로빼서

회색 본들을 지우면 그래도 알아볼만큼 된다.

 

 

 

 

대충 보면 블라즈 핸드의 스캘래톤 형태와 비슷한것 같지만

관절수가 조금 맞진 않는다.

 

 

 

그럼 이 손 스켈레탈 메시를 게임에 어떻게 가져와서 쓰나 싶었는데

 

스켈레탈 메시 컴포넌트로  위 메시를 가져와도

애니메이션을 스켈레탈메시로 동작시킨것 처럼

게임에서는 원하는데로 회전시킬수 없었다.

 

대신 포저블 매시 컴포넌트로 쓰면 된다고 하는데

 

 

 

일단 

HandLeft 액터 c++ 생성하고

 

Hand_L 스켈레탈 메시를 컨스트럭터 헬퍼로 로드하고

 

포저블매시컴포넌트 HandLeft에 SetSkeletalMesh를 해주면

스켈레탈 매시를 포저블 매시 컴포넌트로 사용가능하다.

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "Components/PoseableMeshComponent.h"
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "HandLeft.generated.h"

UCLASS()
class HANDDESKTOP_API AHandLeft : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AHandLeft();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;


	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=PoseableMesh)
	UPoseableMeshComponent* HandLeft;

};

 

// Fill out your copyright notice in the Description page of Project Settings.


#include "HandLeft.h"

// Sets default values
AHandLeft::AHandLeft()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;



	// 스켈레탈 메시 컴포넌트 생성 및 부착
	ConstructorHelpers::FObjectFinder<USkeletalMesh> TempHandMesh(
		TEXT("SkeletalMesh'/Game/MyContent/Hand_L.Hand_L'")
	);
	HandLeft = CreateDefaultSubobject<UPoseableMeshComponent>(TEXT("HandLeft"));

	HandLeft->SetSkeletalMesh(TempHandMesh.Object);
	HandLeft->SetRelativeLocation(FVector(0, 0, 0));
	//HandLeft->SetupAttachment(RootComponent);




}

// Called when the game starts or when spawned
void AHandLeft::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AHandLeft::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

 

 

 

이렇게 작성한

HandLeft.cpp로 블루프린트 생성,

뷰포트에 추가해서 회전이랑 스케일링해주면 이런식으로 오큘러스 손이 나온다.

 

 

 

 

 

 

 

 

 

포저블 매시 본을 어떻게 회전시키나 찾아보면

이런식으로 제공되는 함수들이 보임

 

 

https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Components/PoseableMesh/

 

Poseable Mesh

Poseable Mesh

docs.unrealengine.com

 

 

 

 

 

매 틱마다 y축으로 +1도씩 

새끼 손가락 1번관절을 회전시켜주는 블루프린트 작성

 

 

 

 

 

 

 

 

 

 

 

+ Recent posts