• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FRotator函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FRotator函数的典型用法代码示例。如果您正苦于以下问题:C++ FRotator函数的具体用法?C++ FRotator怎么用?C++ FRotator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: FVector

void AMyProjectBlockGrid::BeginPlay()
{
	Super::BeginPlay();

	// Number of blocks
	const int32 NumBlocks = Size * Size;

	// Loop to spawn each block
	for(int32 BlockIndex=0; BlockIndex<NumBlocks; BlockIndex++)
	{
		const float XOffset = (BlockIndex/Size) * BlockSpacing; // Divide by dimension
		const float YOffset = (BlockIndex%Size) * BlockSpacing; // Modulo gives remainder

		// Make postion vector, offset from Grid location
		const FVector BlockLocation = FVector(XOffset, YOffset, 0.f) + GetActorLocation();

		// Spawn a block
		AMyProjectBlock* NewBlock = GetWorld()->SpawnActor<AMyProjectBlock>(BlockLocation, FRotator(0,0,0));

		// Tell the block about its owner
		if(NewBlock != NULL)
		{
			NewBlock->OwningGrid = this;
		}
	}
}
开发者ID:SteppenWolf1496,项目名称:tic,代码行数:26,代码来源:MyProjectBlockGrid.cpp


示例2: FQuat

void FSimpleHMD::SetupView(FSceneViewFamily& InViewFamily, FSceneView& InView)
{
	InView.BaseHmdOrientation = FQuat(FRotator(0.0f,0.0f,0.0f));
	InView.BaseHmdLocation = FVector(0.f);
//	WorldToMetersScale = InView.WorldToMetersScale;
	InViewFamily.bUseSeparateRenderTarget = false;
}
开发者ID:kidaa,项目名称:UnrealEngineVR,代码行数:7,代码来源:SimpleHMD.cpp


示例3: FQuat

FRotator UKismetMathLibrary::ComposeRotators(FRotator A, FRotator B)
{
	FQuat AQuat = FQuat(A);
	FQuat BQuat = FQuat(B);

	return FRotator(BQuat*AQuat);
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:7,代码来源:KismetMathLibrary.cpp


示例4: Tick

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

	//InputComponent->GetAxisValue("HandX");
	Hand_move_dirvec.X = 3;

	if (InputComponent)
	{
		//InputComponent->GetAxisValue("HandX");
		Hand_move_dirvec.X = InputComponent->GetAxisValue("HandX");
		Hand_move_dirvec.Y = InputComponent->GetAxisValue("HandY");
		Hand_move_dirvec.Z = InputComponent->GetAxisValue("HandZ");
		InputComponent->GetAxisValue("RightGrasp") > 0 ? RightHand->MakeGrabAvailable() : RightHand->MakeGrabUnable();
		InputComponent->GetAxisValue("LeftGrasp") > 0 ? LeftHand->MakeGrabAvailable() : LeftHand->MakeGrabUnable();
		InputComponent->GetAxisValue("LeftSecondaryGrasp") > 0 ? LeftHand->MakeSecondaryGraspAvailable() : LeftHand->MakeSecondaryGraspUnable();
		InputComponent->GetAxisValue("RightSecondaryGrasp") > 0 ? RightHand->MakeSecondaryGraspAvailable() : RightHand->MakeSecondaryGraspUnable();
	}
	else
		Hand_move_dirvec.X = 30000;
	//Hand_move_dirvec /= (float)Hand_move_dirvec.Size();
	RightArm->SetRelativeLocation(FirstPersonCameraComponent->RelativeLocation + RelativeArmposition);
	LeftArm->SetRelativeLocation(FirstPersonCameraComponent->RelativeLocation + RelativeArmposition);

	LeftRealHandScene->AddLocalOffset(FVector(InputComponent->GetAxisValue("LeftHandX"), InputComponent->GetAxisValue("LeftHandY"), InputComponent->GetAxisValue("LeftHandZ")));
	RightRealHandScene->AddLocalOffset(Hand_move_dirvec * 1);
	FirstPersonCameraComponent->AddRelativeRotation(FRotator(-InputComponent->GetAxisValue("YaxisLook"), InputComponent->GetAxisValue("XaxisLook"), 0));
}
开发者ID:dark2224,项目名称:Space_Redemption,代码行数:29,代码来源:PilotPawn.cpp


