当前位置: 首页>>代码示例>>C++>>正文


C++ FQuat::Rotator方法代码示例

本文整理汇总了C++中FQuat::Rotator方法的典型用法代码示例。如果您正苦于以下问题:C++ FQuat::Rotator方法的具体用法?C++ FQuat::Rotator怎么用?C++ FQuat::Rotator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FQuat的用法示例。


在下文中一共展示了FQuat::Rotator方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NeuronGetReferencePoseLocalBoneRotation

bool UPerceptionNeuronBPLibrary::NeuronGetReferencePoseLocalBoneRotation(USkeletalMeshComponent *Mesh, FRotator& Rotation, int32 BoneIndex)
{
	if (Mesh == nullptr && Mesh->SkeletalMesh == nullptr)
	{
		if (GEngine)
		{
			GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Mesh is invalid.")));
		}
		Rotation.Yaw = Rotation.Pitch = Rotation.Roll = 0;
		return false;
	}

	if (BoneIndex > Mesh->LocalAtoms.Num())
	{
		if (GEngine)
		{
			GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("BoneIndex %d exceeds maximum available bones %d."), BoneIndex, Mesh->LocalAtoms.Num()));
		}
		Rotation.Yaw = Rotation.Pitch = Rotation.Roll = 0;
		return false;
	}

	const FReferenceSkeleton& refskel(Mesh->SkeletalMesh->RefSkeleton);
	FQuat Quat = refskel.GetRefBonePose()[BoneIndex].GetRotation();
	Rotation = Quat.Rotator();

	return true;
}
开发者ID:DarkEric,项目名称:TP_ThirdPersonNeuron,代码行数:28,代码来源:PerceptionNeuronBPLibrary.cpp

示例2: TickComponent

void URotatingMovementComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
	// skip if we don't want component updated when not rendered or if updated component can't move
	if ( ShouldSkipUpdate(DeltaTime) )
	{
		return;
	}

	// Compute new rotation
	const FQuat OldRotation = UpdatedComponent->GetComponentQuat();
	const FQuat DeltaRotation = (RotationRate * DeltaTime).Quaternion();
	const FQuat NewRotation = bRotationInLocalSpace ? (OldRotation * DeltaRotation) : (DeltaRotation * OldRotation);

	// Compute new location
	FVector DeltaLocation = FVector::ZeroVector;
	if (!PivotTranslation.IsZero())
	{
		const FVector OldPivot = OldRotation.RotateVector(PivotTranslation);
		const FVector NewPivot = NewRotation.RotateVector(PivotTranslation);
		DeltaLocation = (OldPivot - NewPivot); // ConstrainDirectionToPlane() not necessary because it's done by MoveUpdatedComponent() below.
	}

	const bool bEnableCollision = false;
	MoveUpdatedComponent(DeltaLocation, NewRotation.Rotator(), bEnableCollision);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:25,代码来源:RotatingMovementComponent.cpp

示例3: AbsoluteTick

void ACinemotusPlayerController::AbsoluteTick(float DeltaTime)
{

	
	TotalYawAbs += addYaw;
	UPrimitiveComponent* prim = GetPawn()->GetMovementComponent()->UpdatedComponent;
	//USceneComponent* sComponent = GetPawn()->GetRootComponent();
	//sComponent->SetRelativeLocation;

	bool SetPrimDirectly = true;
	FQuat finalQuat;

	if (((currentCaptureState&ECinemotusCaptureState::EAbsolute) == ECinemotusCaptureState::EAbsolute) && 
		((currentCaptureState&ECinemotusCaptureState::EAbsoluteOff) == 0))
	{
		finalQuat = FRotator(0, TotalYawAbs, 0).Quaternion()*(HydraLatestData->controllers[CAM_HAND].quat);
	}
	else
	{
		finalQuat =  FRotator(0, addYaw, 0).Quaternion()*prim->GetComponentQuat();
	}
	SetControlRotation(finalQuat.Rotator());
	if (SetPrimDirectly && prim)
	{
		prim->SetWorldLocationAndRotation(prim->GetComponentLocation(), finalQuat);// not sure need
	}


	HandleMovementAbs(DeltaTime, ((currentCaptureState&ECinemotusCaptureState::EAbsolute) == ECinemotusCaptureState::EAbsolute));
}
开发者ID:erinmichno,项目名称:CinemotusUE4,代码行数:30,代码来源:CinemotusPlayerController.cpp

