您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetCharacterMovement函数代码示例

51自学网 2021-06-01 21:04:53
  C++
这篇教程C++ GetCharacterMovement函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GetCharacterMovement

void ARoguelikeChar::ChangeStamina(float Amount){	CurrentStamina += Amount;	if (bIsOnCooldown)	{		if (CurrentStamina > CooldownResetLim)		{			bIsOnCooldown = false;		}	}	if (CurrentStamina <= 0)	{		CurrentStamina = 0;		bIsSprinting = false;		PlayerAnimationInstance->bIsSprinting = bIsSprinting;		StaminaRate = StaminaRate * (-0.5f);		GetCharacterMovement()->MaxWalkSpeed = InitialMovementSpeed;		bIsOnCooldown = true;	}	else if (CurrentStamina > MaxStamina)	{		CurrentStamina = MaxStamina;	}	PlayerController->UpdateUI();}
开发者ID:DigitalDok,项目名称:MyPortfolioSnippets,代码行数:31,


示例2: MoveForward

void AFPSCharacter::MoveForward(float Value){    if ( (Controller != NULL) && (Value != 0.0f) )    {	// find out which way is forward	FRotator Rotation = Controller->GetControlRotation();	// Limit pitch when walking or falling	if (GetCharacterMovement()->IsMovingOnGround() || GetCharacterMovement()->IsFalling() )	{	    Rotation.Pitch = 0.0f;	}	// add movement in that direction	const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);	AddMovementInput(Direction, Value);    }}
开发者ID:jhallard,项目名称:FPSProject,代码行数:16,


示例3: GetCharacterMovement

void AMech_RPGCharacter::BeginPlay() {	Super::BeginPlay();	GetCharacterMovement()->SetAvoidanceEnabled(true);	if (IsPendingKill()) {		return;	}	if (!UseLoadout) {		//CreatePresetRole(StartingRole());	}	else {		SetupWithLoadout();	}	if (abilities.Num() > 0) {		SetCurrentAbility(abilities[0]);	}	//SetUpGroup();	SetUpWidgets();	if (OnPostBeginPlay.IsBound()) {		OnPostBeginPlay.Broadcast(this);	}}
开发者ID:belven,项目名称:Mech_RPG,代码行数:25,


示例4: GetCharacterMovement

void ARadeCharacter::DoubleJump_Implementation(){		// Set player Velocity on server	GetCharacterMovement()->Velocity.Z += JumpJetPack.CurrentChargePercent*JumpJetPack.PushPower;	JumpJetPack.CurrentChargePercent = 0;	bCanFillJetPack = false;}
开发者ID:dcyoung,项目名称:Rade,代码行数:7,


示例5: ToggleLaserVisibility

void ARoguelikeChar::InitializeGameplayStats(){	BulletsLeft_A = (User_BulletsLeft_A > 0) ? MaxAmmoHolderSize : 0;	BulletsLeft_B = (User_BulletsLeft_B > 0) ? MaxAmmoHolderSize : 0;	BulletsLeft_C = (User_BulletsLeft_C > 0) ? MaxAmmoHolderSize : 0;	BulletsLeft_A_Total = User_BulletsLeft_A;	BulletsLeft_B_Total = User_BulletsLeft_B;	BulletsLeft_C_Total = User_BulletsLeft_C;	MaxStamina = 100.0f;	CurrentStamina = MaxStamina;	MaxHealth = 100.0f;	CurrentHealth = MaxHealth;	Kills = 0;	Wave = 1;	PlayerAnimationInstance->bCanShoot = true;	DeathCamera->Deactivate();	ToggleLaserVisibility(false);	InitialMovementSpeed = GetCharacterMovement()->MaxWalkSpeed;	bIsAiming = bIsSprinting = false;	PlayerController->UpdateUI();}
开发者ID:DigitalDok,项目名称:MyPortfolioSnippets,代码行数:30,


示例6: GetCharacterMovement

/***	Update the default max speed rate with new rate.**	@param Speed to move*	@return void**/void APlayerCharacter::SetSpeed(float speed){	if(!SpeedBoostActive)	{	GetCharacterMovement()->MaxWalkSpeed = speed;	}}
开发者ID:jackdurnford,项目名称:MidnightSnag,代码行数:13,


示例7: GetCharacterMovement

FVector ACharacter::GetNavAgentLocation() const{	FVector AgentLocation = FNavigationSystem::InvalidLocation;	if (GetCharacterMovement() != nullptr)	{		AgentLocation = GetCharacterMovement()->GetActorFeetLocation();	}	if (FNavigationSystem::IsValidLocation(AgentLocation) == false && CapsuleComponent != nullptr)	{		AgentLocation = GetActorLocation() - FVector(0, 0, CapsuleComponent->GetScaledCapsuleHalfHeight());	}	return AgentLocation;}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:16,


示例8: GetCharacterMovement

void APaperCharacter::PostInitializeComponents(){	Super::PostInitializeComponents();	if (!IsPendingKill())	{		if (Sprite)		{			// force animation tick after movement component updates			if (Sprite->PrimaryComponentTick.bCanEverTick && GetCharacterMovement())			{				Sprite->PrimaryComponentTick.AddPrerequisite(GetCharacterMovement(), GetCharacterMovement()->PrimaryComponentTick);			}		}	}}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:16,


示例9: GetCapsuleComponent

ABatteryCollectorCharacter::ABatteryCollectorCharacter(){	// 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 = 600.f;	GetCharacterMovement()->AirControl = 0.2f;	// Create a camera boom (pulls in towards the player if there is a collision)	CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));	CameraBoom->AttachTo(RootComponent);	CameraBoom->TargetArmLength = 300.0f; // The camera follows at this distance behind the character		CameraBoom->bUsePawnControlRotation = true; // Rotate the arm based on the controller	// Create a follow camera	FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera"));	FollowCamera->AttachTo(CameraBoom, USpringArmComponent::SocketName); // Attach the camera to the end of the boom and let the boom adjust to match the controller orientation	FollowCamera->bUsePawnControlRotation = false; // Camera does not rotate relative to arm	// Collection Sphere	CollectionSphere = CreateDefaultSubobject<USphereComponent>(TEXT("CollectionSphere"));	CollectionSphere->AttachTo(RootComponent);	CollectionSphere->SetSphereRadius(200);	// Set Power Level	InitialPower = 2000;	CharacterPower = InitialPower;	// Set speed	SpeedFactor = 0.75f;	BaseSpeed = 10;	// 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:DrunkReaperMatt,项目名称:BatteryCollector,代码行数:47,


示例10: GetCharacterMovement

// Update power level of the charactervoid ABatteryCollectorCharacter::UpdatePower(float PowerChange){	CharacterPower += PowerChange;	// change speed based on power	GetCharacterMovement()->MaxWalkSpeed = BaseSpeed + SpeedFactor * CharacterPower;	// call visual effect	PowerChangeEffect();}
开发者ID:digitaldominus,项目名称:BatteryCollector,代码行数:9,


示例11: GetCharacterMovement

// Called when the game starts or when spawnedvoid ABaseCharacter::BeginPlay(){	Super::BeginPlay();		OriginalWalkSpeed = GetCharacterMovement()->MaxWalkSpeed;	SetCameraView(bIsInFirstPersonView);}
开发者ID:TheComet93,项目名称:iceweasel,代码行数:9,


示例12: FConstructorStatics

// Sets default valuesASoldierPawn::ASoldierPawn(){	struct FConstructorStatics	{		ConstructorHelpers::FObjectFinderOptional<UPaperFlipbook> RunAnimationAsset;		ConstructorHelpers::FObjectFinderOptional<UPaperFlipbook> IdleAnimationAsset;		FConstructorStatics()			: RunAnimationAsset(TEXT("/Game/2dSideScroller/Animation/Soldier/Run.Run")),			IdleAnimationAsset(TEXT("/Game/2dSideScroller/Animation/Soldier/Idle.Idle"))		{		}	};	static FConstructorStatics ConstructorStatics;	RunAnimation = ConstructorStatics.RunAnimationAsset.Get();	IdleAnimation = ConstructorStatics.IdleAnimationAsset.Get();	GetSprite()->SetFlipbook(IdleAnimation);	GetSprite()->SetRelativeScale3D(FVector(4.5, 1, 4.5));	// Use only Yaw from the controller and ignore the rest of the rotation.	bUseControllerRotationPitch = false;	bUseControllerRotationYaw = true;	bUseControllerRotationRoll = false;	// Set the size of our collision capsule.	GetCapsuleComponent()->SetCapsuleHalfHeight(90);	GetCapsuleComponent()->SetCapsuleRadius(43);	GetCapsuleComponent()->SetRelativeLocation(FVector(-25, 0, 0));	// Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.	// PrimaryActorTick.bCanEverTick = true;	RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root Component"));	// Configure character movement	GetCharacterMovement()->GravityScale = 2.0f;	GetCharacterMovement()->AirControl = 0.80f;	GetCharacterMovement()->JumpZVelocity = 1000.f;	GetCharacterMovement()->GroundFriction = 3.0f;	GetCharacterMovement()->MaxWalkSpeed = 600.0f;	GetCharacterMovement()->MaxFlySpeed = 600.0f;	// Lock character motion onto the XZ plane, so the character can't move in or out of the screen	GetCharacterMovement()->bConstrainToPlane = true;	GetCharacterMovement()->SetPlaneConstraintNormal(FVector(0, -1, 0));	GetCharacterMovement()->bUseFlatBaseForFloorChecks = true;}
开发者ID:NightWolf007,项目名称:ContraProject,代码行数:52,


示例13:

void ACloud10Character::Jump(){	JumpKeyHoldTime = 0.0f;	if (GetCharacterMovement()->IsMovingOnGround())		bPressedJump = true;	else bPressedJump = false;}
开发者ID:KaroA,项目名称:Cloud-10,代码行数:8,


示例14: Tick

// Called every framevoid APlayerCharacter::Tick( float DeltaTime ){	Super::Tick( DeltaTime );	if (_jumpCount > 0 && GetCharacterMovement()->IsMovingOnGround())	{		_jumpCount = 0;	}}
开发者ID:Zyrst,项目名称:Run,代码行数:9,


示例15: GetCharacterMovement

bool ANimModCharacter::IsCrouched() const{	UCharacterMovementComponent* MoveComp = GetCharacterMovement();	if (MoveComp)		return MoveComp->IsCrouching();	return bIsCrouched;}
开发者ID:Nimgoble,项目名称:NimMod,代码行数:8,


示例16: ClientSetIfAcceptMoveInput

void ATotemCharacter::EnterDeath(){	ClientSetIfAcceptMoveInput(false);	bCanBasicAttack = false;	bCanUseAbility = false;	bAcceptCameraChange = false;	GetCharacterMovement()->Velocity = FVector(0.0f);}
开发者ID:whiteeat,项目名称:TotemCodeSample,代码行数:8,


示例17: Super

// Sets default valuesAPlayerCharacter::APlayerCharacter(const class FObjectInitializer& PCIP) : Super(), Utils(Utilities(this)) {    // Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.    PrimaryActorTick.bCanEverTick = true;    CreateComponentFromTemplate(NewObject<UInventoryComponent>());    GetCharacterMovement()->GetNavAgentPropertiesRef().bCanCrouch = true;        selectedQuickSlot = Primary;}
开发者ID:TriFuse-Infrared,项目名称:Oncoming-Pre-Alpha,代码行数:9,


示例18: CharacterJump

void AMainCharacter::CharacterJump(){	if (GetCharacterMovement()->IsMovingOnGround())	{		PlayCharacterSound(JumpSound);	}	AMainCharacter::Jump();}
开发者ID:rcktscnc,项目名称:unreal-project,代码行数:8,


示例19: GetCharacterMovement

/** * 	Function to update character power  *  @param _powerChange amount to change power */void ABatteryCollectorCharacter::UpdatePower(float _powerChange){	_characterPower 		+= _powerChange;	GetCharacterMovement() 	-> MaxWalkSpeed = (_baseSpeed + _speedFactor * _characterPower);	// Visual effect	PowerChangeEffect();}
开发者ID:benji011,项目名称:Battery-Collector,代码行数:12,


示例20: Super

AWeaponEssentialsCharacter::AWeaponEssentialsCharacter(const FObjectInitializer& ObjectInitializer)	: Super(ObjectInitializer){	CurrentWeapon = NULL;	Inventory.SetNum(3, false);	// 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;	CollisionComp = ObjectInitializer.CreateDefaultSubobject<UBoxComponent>(this, "CollisionComp");	CollisionComp->AttachParent = GetRootComponent();	CollisionComp->OnComponentBeginOverlap.AddDynamic(this, &AWeaponEssentialsCharacter::OnCollision);	// 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 = 600.f;	GetCharacterMovement()->AirControl = 0.2f;	// Create a camera boom (pulls in towards the player if there is a collision)	CameraBoom = ObjectInitializer.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("CameraBoom"));	CameraBoom->AttachParent = GetRootComponent();	CameraBoom->TargetArmLength = 300.0f; // The camera follows at this distance behind the character		CameraBoom->bUsePawnControlRotation = true; // Rotate the arm based on the controller	// Create a follow camera	FollowCamera = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FollowCamera"));	FollowCamera->AttachTo(CameraBoom, USpringArmComponent::SocketName); // Attach the camera to the end of the boom and let the boom adjust to match the controller orientation	FollowCamera->bUsePawnControlRotation = false; // Camera does not rotate relative to arm	/* 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:CHADALAK1,项目名称:WeaponEssentials4.6,代码行数:45,


示例21: if

void ALonelyMenCharacter::SetRagDollPhysics(){	bool bInRagdoll = false;	if (IsPendingKill())	{		bInRagdoll = false;	}	else if (!GetMesh() || !GetMesh()->GetPhysicsAsset())	{		bInRagdoll = false;	}	else	{		//init physics		GetMesh()->SetAllBodiesSimulatePhysics(true);		GetMesh()->SetSimulatePhysics(true);		GetMesh()->WakeAllRigidBodies();		GetMesh()->bBlendPhysics = true;		bInRagdoll = true;	}	GetCharacterMovement()->StopMovementImmediately();	GetCharacterMovement()->DisableMovement();	GetCharacterMovement()->SetComponentTickEnabled(false);	if (!bInRagdoll)	{		//hide and set short lifespan		TurnOff();		SetActorHiddenInGame(true);		SetLifeSpan(1.0f);	}	else	{		float beginTime, endTime;		GetMesh()->AnimScriptInstance->GetCurrentActiveMontage()->GetSectionStartAndEndTime(0, beginTime, endTime);		SetLifeSpan(endTime - endTime*0.4);	}}
开发者ID:willcong,项目名称:LonelyMen,代码行数:45,


示例22: GetCharacterMovement

/*Description: Initializes the Harpoon Shot*/void APoseidonCharacter::PrepareGrapple(){	MovementSpeed = 125.0f;	GetCharacterMovement()->MaxWalkSpeed = MovementSpeed;		AnimationBool(AimReady, true);	mIsGrappleReady = true;	mChangeFieldOfView = true;}
开发者ID:AndreaOsorio,项目名称:PSI,代码行数:10,


示例23: IsRunning

bool ANimModCharacter::IsRunning() const{	if (!GetCharacterMovement())	{		return false;	}	return (bWantsToRun || bWantsToRunToggled) && !GetVelocity().IsZero() && (GetVelocity().GetSafeNormal2D() | GetActorRotation().Vector()) > -0.1;}
开发者ID:Nimgoble,项目名称:NimMod,代码行数:9,


示例24: GetCapsuleComponent

// Sets default valuesASpriteCharacter::ASpriteCharacter(){	// Set size for player capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// Don't rotate character to camera direction	bUseControllerRotationPitch = false;	bUseControllerRotationYaw = false;	bUseControllerRotationRoll = false;	// Configure character movement	GetCharacterMovement()->bOrientRotationToMovement = false; // Rotate character to moving direction	GetCharacterMovement()->RotationRate = FRotator(0.f, 640.f, 0.f);	GetCharacterMovement()->bConstrainToPlane = true;	GetCharacterMovement()->bSnapToPlaneAtStart = true;	GetCharacterMovement()->MaxWalkSpeed = 1800.f;}
开发者ID:PedroMoniz,项目名称:UE4AgentSlick,代码行数:19,


示例25: FocusModeOff

void AMMO_Character::FocusModeOff(){	if (bIsAttacking)return;	if (bIsDead)return;	if (!GetCharacterMovement()->IsMovingOnGround())return;	if (LockedTarget)return;	bIsInFocusMode = false;}
开发者ID:DigitalDok,项目名称:MyPortfolioSnippets,代码行数:9,


示例26: IsSprinting

bool ASCharacter::IsSprinting() const{	if (!GetCharacterMovement())		return false;	return bWantsToRun && !IsTargeting() && !GetVelocity().IsZero() 		// Don't allow sprint while strafing sideways or standing still (1.0 is straight forward, -1.0 is backward while near 0 is sideways or standing still)		&& (GetVelocity().GetSafeNormal2D() | GetActorRotation().Vector()) > 0.8; // Changing this value to 0.1 allows for diagonal sprinting. (holding W+A or W+D keys)}
开发者ID:MarcioGeremia,项目名称:EpicSurvivalGameSeries,代码行数:9,


示例27: ActInAir_Implementation

void AWindShaman::ActInAir_Implementation(){	if (GetCharacterMovement()->IsFalling() && bCanHover && WindMoveState != EWindMoveState::Surfing)	{		StartHovering();		IsHovering = true;		SetWindMoveState(EWindMoveState::Surfing);	}}
开发者ID:whiteeat,项目名称:TotemCodeSample,代码行数:9,



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


C++ GetCheckedAuctionHouseForAuctioneer函数代码示例
C++ GetCharWidth函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。