示例5: FRotator

void ABrainNormalInteractiveObject::Tick(float deltaTime)
{
	Super::Tick(deltaTime);

	if (_canBeRotate)
	{
		_currentRotation += (_deltaRotation * (deltaTime / _animDuration));
		_durationRotation += deltaTime;
		if (_durationRotation > _animDuration)
		{
			_currentRotation = _targetRotation;
			_deltaRotation = FRotator(0, 0, 0); // Annulation du deltaRotation
		}

		SetActorRotation(_currentRotation);
	}

	if (_canBeTranslate)
	{
		_currentTranslation += (_deltaTranslation * deltaTime / _animDuration);
		_durationTranslation += deltaTime;
		if (_durationTranslation > _animDuration)
		{
			_currentTranslation = _targetTranslation;
			_deltaTranslation = FVector(0, 0, 0); // Annulation du deltaSize
		}

		SetActorLocation(_currentTranslation,true);
	}

	if (_canBeScale)
	{
		_currentScale += (_deltaScale * deltaTime / _animDuration);
		_durationScale += deltaTime;
		if (_durationScale > _animDuration)
		{
			_currentScale = _targetScale;
			_deltaScale = FVector(0,0,0); // Annulation du deltaSize
		}

		SetActorScale3D(_currentScale);
	}

	if (_canBeShear)
	{
		_currentShearFirstAxis += (_deltaShearFirstAxis * deltaTime / _animDuration);
		_currentShearSecondAxis += (_deltaShearSecondAxis * deltaTime / _animDuration);
		_durationShear += deltaTime;
		if (_durationShear > _animDuration)
		{
			_currentShearFirstAxis = _targetShearFirstAxis;
			_currentShearSecondAxis = _targetShearSecondAxis;
			_deltaShearFirstAxis = 0;
			_deltaShearSecondAxis = 0;
		}

		FTransform sTrans = FTransform(Shear(_currentShearFirstAxis, _currentShearSecondAxis));
		SetActorTransform(sTrans*_cachedTransform);
	}
}
开发者ID:gamer08,项目名称:Brain,代码行数:60,代码来源:BrainNormalInteractiveObject.cpp


示例6: GetActorLocation

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

	CollectionParticles->SetColorParameter("ParticleColor", GemColor);
	CollectionParticles->SetRelativeLocation(FVector::ZeroVector);
	CollectionParticles->SetWorldRotation(FRotator::ZeroRotator);
	CollectionParticles->SetWorldScale3D(FVector(1.0f, 1.0f, 1.0f));
	//CollectionParticles->UpdateInstances();
	FVector loc = GetActorLocation();
	loc = FVector(0.0f, 0.0f, 10.0f*DeltaTime*FMath::Cos(curTime*PI));

	if (Player != nullptr) {
		CollectionParticles->SetVectorParameter("PlayerPosition", 1.0f*(Player->GetActorLocation()-GetActorLocation()));
		CollectionParticles->SetVectorParameter("PlayerSize1", Player->GetActorLocation() + (DeltaTime / 0.016f)*FVector(-45.0f, -45.0f, -45.0f));
		CollectionParticles->SetVectorParameter("PlayerSize2", Player->GetActorLocation() + (DeltaTime / 0.016f)*FVector(45.0f, 45.0f, 45.0f));
		CollectionParticles->SetFloatParameter("Strength", (1.0f/DeltaTime)*FMath::Clamp(GetWorldTimerManager().GetTimerElapsed(PostCollectionTimer) / 2.0f, 0.0f, 1.0f)*FMath::Clamp(GetWorldTimerManager().GetTimerElapsed(PostCollectionTimer) / 2.0f, 0.0f, 1.0f));
	} else {
		SetActorLocation(GetActorLocation() + loc);
		GemModel->AddWorldRotation(FRotator(0.0f, 60.0f*DeltaTime, 0.0f));
	}

	// Eliot made me put this here.
	if (GetWorldTimerManager().GetTimerElapsed(PostCollectionTimer) != -1.0f) {
		gemmat->SetScalarParameterValue("Break", 20.0f*GetWorldTimerManager().GetTimerElapsed(PostCollectionTimer));
	}

	curTime += DeltaTime;
}
开发者ID:chris-hamer,项目名称:shards,代码行数:30,代码来源:Gem.cpp