示例4: GetPose

void UOculusFunctionLibrary::GetPose(FRotator& DeviceRotation, FVector& DevicePosition, FVector& NeckPosition, bool bUseOrienationForPlayerCamera, bool bUsePositionForPlayerCamera, const FVector PositionScale)
{
#if OCULUS_SUPPORTED_PLATFORMS
	FHeadMountedDisplay* OculusHMD = GetOculusHMD();
	if (OculusHMD && OculusHMD->IsHeadTrackingAllowed())
	{
		FQuat OrientationAsQuat;

		OculusHMD->GetCurrentHMDPose(OrientationAsQuat, DevicePosition, bUseOrienationForPlayerCamera, bUsePositionForPlayerCamera, PositionScale);

		DeviceRotation = OrientationAsQuat.Rotator();

		NeckPosition = OculusHMD->GetNeckPosition(OrientationAsQuat, DevicePosition, PositionScale);

		//UE_LOG(LogUHeadMountedDisplay, Log, TEXT("POS: %.3f %.3f %.3f"), DevicePosition.X, DevicePosition.Y, DevicePosition.Z);
		//UE_LOG(LogUHeadMountedDisplay, Log, TEXT("NECK: %.3f %.3f %.3f"), NeckPosition.X, NeckPosition.Y, NeckPosition.Z);
		//UE_LOG(LogUHeadMountedDisplay, Log, TEXT("ROT: sYaw %.3f Pitch %.3f Roll %.3f"), DeviceRotation.Yaw, DeviceRotation.Pitch, DeviceRotation.Roll);
	}
	else
#endif // #if OCULUS_SUPPORTED_PLATFORMS
	{
		DeviceRotation = FRotator::ZeroRotator;
		DevicePosition = FVector::ZeroVector;
	}
}
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:25,代码来源:OculusFunctionLibrary.cpp

示例5: GetControllerOrientationAndPosition

bool VRPNTrackerInputDevice::GetControllerOrientationAndPosition(const int32 ControllerIndex, const EControllerHand DeviceHand, FRotator& OutOrientation, FVector& OutPosition) const
{
	for(auto &InputPair : TrackerMap)
	{
		const TrackerInput &Tracker = InputPair.Value;
		if(Tracker.PlayerIndex == ControllerIndex && Tracker.Hand == DeviceHand)
		{
			if(InputDevice)
			{
				FScopeLock ScopeLock(&CritSect);
				InputDevice->mainloop();
			}

			FVector NewPosition;
			FQuat NewRotation;
			TransformCoordinates(Tracker, NewPosition, NewRotation);

			OutOrientation = NewRotation.Rotator();
			OutPosition = NewPosition;
			return true;
		}
	}

	return false;
}
开发者ID:flair2005,项目名称:VRPNInput,代码行数:25,代码来源:VRPNInputDevice.cpp

示例6: AttackTrace

/*
* Spawns the hitbox and processes the actors within it
*/
void AHero::AttackTrace()
{
	//Actors that overlap the box stored in this array
	TArray<struct FOverlapResult> OutOverlaps;
	//Orient the box in the direction of the character
	FQuat Rotation = Instigator->GetTransform().GetRotation();
	FVector Start = Instigator->GetTransform().GetLocation() + Rotation.Rotator().Vector() * 100.0f;

	FCollisionShape CollisionHitShape;
	FCollisionQueryParams CollisionParams;
	//Have the hitbox ignore the player
	CollisionParams.AddIgnoredActor(Instigator);

	//Set what will respond to the collision
	FCollisionObjectQueryParams CollisionObjectTypes;
	CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_PhysicsBody);
	CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_Pawn);
	CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_WorldStatic);

	//Create the hitbox and get the actors within
	CollisionHitShape = FCollisionShape::MakeBox(FVector(100.0f, 60.0f, 0.5f));
	GetWorld()->OverlapMulti(OutOverlaps, Start, Rotation, CollisionHitShape, CollisionParams, CollisionObjectTypes);

	//Process all hit actors
	for (int i = 0; i < OutOverlaps.Num(); i++)
	{
		if (OutOverlaps[i].GetActor() && !HitActors.Contains(OutOverlaps[i].GetActor()))
		{
			//Check if hit registered
			GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, TEXT("hit"));
			//Now call the function that does something to our unfortunate actor...
			ProcessHitActor(OutOverlaps[i].GetActor());
		}
	}
}
开发者ID:JakeGurle,项目名称:DyingGods,代码行数:38,代码来源:Hero.cpp

