本文整理汇总了C++中UPrimitiveComponent::SetWorldLocationAndRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ UPrimitiveComponent::SetWorldLocationAndRotation方法的具体用法?C++ UPrimitiveComponent::SetWorldLocationAndRotation怎么用?C++ UPrimitiveComponent::SetWorldLocationAndRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UPrimitiveComponent
的用法示例。
在下文中一共展示了UPrimitiveComponent::SetWorldLocationAndRotation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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));
}
示例2: 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);
}