示例7: GetCapsuleComponent

ARTJamCharacter::ARTJamCharacter()
{
	// Set size for collision capsule
	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);
	GetCapsuleComponent()->OnComponentHit.AddDynamic(this, &ARTJamCharacter::OnHit);

	// Don't rotate when the controller rotates.
	bUseControllerRotationPitch = false;
	bUseControllerRotationYaw = false;
	bUseControllerRotationRoll = false;

	// Configure character movement
	GetCharacterMovement()->bOrientRotationToMovement = true; // Face in the direction we are moving..
	GetCharacterMovement()->RotationRate = FRotator(0.0f, 720.0f, 0.0f); // ...at this rotation rate
	GetCharacterMovement()->GravityScale = 2.f;
	GetCharacterMovement()->AirControl = 0.80f;
	GetCharacterMovement()->JumpZVelocity = 1000.f;
	GetCharacterMovement()->GroundFriction = 3.f;
	GetCharacterMovement()->MaxWalkSpeed = 600.f;
	GetCharacterMovement()->MaxFlySpeed = 600.f;

	// Note: The skeletal mesh and anim blueprint references on the Mesh component (inherited from Character) 
	// are set in the derived blueprint asset named MyCharacter (to avoid direct content references in C++)

	bIsDead = false;

	NormalImpulse = 800.f;
	MaxImpulse = 1000.f;
	ForceLength.Z = NormalImpulse;
}
开发者ID:CHADALAK1,项目名称:RTGameJam2016,代码行数:30,代码来源:RTJamCharacter.cpp


示例8: SphereMesh

AShipPawn::AShipPawn()
{
	PrimaryActorTick.bCanEverTick = true;

	static ConstructorHelpers::FObjectFinder<UStaticMesh> SphereMesh(TEXT("/Game/Assets/Ships/DroneShip"));
	MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComponent"));
	MeshComponent->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName);
	MeshComponent->SetStaticMesh(SphereMesh.Object);
	MeshComponent->SetMobility(EComponentMobility::Movable);
	MeshComponent->SetSimulatePhysics(true);
	MeshComponent->BodyInstance.bLockZTranslation = true;
	MeshComponent->SetEnableGravity(false);
	MeshComponent->SetLinearDamping(ShipLinearDamping);
	MeshComponent->SetAngularDamping(ShipAngularDamping);
	MeshComponent->BodyInstance.bLockXRotation = true;
	MeshComponent->BodyInstance.bLockYRotation = true;


	RootComponent = MeshComponent;


	CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
	CameraBoom->AttachTo(RootComponent);
	CameraBoom->bAbsoluteRotation = true;
	CameraBoom->TargetArmLength = 20000.f;
	CameraBoom->RelativeRotation = FRotator(-80.f, 0.f, 0.f);
	CameraBoom->bDoCollisionTest = false;

	CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("CameraComponent"));
	CameraComponent->AttachTo(CameraBoom, USpringArmComponent::SocketName);
	CameraComponent->bUsePawnControlRotation = false;
}
开发者ID:calben,项目名称:SlingshotGame,代码行数:32,代码来源:ShipPawn.cpp


示例9: Super

ACapTheBrainCharacter::ACapTheBrainCharacter(const class FObjectInitializer& PCIP)
	: Super(PCIP)
{
	buff = 100;
	buffTimer = 0;
	buffDelay = 2;
	score = 0;
	firstUpdate = true;
	// Set size for collision capsule
	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);

	// set our turn rates for input
	BaseTurnRate = 45.f;
	BaseLookUpRate = 45.f;

	// Don't rotate when the controller rotates. Let that just affect the camera.
	bUseControllerRotationPitch = false;
	bUseControllerRotationYaw = false;
	bUseControllerRotationRoll = false;

	// Configure character movement
	GetCharacterMovement()->bOrientRotationToMovement = true; // Character moves in the direction of input...	
	GetCharacterMovement()->RotationRate = FRotator(0.0f, 540.0f, 0.0f); // ...at this rotation rate
	GetCharacterMovement()->JumpZVelocity = 200.f;
	GetCharacterMovement()->AirControl = 0.2f;

	// Note: The skeletal mesh and anim blueprint references on the Mesh component (inherited from Character) 
	// are set in the derived blueprint asset named MyCharacter (to avoid direct content references in C++) 
}
开发者ID:nertro,项目名称:CaptureTheBrain,代码行数:29,代码来源:CapTheBrainCharacter.cpp