示例7: UpdateCapsuleRotation

void UCustomMovementComponent::UpdateCapsuleRotation(float DeltaTime, const FVector& TargetUpVector, bool bInstantRot, float RotationSpeed)
{
	const FVector CapsuleUp = CapsuleComponent->GetUpVector();
	const FQuat DeltaQuat = FQuat::FindBetween(CapsuleUp, TargetUpVector);
	const FQuat TargetQuat = DeltaQuat * CapsuleComponent->GetComponentRotation().Quaternion();

	CurrentCapsuleRotation = bInstantRot ? TargetQuat.Rotator() : FMath::RInterpTo(CurrentCapsuleRotation, TargetQuat.Rotator(), DeltaTime, RotationSpeed);

	CapsuleComponent->SetWorldRotation(CurrentCapsuleRotation);
}
开发者ID:rotoslinger,项目名称:UE4-CustomGravityPlugin,代码行数:10,代码来源:CustomMovementComponent.cpp

示例8: RelativeTick

void ACinemotusPlayerController::RelativeTick(float DeltaTime)
{

	UPrimitiveComponent* prim = GetPawn()->GetMovementComponent()->UpdatedComponent;
	bool SetPrimDirectly = true;
	FQuat finalQuat;
	if ((currentCaptureState & ECinemotusCaptureState::ERelativeRotation) == ECinemotusCaptureState::ERelativeRotation)
	{
		FRotator rot = HydraLatestData->controllers[CAM_HAND].angular_velocity;
		const FQuat OldRotation = prim->GetComponentQuat();//GetControlRotation().Quaternion(); //TODO: hold onto a quaternion potentially
		const FRotator OldRotationRotator = OldRotation.Rotator();
		FRotator worldRotator = FRotator(0, DeadZone(rot.Yaw*DeltaTime, 0.0) + addYaw, 0);
		FRotator worldRotator1 = FRotator(DeadZone(rot.Pitch*DeltaTime, 0.0), 0, 0);
		FRotator localRotator = FRotator(0, 0, DeadZone(rot.Roll*DeltaTime, 0.0));
		const FQuat WorldRot = worldRotator.Quaternion();
		const FQuat pitchRot = worldRotator1.Quaternion();
		const FQuat LocalRot = localRotator.Quaternion();

		////This one does roll around local forward, pitch around world right flattened and yaw around world up
		////			FQuat finalQuat = pitchRot*WorldRot*((OldRotation*LocalRot));

		finalQuat = WorldRot*((OldRotation*LocalRot)*pitchRot);
	}
	else
	{
		finalQuat = FRotator(0, addYaw, 0).Quaternion()*prim->GetComponentQuat();
	}

	SetControlRotation(finalQuat.Rotator());
	if (SetPrimDirectly && prim)
	{
		prim->SetWorldLocationAndRotation(prim->GetComponentLocation(), finalQuat);// not sure need
	}



	HandleMovementAbs(DeltaTime, (currentCaptureState & ECinemotusCaptureState::ERelativeTranslation) == ECinemotusCaptureState::ERelativeTranslation);

}
开发者ID:erinmichno,项目名称:CinemotusUE4,代码行数:39,代码来源:CinemotusPlayerController.cpp

示例9: DoRotation

void UAnimGraphNode_ModifyBone::DoRotation(const USkeletalMeshComponent* SkelComp, FRotator& Rotation, FAnimNode_Base* InOutAnimNode)
{
	FAnimNode_ModifyBone* ModifyBone = static_cast<FAnimNode_ModifyBone*>(InOutAnimNode);

	if (Node.RotationMode != EBoneModificationMode::BMM_Ignore)
	{
		FQuat DeltaQuat = ConvertCSRotationToBoneSpace(SkelComp, Rotation, ModifyBone->ForwardedPose, Node.BoneToModify.BoneName, Node.RotationSpace);

		FQuat PrevQuat(ModifyBone->Rotation);
		FQuat NewQuat = DeltaQuat * PrevQuat;
		ModifyBone->Rotation = NewQuat.Rotator();
		Node.Rotation = ModifyBone->Rotation;
	}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:14,代码来源:AnimGraphNode_ModifyBone.cpp

示例10: InitializeComponent

void UOSVRInputComponent::InitializeComponent()
{
	Super::InitializeComponent();

	WorldToMetersScale = 100.f;
	UWorld* w = GetWorld();
	if (w != nullptr)
	{
		AWorldSettings* ws = w->GetWorldSettings();
		if (ws != nullptr)
		{
			WorldToMetersScale = ws->WorldToMeters;
		}
	}

	auto InterfaceCollection = IOSVR::Get().GetEntryPoint()->GetInterfaceCollection();

	OSVRInterfaceCollection::RegistrationToken RegToken =
		InterfaceCollection->RegisterOnStateChangedCallback(
			[=](OSVRInterface* Interface, uint32 State)
			{
		/*
		FTransform Pose;
		if (((State & OSVRInterface::POSE_STATE_AVAILABLE) > 0) && Interface->GetPose(Pose, false))
		{
			Pose.ScaleTranslation(WorldToMetersScale);
			OnPoseChanged.Broadcast(Interface->GetName(), Pose);
		}
		*/

		FVector Position;
		if (((State & OSVRInterface::POSITION_STATE_AVAILABLE) > 0) && Interface->GetPosition(Position, false))
			OnPositionChanged.Broadcast(Interface->GetName(), Position * WorldToMetersScale);

		FQuat Orientation;
		if (((State & OSVRInterface::ORIENTATION_STATE_AVAILABLE) > 0) && Interface->GetOrientation(Orientation, false))
			OnOrientationChanged.Broadcast(Interface->GetName(), Orientation.Rotator());

		float Analog;
		if (((State & OSVRInterface::ANALOG_STATE_AVAILABLE) > 0) && Interface->GetAnalogState(Analog, false))
			OnAnalogValueChanged.Broadcast(Interface->GetName(), Analog);

		uint8 Button;
		if (((State & OSVRInterface::BUTTON_STATE_AVAILABLE) > 0) && Interface->GetButtonState(Button, false))
			OnButtonStateChanged.Broadcast(Interface->GetName(), EButtonState::Type(Button));
			});

	RegistrationToken = RegToken.Token;
}
开发者ID:CryptArc,项目名称:OSVR-Unreal,代码行数:49,代码来源:OSVRInputComponent.cpp

示例11: CheckAttackOverlap

void ABaseCharacter::CheckAttackOverlap(){

	//Overlapping actors for each box spawned will be stored here
	TArray<struct FOverlapResult> OutActorOverlaps;

	//Hit other actors only once
	TArray<AActor*> ProcessedActors;


	//The initial rotation of our box is the same as our character rotation
	FQuat Rotation = GetTransform().GetRotation();
	FVector Start = GetTransform().GetLocation() + Rotation.Rotator().Vector() * 100.0f;

	FCollisionShape CollisionHitShape;
	FCollisionQueryParams CollisionParams;

	//We do not want the character to hit itself, don't store this character in the array, to ignore it's collision
	CollisionParams.AddIgnoredActor(this);

	//Set the channels that will respond to the collision
	FCollisionObjectQueryParams CollisionObjectTypes;
	CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_PhysicsBody);
	CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_Pawn);
	//CollisionObjectTypes.AddObjectTypesToQuery(ECollisionChannel::ECC_WorldStatic); // uncomment to enable bashing objects

	//Create the box and get the overlapping actors
	CollisionHitShape = FCollisionShape::MakeBox(AttackBox);
	GetWorld()->OverlapMulti(OutActorOverlaps, Start, Rotation, CollisionHitShape, CollisionParams, CollisionObjectTypes);


	AActor* ActorToProcess;
	//Process all hit actors
	for (int i = 0; i < OutActorOverlaps.Num(); ++i)
	{
		ActorToProcess = OutActorOverlaps[i].GetActor();
		//We process each actor only once per Attack execution
		if (ActorToProcess && !ProcessedActors.Contains(ActorToProcess))
		{

			//Add this actor to the array because we are spawning one box per tick and we don't want to hit the same actor twice during the same attack animation
			ProcessedActors.AddUnique(ActorToProcess);

			if ( dynamic_cast<APatrollingEnemyCharacter*>(ActorToProcess) ){
				APatrollingEnemyCharacter* ennemy = (APatrollingEnemyCharacter*)ActorToProcess;
				ennemy->OnHit(this);
			}
		}
	}
}
开发者ID:trinitea,项目名称:NightmareNeverEnds,代码行数:49,代码来源:BaseCharacter.cpp