示例10: check

//========================================================================
void AHexEditorActor::UpdateBarrierPlacing()
{
	if (m_CurrentBarrier)
	{
		check(m_InputType == InputMode::Barriers);
		
		Raycast<AHexTileActor>(this,
			[&](auto& resultActor, auto& traceResult) 
			{
				auto& coords = resultActor->GetCoordinates();
				auto tilePos = m_Grid.GetPosition(coords);
				auto toHit = traceResult.ImpactPoint - tilePos;
				auto nId = GetNeighborId(toHit);
				auto neighborRelativeCoordinates = T_HexGrid::HorizontalNeighborIndexes[nId];

				auto pos = m_Grid.GetPositionBetweenTiles(coords, coords + neighborRelativeCoordinates);
				m_CurrentBarrier->SetActorLocation(pos);
				m_CurrentBarrier->SetActorRotation(FRotator(0, 60 * -(int)nId, 0));

				m_CurrentBarrier->SetOwningTileBeforePlace(resultActor, nId);
			},
			[&]()
			{
				m_CurrentBarrier->SetOwningTileBeforePlace(nullptr);
			});
	}
}
开发者ID:jijik,项目名称:portal_game,代码行数:28,代码来源:HexEditorActor.cpp


示例11:

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

	CollisionSphere =
		CreateDefaultSubobject<USphereComponent>(TEXT("CollisionSphere"));
	CollisionSphere->SetCollisionObjectType(ECollisionChannel::ECC_Pawn);
	//Might want to tweak this in the editor depending on the size of the static mesh
	CollisionSphere->InitSphereRadius(10.0f);
	CollisionSphere->SetCollisionProfileName(TEXT("Pawn"));
	RootComponent = CollisionSphere;

	MovementComponent = CreateDefaultSubobject<UFloatingPawnMovement>("MovementComponent");
	MovementComponent->SetUpdatedComponent(RootComponent);

	StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMesh"));
	StaticMesh->AttachTo(RootComponent);

	OtherMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("OtherMesh"));
	OtherMesh->AttachTo(RootComponent);
	OtherMesh->SetVisibility(false);

	Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
	Camera->AttachTo(RootComponent);
	Camera->SetRelativeLocation(FVector(-100.0f, 0.0f, 200.0f));
	Camera->SetRelativeRotation(FRotator(-60.0f, 0.0f, 0.0f));

}
开发者ID:randoro,项目名称:SheepHurrdurr,代码行数:31,代码来源:Dog.cpp


示例12: GetActorLocation

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

	//Set this pawn to be controlled by the lowest numbered player
	AutoPossessPlayer = EAutoReceiveInput::Player0;

	//Create a dummy root component to attach things to.
	RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
	//create a camera and a visible object
	UCameraComponent* OurCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("OurCamera"));
	OurVisibleComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("OurVisibleComponent"));

	//attach our camera and visible object to the root
	OurCamera->AttachTo(RootComponent);
	(*OurVisibleComponent).AttachTo(RootComponent);

	//offset camera
	OurCamera->SetRelativeLocation(FVector(-250, 0, 250));

	//rotate camera
	OurCamera->SetRelativeRotation(FRotator(-45, 0, 0));
	InitLocation = GetActorLocation();
}
开发者ID:rjp0008,项目名称:unreal-playground,代码行数:26,代码来源:MyPawn.cpp


示例13: EditingStore

FCreatureAnimStoreEditorViewportClient::FCreatureAnimStoreEditorViewportClient(const TWeakPtr<class SEditorViewport>& InEditorViewportWidget /*= nullptr*/, UCreatureAnimationClipsStore* EditingAnimStore)
    :FEditorViewportClient(nullptr, &OwnerScene, InEditorViewportWidget)
    , EditingStore(EditingAnimStore)
{
    PreviewScene = &OwnerScene;
    ((FAssetEditorModeManager*)ModeTools)->SetPreviewScene(PreviewScene);
    DrawHelper.bDrawGrid = true;
    DrawHelper.bDrawPivot = true;

    /*SetViewLocation(FVector(0, 30, 0));
    SetLookAtLocation(FVector(0, -30, 0));*/


    SetRealtime(true);
    //向PreviewScene添加Component
    EditingCreatureMesh = NewObject<UCreatureMeshComponent>();
    //设置CreatureMesh组件
    SetUpEditingCreatureMesh();
    PreviewScene->AddComponent(EditingCreatureMesh, FTransform::Identity);
    EditingCreatureMesh->SetRelativeRotation(FRotator(0, 90, 0));

    //设置Camera
    SetUpCamera();

    if (EditingStore->ClipList.Num()!=0)
    {
        //默认播放第一个Clip
        EditingCreatureMesh->SetBluePrintActiveCollectionClip_Name(EditingStore->ClipList[0].ClipName);
    }

}
开发者ID:kestrelm,项目名称:CreatureDemos,代码行数:31,代码来源:CreatureAnimStoreEditorViewportClient.cpp


示例14: FConstructorStatics

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

   struct FConstructorStatics
   {
      ConstructorHelpers::FObjectFinderOptional<UStaticMesh> barricadeShape;
      ConstructorHelpers::FObjectFinderOptional<UMaterialInstance> barricadeMaterial;
      FConstructorStatics()
         : barricadeShape(TEXT("/Game/MapProps/blockade.blockade"))
         , barricadeMaterial(TEXT("Material'/Game/MapProps/cementLight.cementLight'"))
      {
      }
   };
   static FConstructorStatics ConstructorStatics;

   // Create dummy root scene component
   //DummyRoot = CreateDefaultSubobject<USceneComponent>(TEXT("Dummy0"));
   //RootComponent = DummyRoot;

   ItemBasicMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("item_shape"));
   // Create random mesh component
   ItemBasicMesh->SetStaticMesh(ConstructorStatics.barricadeShape.Get());
   ItemBasicMesh->SetMaterial(0, ConstructorStatics.barricadeMaterial.Get());
   ItemBasicMesh->SetRelativeScale3D(FVector(0.2f,0.2f,0.2f));
   ItemBasicMesh->SetRelativeLocation(FVector(0.f,0.f,0.f));
   ItemBasicMesh->SetRelativeRotation(FRotator(0.f, 0.f, 0.f));
   //ItemBasicMesh->AttachTo(DummyRoot);

   health = 3;

   this->OnActorHit.AddDynamic(this, &ASceneBarricades::onHit);
}
开发者ID:burnsm,项目名称:Tanks,代码行数:35,代码来源:SceneBarricades.cpp


示例15: CombineRotators

FRotator CombineRotators(FRotator A, FRotator B)
{
    FQuat AQuat = FQuat(A);
    FQuat BQuat = FQuat(B);

    return FRotator(BQuat*AQuat);
}
开发者ID:huylu,项目名称:leap-ue4,代码行数:7,代码来源:LeapInterfaceUtility.cpp


示例16: GetWorld

void UTankTurret::Rotate(float RelativeSpeed)
{
	RelativeSpeed = FMath::Clamp<float>(RelativeSpeed, -1, +1);
	auto RotationChange = RelativeSpeed * MaxDegreesPerSecond * GetWorld()->DeltaTimeSeconds;
	auto Rotation = RelativeRotation.Yaw + RotationChange;
	SetRelativeRotation(FRotator(0, Rotation, 0));
}
开发者ID:scubadad,项目名称:BattleTank,代码行数:7,代码来源:TankTurret.cpp


示例17: convertLeapToUE

//Conversion - use find and replace to change behavior, no scaling version is typically used for orientations
FVector convertLeapToUE(Leap::Vector leapVector)
{
    //Convert Axis
    FVector vect = FVector(-leapVector.z, leapVector.x, leapVector.y);

    //Hmd orientation adjustment
    if (LeapShouldAdjustForFacing)
    {
        FRotator rotation = FRotator(90.f, 0.f, 180.f);
        vect = FQuat(rotation).RotateVector(vect);

        if (LeapShouldAdjustRotationForHMD)
        {
            if (GEngine->HMDDevice.IsValid())
            {
                FQuat orientationQuat;
                FVector position;
                GEngine->HMDDevice->GetCurrentOrientationAndPosition(orientationQuat, position);
                vect = orientationQuat.RotateVector(vect);
            }
        }
    }

    return vect;
}
开发者ID:huylu,项目名称:leap-ue4,代码行数:26,代码来源:LeapInterfaceUtility.cpp