示例12: RLerp

FRotator UKismetMathLibrary::RLerp(FRotator A, FRotator B, float Alpha, bool bShortestPath)
{
	FRotator DeltaAngle = B - A;

	// if shortest path, we use Quaternion to interpolate instead of using FRotator
	if( bShortestPath )
	{
		FQuat AQuat(A);
		FQuat BQuat(B);

		FQuat Result = FQuat::Slerp(AQuat, BQuat, Alpha);
		Result.Normalize();

		return Result.Rotator();
	}

	return A + Alpha*DeltaAngle;
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:18,代码来源:KismetMathLibrary.cpp

示例13: GetQRotation

FRotator ULibraries::GetQRotation()
{
	
	float q1, q2, q3, q4;
	bool sent = FemtoduinoPointer->WriteData("w\n", 32);
	char parse1[10], parse2[10], parse3[10], parse4[10];
	char incomingData[250];
	int dataLength = 250;
	//Sleep(50);
	FemtoduinoPointer->ReadData(incomingData, dataLength);

	_memccpy(&parse1, incomingData,',' ,8);
	_memccpy(&parse2, &incomingData[9],',', 8);
	_memccpy(&parse3, &incomingData[18], ',', 8);
	_memccpy(&parse4, &incomingData[27], ',', 8);



	hexasciitofloat(q1, parse1);
	hexasciitofloat(q2, parse2);
	hexasciitofloat(q3, parse3);
	hexasciitofloat(q4, parse4);
	
	
	FQuat newQ = FQuat(q2,q3,q4,q1);

	if (!hq.Equals(FQuat::Identity))
	{
		return (hq*newQ).Rotator();
	}

	//newQ.Normalize(1.1);
	//FQuat hq = FQuat::Identity;
	//FQuat next = newQ*hq;     //FQuat::Slerp(newQ,current.Quaternion(),.5);
	//FRotator test = next.Rotator();

	return newQ.Rotator();
}
开发者ID:mrG7,项目名称:BallMazing,代码行数:38,代码来源:Libraries.cpp

示例14: Update

void VRPNTrackerInputDevice::Update() {
	if(InputDevice){
		{
			FScopeLock ScopeLock(&CritSect);
			InputDevice->mainloop();
		}
		for(auto &InputPair : TrackerMap)
		{
			TrackerInput &Input = InputPair.Value;
			if(Input.TrackerDataDirty)
			{
				// Before firing events, transform the tracker into the right coordinate space

				FVector NewPosition;
				FQuat NewRotation;
				TransformCoordinates(Input, NewPosition, NewRotation);

				FRotator NewRotator = NewRotation.Rotator();

				FAnalogInputEvent AnalogInputEventX(Input.MotionXKey, FSlateApplication::Get().GetModifierKeys(), 0, 0, 0, 0, NewPosition.X);
				FSlateApplication::Get().ProcessAnalogInputEvent(AnalogInputEventX);
				FAnalogInputEvent AnalogInputEventY(Input.MotionYKey, FSlateApplication::Get().GetModifierKeys(), 0, 0, 0, 0, NewPosition.Y);
				FSlateApplication::Get().ProcessAnalogInputEvent(AnalogInputEventY);
				FAnalogInputEvent AnalogInputEventZ(Input.MotionZKey, FSlateApplication::Get().GetModifierKeys(), 0, 0, 0, 0, NewPosition.Z);
				FSlateApplication::Get().ProcessAnalogInputEvent(AnalogInputEventZ);

				FAnalogInputEvent AnalogInputEventRotX(Input.RotationYawKey, FSlateApplication::Get().GetModifierKeys(), 0, 0, 0, 0, NewRotator.Yaw);
				FSlateApplication::Get().ProcessAnalogInputEvent(AnalogInputEventRotX);
				FAnalogInputEvent AnalogInputEventRotY(Input.RotationPitchKey, FSlateApplication::Get().GetModifierKeys(), 0, 0, 0, 0, NewRotator.Pitch);
				FSlateApplication::Get().ProcessAnalogInputEvent(AnalogInputEventRotY);
				FAnalogInputEvent AnalogInputEventRotZ(Input.RotationRollKey, FSlateApplication::Get().GetModifierKeys(), 0, 0, 0, 0, NewRotator.Roll);
				FSlateApplication::Get().ProcessAnalogInputEvent(AnalogInputEventRotZ);

				Input.TrackerDataDirty = false;
			}
		}
	}
}
开发者ID:flair2005,项目名称:VRPNInput,代码行数:38,代码来源:VRPNInputDevice.cpp

示例15: NeuronReadMotion

// Read motion data from Axis Neuron
bool UNeuronBPFunctionLibrary::NeuronReadMotion(AThirdPersonNeuronController *Controller, FVector& Translation, FRotator& Rotation, FVector AddTranslation, FRotator AddRotation, int32 BoneIndex, ENeuronSkeletonEnum SkeletonType)
{
	bool bExit = false;

	if (Controller == NULL)
	{
		if (GEngine) 
		{
			GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Controller is invalid.")));
		}
		bExit = true;
	}
	else if (!Controller->bConnected)
	{
		bExit = true;
	}
	else if (BoneIndex > Controller->BoneNr)
	{
		if (GEngine)
		{
			GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Boneindex %d exceeds maximum available bones %d."), BoneIndex, Controller->BoneNr));
		}
		bExit = true;
	}
	else if ((BoneIndex * 6) > Controller->FloatCount)
	{	
		bExit = true;
	}

	if (bExit == true)
	{
		Rotation.Yaw = Rotation.Pitch = Rotation.Roll = 0;
		Translation.X = Translation.Y = Translation.Z = 0;
		return false;
	}


	//
	// Translation
	//

	// Read translation values and remove BVH reference position
	float X = Controller->MotionLine[(BoneIndex * 6) + Controller->Skeleton[BoneIndex].XPos] - Controller->Skeleton[BoneIndex].Offset[0];
	float Y = Controller->MotionLine[(BoneIndex * 6) + Controller->Skeleton[BoneIndex].YPos] - Controller->Skeleton[BoneIndex].Offset[1];
	float Z = Controller->MotionLine[(BoneIndex * 6) + Controller->Skeleton[BoneIndex].ZPos] - Controller->Skeleton[BoneIndex].Offset[2];
	
	// Map BVH right hand system to local bone coordinate system
	switch (SkeletonType)
	{
		case ENeuronSkeletonEnum::VE_Neuron:  // Neuron BVH skeleton
		{
			if (BoneIndex == 0)
			{	// Hips
				Translation = FVector(X, -Y, Z);
			}
			else if ((BoneIndex >= 1) && (BoneIndex <= 6))
			{	// Legs
				Translation = FVector(X, Y, -Z);
			}
			else if ((BoneIndex >= 7) && (BoneIndex <= 12))
			{	// Spine,...
				Translation = FVector(X, -Y, -Z);
			}
			else if ((BoneIndex >= 13) && (BoneIndex <= 35))
			{	// Right arm
				Translation = FVector(-Z, X, Y);
			}
			else if ((BoneIndex >= 36) && (BoneIndex <= 58))
			{	// Left arm
				Translation = FVector(Z, -X, Y);
			}
			break;
		}
		case ENeuronSkeletonEnum::VE_TPP_Hero:	// Hero_TPP, Old blue Unreal default skeleton with T-Pose
		case ENeuronSkeletonEnum::VE_Mannequin: // Mannequin, New Unreal default skeleton with A-Pose
		{
			if (BoneIndex == 0)
			{	// Hips
				Translation = FVector(Y, Z, -X);
			}
			// Ignore other bones
		}
	}

	// Add additional translation
	Translation.X += AddTranslation.X;
	Translation.Y += AddTranslation.Y;
	Translation.Z += AddTranslation.Z;
	


	//
	// Rotation 
	//

	// Read rotation values and map to pitch, yaw, roll (y, z, x)
	float XR = Controller->MotionLine[(BoneIndex * 6) + Controller->Skeleton[BoneIndex].XRot] * PI / 180.f;
	float YR = Controller->MotionLine[(BoneIndex * 6) + Controller->Skeleton[BoneIndex].YRot] * PI / 180.f;
	float ZR = Controller->MotionLine[(BoneIndex * 6) + Controller->Skeleton[BoneIndex].ZRot] * PI / 180.f;
//.........这里部分代码省略.........
开发者ID:philippbb,项目名称:TP_ThirdPersonNeuron,代码行数:101,代码来源:NeuronBPFunctionLibrary.cpp


注:本文中的FQuat::Rotator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。