示例18: FRotator

// Sets default values
APawnWithCamera::APawnWithCamera()
{
 	// Set this pawn to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;
	
	//Create this actors components
	RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
	OurCameraSpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraSpringArm"));
	OurCameraSpringArm->AttachTo(RootComponent);
	OurCameraSpringArm->SetRelativeLocationAndRotation(FVector(0.0f, 0.0f, 50.0f), FRotator(-60.0f, 0.0f, 0.0f));
	OurCameraSpringArm->TargetArmLength = 400.f;
	OurCameraSpringArm->bEnableCameraLag = true;
	OurCameraSpringArm->CameraLagSpeed = 3.0f;

	//create and attach the camera
	OurCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("GameCamera"));
	OurCamera->AttachTo(OurCameraSpringArm, USpringArmComponent::SocketName);

	//take control of the default player
	AutoPossessPlayer = EAutoReceiveInput::Player0;

	//default speed values
	ForwardSpeed = 300.0f;
	StrafeSpeed = 200.0f;
	//default look sensitivity
	LookSensitivityX = 2.0f;
	LookSensitivityY = 2.0f;
}
开发者ID:dimmondslice,项目名称:ShotgunGladiators,代码行数:29,代码来源:PawnWithCamera.cpp


示例19: ShipMesh

AMobileAgentSlickPawn::AMobileAgentSlickPawn()
{	
	static ConstructorHelpers::FObjectFinder<UStaticMesh> ShipMesh(TEXT("/Game/TwinStick/Meshes/TwinStickUFO.TwinStickUFO"));
	// Create the mesh component
	ShipMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("ShipMesh"));
	RootComponent = ShipMeshComponent;
	ShipMeshComponent->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName);
	ShipMeshComponent->SetStaticMesh(ShipMesh.Object);
	

	// Create a camera boom...
	CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
	CameraBoom->AttachTo(RootComponent);
	CameraBoom->bAbsoluteRotation = true; // Don't want arm to rotate when ship does
	CameraBoom->TargetArmLength = 1200.f;
	CameraBoom->RelativeRotation = FRotator(-90.f, 0.f, 0.f);
	CameraBoom->bDoCollisionTest = false; // Don't want to pull camera in when it collides with level

	// Create a camera...
	CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("TopDownCamera"));
	CameraComponent->AttachTo(CameraBoom, USpringArmComponent::SocketName);
	CameraComponent->bUsePawnControlRotation = false;	// Camera does not rotate relative to arm

	// Movement
	MoveSpeed = 1000.0f;
}
开发者ID:PedroMoniz,项目名称:UE4AgentSlick,代码行数:26,代码来源:MobileAgentSlickPawn.cpp


示例20: GetCharacterMovement

void AMech_RPGCharacter::Tick(float DeltaTime) {
	Super::Tick(DeltaTime);
	if (!isDead) {
		GetCharacterMovement()->MaxWalkSpeed = speed * speedModifier;

		if (GetHealth() < GetMaxHealth()) {
			float regen = !inCombat ? GetMaxHealth() * 0.15 : healthRegen;
			health += regen * DeltaTime;

			GetFloatingStats()->UpdateHealthBar();

			if (GetCharacterStats() != nullptr) {
				GetCharacterStats()->UpdateHealthBar();
			}
		}

		if (stats->GetUserWidgetObject() != nullptr && stats->GetUserWidgetObject() != nullptr) {
			if (mIsChildOf(GetController(), AMech_RPGPlayerController::StaticClass()) && GetTopDownCamera() != nullptr) {
				UMiscLibrary::SetCameraRot(FRotator(-GetTopDownCamera()->GetComponentRotation().Pitch, UMiscLibrary::GetWidgetYaw(GetTopDownCamera()) + 90, 0));
				GetStats()->SetWorldRotation(UMiscLibrary::GetCameraRot());
			}
			else if (GetStats() != nullptr) {
				GetStats()->SetWorldRotation(UMiscLibrary::GetCameraRot());
			}
		}
	}

	CLAMP(health, GetMaxHealth(), 0);
}
开发者ID:belven,项目名称:Mech_RPG,代码行数:29,代码来源:Mech_RPGCharacter.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FS函数代码示例发布时间:2022-05-30
下一篇:
C++ FRotationMatrix函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap