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

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

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

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

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

示例1: GetCapsuleComponent

// Called every framevoid ATopDown_HitmanCleanCharacter::Tick( float DeltaTime ){	Super::Tick( DeltaTime );	// Handle growing and shrinking based on our "Grow" action	{		float CurrentScale = GetCapsuleComponent()->GetComponentScale().X;		if (bGrowing){		// Grow to double size over the course of one second			CurrentScale += DeltaTime;		} else{		// Shrink half as fast as we grow			CurrentScale -= (DeltaTime * 0.5f);		}		// Make sure we never drop below our starting size, or increase past double size.		CurrentScale = FMath::Clamp(CurrentScale, 1.0f, 2.0f);		GetCapsuleComponent()->SetWorldScale3D(FVector(CurrentScale));	}	// Handle movement based on our "MoveX" and "MoveY" axes	{		if (!CurrentVelocity.IsZero()){			FVector NewLocation = GetActorLocation() + (CurrentVelocity * DeltaTime);			SetActorLocation(NewLocation);		}	}}
开发者ID:esphung,项目名称:hitman-clean_prototype,代码行数:26,


示例2: GetCapsuleComponent

// Sets default valuesAPlayerCharacter::APlayerCharacter(){	// 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;	GetCapsuleComponent()->InitCapsuleSize(42.f, 90.f);	BaseTurnRate = 60.f;	BaseLookUpRate = 60.f;	FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f);	FirstPersonCameraComponent->bUsePawnControlRotation = true;	Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));	Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->bCastDynamicShadow = false;	Mesh1P->CastShadow = false;	//BOX PICKUP CODE//	Hand = CreateDefaultSubobject<USceneComponent>(TEXT("Hand"));	Hand->AttachTo(FirstPersonCameraComponent);	Hand->RelativeLocation = FVector(100, 0, 0);	//BOX PICKUP CODE//	OnActorBeginOverlap.AddDynamic(this, &APlayerCharacter::OnActorOverlap);	OnActorEndOverlap.AddDynamic(this, &APlayerCharacter::OnActorOverlapEnd);	PhysicsHandler = CreateDefaultSubobject<UPhysicsHandleComponent>(TEXT("PhysicsHandler"));}
开发者ID:Snowman5717,项目名称:SymphonyOfShadows,代码行数:34,


示例3: GetCapsuleComponent

void ADA2UE4Creature::BeginPlay(){	Super::BeginPlay();	//temp	CursorToWorld->SetVisibility(false, true);	CursorToWorld = nullptr;	if (PawnSensingComp)	{		PawnSensingComp->OnSeePawn.AddDynamic(this, &ADA2UE4Creature::OnSeePlayer);		PawnSensingComp->OnHearNoise.AddDynamic(this, &ADA2UE4Creature::OnHearNoise);	}	GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_Visibility, ECR_Block);	//add over events	GetCapsuleComponent()->OnClicked.AddDynamic(this, &ADA2UE4Creature::OnClick);	GetCapsuleComponent()->OnBeginCursorOver.AddDynamic(this, &ADA2UE4Creature::BeginCursorOver);	GetCapsuleComponent()->OnEndCursorOver.AddDynamic(this, &ADA2UE4Creature::EndCursorOver);	PrimaryActorTick.AddPrerequisite(MeshHEDComponent, MeshHEDComponent->PrimaryComponentTick);	//Animation = Cast<UDA2UE4AnimInstance>(MeshHEDComponent->GetAnimInstance());	//Animation->Montage_Play(Montage);	SetupCustomMontages();}
开发者ID:dhk-room101,项目名称:da2ue4,代码行数:27,


示例4: Super

AValorMinionSpawner::AValorMinionSpawner(const FObjectInitializer& ObjectInitializer)	: Super(ObjectInitializer){	GetCapsuleComponent()->InitCapsuleSize(40.0f, 92.0f);#if WITH_EDITORONLY_DATA	ArrowComponent = CreateEditorOnlyDefaultSubobject<UArrowComponent>(TEXT("Arrow"));	if (!IsRunningCommandlet())	{		// Structure to hold one-time initialization		struct FConstructorStatics		{			ConstructorHelpers::FObjectFinderOptional<UTexture2D> PlayerStartTextureObject;			FName ID_PlayerStart;			FText NAME_PlayerStart;			FName ID_Navigation;			FText NAME_Navigation;			FConstructorStatics()				: PlayerStartTextureObject(TEXT("/Engine/EditorResources/S_Player"))				, ID_PlayerStart(TEXT("PlayerStart"))				, NAME_PlayerStart(NSLOCTEXT("SpriteCategory", "PlayerStart", "Player Start"))				, ID_Navigation(TEXT("Navigation"))				, NAME_Navigation(NSLOCTEXT("SpriteCategory", "Navigation", "Navigation"))			{			}		};		static FConstructorStatics ConstructorStatics;		if (GetGoodSprite())		{			GetGoodSprite()->Sprite = ConstructorStatics.PlayerStartTextureObject.Get();			GetGoodSprite()->RelativeScale3D = FVector(0.5f, 0.5f, 0.5f);			GetGoodSprite()->SpriteInfo.Category = ConstructorStatics.ID_PlayerStart;			GetGoodSprite()->SpriteInfo.DisplayName = ConstructorStatics.NAME_PlayerStart;		}		if (GetBadSprite())		{			GetBadSprite()->SetVisibility(false);		}		if (ArrowComponent)		{			ArrowComponent->ArrowColor = FColor(150, 200, 255);			ArrowComponent->ArrowSize = 1.0f;			ArrowComponent->bTreatAsASprite = true;			ArrowComponent->SpriteInfo.Category = ConstructorStatics.ID_Navigation;			ArrowComponent->SpriteInfo.DisplayName = ConstructorStatics.NAME_Navigation;			ArrowComponent->SetupAttachment(GetCapsuleComponent());			ArrowComponent->bIsScreenSizeScaled = true;		}	}#endif // WITH_EDITORONLY_DATA	if (GWorld && GWorld->HasBegunPlay())	{		ensure(SpawnTeam != EValorTeam::Invalid);	}}
开发者ID:Shirasho,项目名称:ValorGame,代码行数:60,


示例5: Super

// Sets default valuesASZombieCharacter::ASZombieCharacter(const class FObjectInitializer& ObjectInitializer): Super(ObjectInitializer){	/* Note: We assign the Controller class in the Blueprint extension of this class 		Because the zombie AIController is a blueprint in content and it's better to avoid content references in code.  */	/*AIControllerClass = ASZombieAIController::StaticClass();*/	/* Our sensing component to detect players by visibility and noise checks. */	PawnSensingComp = CreateDefaultSubobject<UPawnSensingComponent>(TEXT("PawnSensingComp"));	PawnSensingComp->SetPeripheralVisionAngle(60.0f);	PawnSensingComp->SightRadius = 2000;	PawnSensingComp->HearingThreshold = 600;	PawnSensingComp->LOSHearingThreshold = 1200;	/* Ignore this channel or it will absorb the trace impacts instead of the skeletal mesh */	GetCapsuleComponent()->SetCollisionResponseToChannel(COLLISION_WEAPON, ECR_Ignore);	GetCapsuleComponent()->SetCapsuleHalfHeight(96.0f, false);	GetCapsuleComponent()->SetCapsuleRadius(42.0f);	/* These values are matched up to the CapsuleComponent above and are used to find navigation paths */	GetMovementComponent()->NavAgentProps.AgentRadius = 42;	GetMovementComponent()->NavAgentProps.AgentHeight = 192;	Health = 100;	PunchDamage = 10.0f;	/* By default we will not let the AI patrol, we can override this value per-instance. */	BotType = EBotBehaviorType::Passive;	SenseTimeOut = 2.5f;	/* Note: Visual Setup is done in the AI/ZombieCharacter Blueprint file */}
开发者ID:9KGameStudio,项目名称:EpicSurvivalGameSeries,代码行数:33,


示例6: GetCapsuleComponent

ALD35Character::ALD35Character(){	// Set size for collision capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// set our turn rates for input	BaseTurnRate = 45.f;	BaseLookUpRate = 45.f;	// Create a CameraComponent		FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera	FirstPersonCameraComponent->bUsePawnControlRotation = true;	static ConstructorHelpers::FObjectFinder<USoundBase> s1(TEXT("/Game/Sound/SeeWereTiger/SeeSoundCue"));	SeeWereTigerSound = s1.Object;	static ConstructorHelpers::FObjectFinder<USoundBase> s2(TEXT("/Game/Sound/SeeEnemy/SeeSoundCue"));	LetsMoveSound = s2.Object;	static ConstructorHelpers::FObjectFinder<USoundBase> s3(TEXT("/Game/Sound/Death/DeathSoundCue"));	DeathSound = s3.Object;	static ConstructorHelpers::FObjectFinder<USoundBase> s4(TEXT("/Game/Sound/Hit/SoundCue"));	HitSound = s4.Object;	static ConstructorHelpers::FObjectFinder<USoundBase> s5(TEXT("/Game/Sound/CrossbowShot/SoundCue"));	ShootCrossbowSound = s5.Object;	static ConstructorHelpers::FObjectFinder<USoundBase> s6(TEXT("/Game/Sound/Transform/SoundCue"));	TransformSound = s6.Object;}
开发者ID:Quadtree,项目名称:LD35,代码行数:33,


示例7: GetMesh

void ACarcinusCharacter::SetHealth(int damage){	Super::SetHealth(damage);	mEnemyHealth = mEnemyHealth - damage;		if (mEnemyHealth <= 0)	{		GetMesh()->SetCollisionProfileName("Ragdoll");		GetMesh()->SetSimulatePhysics(true);				GetWorld()->GetTimerManager().SetTimer(mDeathTimeHandler, this, &ACarcinusCharacter::DisablePhysics, 10.0f, false);				ACharacter* PlayerRef = UGameplayStatics::GetPlayerCharacter(GetWorld(), 0);		FString DeathEvent = "Event_CrabDeath";		AAudioManager::GetInstance()->PlayWwiseEvent(DeathEvent, PlayerRef);		AAudioManager::GetInstance()->SetFearValue(1.0f);		ParticleComponent->Activate(true); 		if (GetCapsuleComponent() != NULL)		{			GetCapsuleComponent()->DestroyComponent();		}		if (HeadCollider != NULL)		{			HeadCollider->DestroyComponent();		}	}	mEnemyHealth = FMath::Clamp(mEnemyHealth, 0, mEnemyMaxHealth);}
开发者ID:AndreaOsorio,项目名称:PSI,代码行数:35,


示例8: GetCapsuleComponent

AAlphaCog01Character::AAlphaCog01Character(){	// Set size for collision capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// set our turn rates for input	BaseTurnRate = 45.f;	BaseLookUpRate = 45.f;	// Create a CameraComponent		FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera	FirstPersonCameraComponent->bUsePawnControlRotation = true;	// Default offset from the character location for projectiles to spawn	GunOffset = FVector(100.0f, 30.0f, 10.0f);	// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)	Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));	Mesh1P->SetOnlyOwnerSee(true);			// only the owning player will see this mesh	Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->RelativeLocation = FVector(0.f, 0.f, -150.f);	Mesh1P->bCastDynamicShadow = false;	Mesh1P->CastShadow = false;	// Note: The ProjectileClass and the skeletal mesh/anim blueprints for Mesh1P are set in the	// derived blueprint asset named MyCharacter (to avoid direct content references in C++)}
开发者ID:mandyRarsh,项目名称:AlphaCog,代码行数:29,


示例9: 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,


示例10: GetCapsuleComponent

ABETCharacter::ABETCharacter(){	// Set size for collision capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// set our turn rates for input	BaseTurnRate = 45.f;	BaseLookUpRate = 45.f;	// Create a CameraComponent		FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera	FirstPersonCameraComponent->bUsePawnControlRotation = true;	// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)	Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));	Mesh1P->SetOnlyOwnerSee(true);	Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->bCastDynamicShadow = false;	Mesh1P->CastShadow = false;	// Create a gun mesh component	FP_Gun = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("FP_Gun"));	FP_Gun->SetOnlyOwnerSee(true);			// only the owning player will see this mesh	FP_Gun->bCastDynamicShadow = false;	FP_Gun->CastShadow = false;	FP_Gun->AttachTo(Mesh1P, TEXT("GripPoint"), EAttachLocation::SnapToTargetIncludingScale, true);	// Note: The ProjectileClass and the skeletal mesh/anim blueprints for Mesh1P are set in the	// derived blueprint asset named MyCharacter (to avoid direct content references in C++)}
开发者ID:brandon2499,项目名称:14BirdsEyeTerrace,代码行数:33,


示例11: GetCapsuleComponent

AFPSHorrorCharacter::AFPSHorrorCharacter(){	//test	Health = MaxHealth;	DecayingRate = 1.5f;	// Set size for collision capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// set our turn rates for input	BaseTurnRate = 45.f;	BaseLookUpRate = 45.f;	// Create a CameraComponent		FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera	FirstPersonCameraComponent->bUsePawnControlRotation = true;	// Scene Color Settings	FirstPersonCameraComponent->PostProcessSettings.bOverride_SceneColorTint = true;	FirstPersonCameraComponent->PostProcessSettings.bOverride_VignetteIntensity = true;	FirstPersonCameraComponent->PostProcessSettings.bOverride_GrainIntensity = true;	FirstPersonCameraComponent->PostProcessSettings.bOverride_ColorContrast = true;	FirstPersonCameraComponent->PostProcessSettings.bOverride_ColorGamma = true;	FirstPersonCameraComponent->PostProcessSettings.bOverride_ColorGain = true;	FirstPersonCameraComponent->PostProcessSettings.SceneColorTint = FLinearColor(.5f, .5f, .5f, 1.0f);	FirstPersonCameraComponent->PostProcessSettings.VignetteIntensity = 0.0f;	FirstPersonCameraComponent->PostProcessSettings.GrainIntensity = .15f;	// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)	Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));	Mesh1P->SetOnlyOwnerSee(true);	Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->bCastDynamicShadow = false;	Mesh1P->CastShadow = false;	// Create a Sowrd mesh component	FP_Sword = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("FP_Sword"));	FP_Sword->SetOnlyOwnerSee(true);			// only the owning player will see this mesh	FP_Sword->bCastDynamicShadow = false;	FP_Sword->CastShadow = false;	FP_Sword->AttachTo(Mesh1P, TEXT("Sword"), EAttachLocation::SnapToTargetIncludingScale, true);	// Create a Hammer mesh component	FP_Hammer = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("FP_Hammer"));	FP_Hammer->SetOnlyOwnerSee(true);			// only the owning player will see this mesh	FP_Hammer->bCastDynamicShadow = false;	FP_Hammer->CastShadow = false;	FP_Hammer->AttachTo(Mesh1P, TEXT("Hammer"), EAttachLocation::SnapToTargetIncludingScale, true);	// Default offset from the character location for projectiles to spawn	GunOffset = FVector(100.0f, 30.0f, 10.0f);	// Note: The ProjectileClass and the skeletal mesh/anim blueprints for Mesh1P are set in the	// derived blueprint asset named MyCharacter (to avoid direct content references in C++)}
开发者ID:Rish79,项目名称:FPS-Horror,代码行数:59,


示例12: Super

// Sets default valuesAMainCharacter::AMainCharacter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer){ 	// 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;	bCanBeDamaged = true;	bFireIsReady = true;	CurrentWeapon = NULL;	Inventory.SetNum(3, false);	Inventory[0] = NULL;	Inventory[1] = NULL;	Inventory[2] = NULL;	WeaponAmmoStorage.SetNum(3, false);	WeaponAmmoStorage[0].CurrentSpareAmmo = -1;	WeaponAmmoStorage[1].CurrentSpareAmmo = -1;	WeaponAmmoStorage[2].CurrentSpareAmmo = -1;	WeaponAmmoStorage[0].CurrentMagazineAmmo = -1;	WeaponAmmoStorage[1].CurrentMagazineAmmo = -1;	WeaponAmmoStorage[2].CurrentMagazineAmmo = -1;	//WeaponSpawn = NULL;	GetCharacterMovement()->GetNavAgentPropertiesRef().bCanCrouch = true;	GetCharacterMovement()->bCanWalkOffLedgesWhenCrouching = true;	GetCharacterMovement()->MaxAcceleration = 1400.0f;	GetCharacterMovement()->BrakingDecelerationWalking = 0.0f;	RootComponent = GetCapsuleComponent();	FirstPersonCameraComponent = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, BaseEyeHeight);	FirstPersonCameraComponent->bUsePawnControlRotation = true;	GetMesh()->SetOwnerNoSee(true);	FirstPersonMesh = ObjectInitializer.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("FirstPersonMesh"));	FirstPersonMesh->SetOnlyOwnerSee(true);         // only the owning player will see this mesh	FirstPersonMesh->AttachParent = FirstPersonCameraComponent;	FirstPersonMesh->bCastDynamicShadow = false;	FirstPersonMesh->CastShadow = false;	Flashlight = ObjectInitializer.CreateDefaultSubobject<USpotLightComponent>(this, TEXT("Flashlight"));	Flashlight->AttachParent = FirstPersonCameraComponent;	GetCapsuleComponent()->OnComponentBeginOverlap.AddDynamic(this, &AMainCharacter::OnCollision);	/*	static ConstructorHelpers::FObjectFinder<UBlueprint> WeaponBlueprint(TEXT("Blueprint'/Game/FPS/Blueprints/Weapons/BP_Weapon_M4A1.BP_Weapon_M4A1'"));	if (WeaponBlueprint.Succeeded())	{		WeaponSpawn = (UClass*)WeaponBlueprint.Object->GeneratedClass;	}	*/}
开发者ID:rcktscnc,项目名称:unreal-project,代码行数:54,


示例13: 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,


示例14: Super

ARealmEnablerShield::ARealmEnablerShield(const FObjectInitializer& objectInitializer): Super(objectInitializer){	GetCapsuleComponent()->SetCollisionResponseToAllChannels(ECR_Ignore);	GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_WorldStatic, ECR_Block);	shieldCollision = CreateDefaultSubobject<USphereComponent>(TEXT("shieldCollision"));	shieldCollision->InitSphereRadius(1150.f);	shieldCollision->AttachParent = RootComponent;	shieldCollision->SetCollisionResponseToAllChannels(ECR_Ignore);	shieldCollision->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);	shieldCollision->OnComponentBeginOverlap.AddDynamic(this, &ARealmEnablerShield::OnShieldBeginOverlap);	shieldCollision->OnComponentEndOverlap.AddDynamic(this, &ARealmEnablerShield::OnShieldEndOverlap);}
开发者ID:MatrIsCool,项目名称:Mythos-Realm,代码行数:14,


示例15: GetCapsuleComponent

AInventoryPrototypeCharacter::AInventoryPrototypeCharacter(){    //PrimaryActorTick.bCanEverTick = true;	// Set size for collision capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// set our turn rates for input	BaseTurnRate = 45.f;	BaseLookUpRate = 45.f;	// Create a CameraComponent		FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera	FirstPersonCameraComponent->bUsePawnControlRotation = true;	// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)	Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));	Mesh1P->SetOnlyOwnerSee(true);	Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->bCastDynamicShadow = false;	Mesh1P->CastShadow = false;	// Create a gun mesh component	FP_Gun = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("FP_Gun"));	FP_Gun->SetOnlyOwnerSee(true);			// only the owning player will see this mesh	FP_Gun->bCastDynamicShadow = false;	FP_Gun->CastShadow = false;	FP_Gun->AttachTo(Mesh1P, TEXT("GripPoint"), EAttachLocation::SnapToTargetIncludingScale, true);	// Default offset from the character location for projectiles to spawn	GunOffset = FVector(100.0f, 30.0f, 10.0f);	// Note: The ProjectileClass and the skeletal mesh/anim blueprints for Mesh1P are set in the	// derived blueprint asset named MyCharacter (to avoid direct content references in C++)    //stamina and movement    this->stamina = 500;    this->maxStamina = 1000;    this->staminaRate = 1;    this->isRunning = true;    //inventory and items    this->inventory = new Inventory(150);    this->testItem = new Item(0, "ITEM", 5);    this->testItem1 = new Item(1, "myItem", 10);}
开发者ID:drakemain,项目名称:UE4_Prototypes,代码行数:49,


示例16: Super

AFPSGCharacter::AFPSGCharacter()	: Super(){	bReplicates = true; 	// 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;	GetCapsuleComponent()->bGenerateOverlapEvents = true;	//Initialize the first person camera component	firstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FPSGFirstPersonCamera"));	firstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FVector characterViewLocation;	FRotator characterViewRotation;	GetActorEyesViewPoint(characterViewLocation, characterViewRotation);	//Position the camera and use the view rotation of the pawn that we get from input	firstPersonCameraComponent->RelativeLocation = characterViewLocation;	firstPersonCameraComponent->RelativeRotation = characterViewRotation;	firstPersonCameraComponent->bUsePawnControlRotation = true;	//Initialize the first person mesh component	firstPersonMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("FPSGFirstPersonMesh"));	firstPersonMesh->SetOnlyOwnerSee(true);	firstPersonMesh->AttachParent = firstPersonCameraComponent;	firstPersonMesh->bCastDynamicShadow = false;	firstPersonMesh->CastShadow = false;	//The regular body mesh should not be visible to the player	GetMesh()->SetOwnerNoSee(true);	movementDirection = EMoveDirection::NONE;	maxHealth = 100.0f;	currentHealth = 100.0f;	currentWeapon = NULL;	isFiring = false;	isFalling = false;	amountOfGrenades = 0;	maxGrenades = 0;	deathAnimation = NULL;	inventoryWeaponSocket = "";	boneHead = "";	//Reserve memory for at least 10 elements (weapons)	weaponInventory.Reserve(10);	dieCallback = false;}
开发者ID:Gardern,项目名称:FPSGame_code,代码行数:48,


示例17: GetCharacterMovement

void ADA2UE4Creature::InitSkeletalMeshComponent(TWeakObjectPtr<class USkeletalMeshComponent> SMeshPointer, bool AttachToParent){	SMeshPointer->AlwaysLoadOnClient = true;	SMeshPointer->AlwaysLoadOnServer = true;	SMeshPointer->bOwnerNoSee = false;	SMeshPointer->MeshComponentUpdateFlag = EMeshComponentUpdateFlag::AlwaysTickPose;	SMeshPointer->bCastDynamicShadow = true;	SMeshPointer->bAffectDynamicIndirectLighting = true;	SMeshPointer->PrimaryComponentTick.TickGroup = TG_PrePhysics;	// force tick after movement component updates	if (GetCharacterMovement())	{		SMeshPointer->PrimaryComponentTick.AddPrerequisite(this, GetCharacterMovement()->PrimaryComponentTick);	}	//SMeshPointer->AttachParent = GetCapsuleComponent();	SMeshPointer->SetupAttachment(GetCapsuleComponent());	static FName CollisionProfileName(TEXT("CharacterMesh"));	SMeshPointer->SetCollisionObjectType(ECC_Pawn);	SMeshPointer->SetCollisionProfileName(CollisionProfileName);	SMeshPointer->bGenerateOverlapEvents = false;	// Mesh acts as the head, as well as the parent for both animation and attachment.	if (AttachToParent)	{		//SMeshPointer->AttachParent = MeshHEDComponent;		SMeshPointer->SetupAttachment(MeshHEDComponent);		SMeshPointer->SetMasterPoseComponent(MeshHEDComponent);		SMeshPointer->bUseBoundsFromMasterPoseComponent = true;	}}
开发者ID:dhk-room101,项目名称:da2ue4,代码行数:31,


示例18: GetCapsuleComponent

// Sets default valuesABaseCharacter::ABaseCharacter(){ 	// 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;	GetCapsuleComponent()->InitCapsuleSize(42.0f, 96.0f);		//Create and set SpringArm component as our RootComponent	CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));	CameraBoom->SetupAttachment(RootComponent);	CameraBoom->TargetArmLength = 0.0f;	CameraBoom->bUsePawnControlRotation = true;	//Create a Camera Component and attach it to our SpringArm Component "CameraSpringArm"	Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));	Camera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName);	Camera->bUsePawnControlRotation = false;	//Create a skeletalMesh for holding weapon and attach it to the character mesh	WeaponMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("WeaponMesh"));	WeaponMesh->SetupAttachment(GetMesh());	FirstPersonViewMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("FirstPersonViewMesh"));	FirstPersonViewMesh->SetupAttachment(Camera);	//Initialize default values	ADSBlendInterpSpeed = 10.0f;	CameraFOV = 120.0f;	ADSCameraFOV = 90.0f;	SprintSpeed = 600.0f;	bAlwaysADS = false;	bIsInFirstPersonView = true;}
开发者ID:TheComet93,项目名称:iceweasel,代码行数:36,


示例19: ActiveModeIndex

// Sets default valuesAGhost::AGhost() : ActiveModeIndex(0){	// Set this pawn to call Tick() every frame.  You can turn this off to improve performance if you don't need it.	PrimaryActorTick.bCanEverTick = false;	auto Capsule = GetCapsuleComponent();	Capsule->SetCollisionObjectType(ECC_GHOST);	Capsule->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Block);	Capsule->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);	Capsule->SetCollisionResponseToChannel(ECC_PICKUP, ECollisionResponse::ECR_Ignore);	PathFollowingComponent = CreateDefaultSubobject<UPacmanPathFollowingComponent>("PathFollowingComponent");	int32 NumModes = FMath::RandRange(2, 10);	Modes.SetNum(NumModes);	for (int32 i = 0; i < NumModes; ++i)	{		Modes[i].Duration = FMath::FRandRange(5.f, 20.f);		Modes[i].GhostState = static_cast<EGhostState>(i % 2);	}	// Last state must be chased	Modes.Last().GhostState = EGhostState::Chase;	Modes.Last().Duration = 0.f;}
开发者ID:Xperience8,项目名称:Pacman,代码行数:27,


示例20: 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,


示例21: GetCapsuleComponent

AFrisbeeNulCharacter::AFrisbeeNulCharacter(){	// 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 = true; // Rotate character to moving direction	GetCharacterMovement()->RotationRate = FRotator(0.f, 640.f, 0.f);	GetCharacterMovement()->bConstrainToPlane = true;	GetCharacterMovement()->bSnapToPlaneAtStart = true;	GetCharacterMovement()->MaxWalkSpeed = 1000;	// Create a camera boom...	CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));	CameraBoom->AttachTo(RootComponent);	CameraBoom->bAbsoluteRotation = true; // Don't want arm to rotate when character does	CameraBoom->TargetArmLength = 800.f;	CameraBoom->RelativeRotation = FRotator(-60.f, 0.f, 0.f);	CameraBoom->bDoCollisionTest = false; // Don't want to pull camera in when it collides with level	// Create a camera...	TopDownCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("TopDownCamera"));	TopDownCameraComponent->AttachTo(CameraBoom, USpringArmComponent::SocketName);	TopDownCameraComponent->bUsePawnControlRotation = false; // Camera does not rotate relative to arm}
开发者ID:Wincked,项目名称:FrisbeeNul,代码行数:31,


示例22: Super

AMutagenPlayer::AMutagenPlayer(const FObjectInitializer& ObjectInitializer)	: Super(ObjectInitializer){	// 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 = ObjectInitializer.CreateDefaultSubobject<USpringArmComponent>(this, 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 = 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}
开发者ID:belven,项目名称:Mutagen,代码行数:32,


示例23: GetMesh

float ALD35Character::TakeDamage(float DamageAmount, FDamageEvent const & DamageEvent, AController * EventInstigator, AActor * DamageCauser){	UGameplayStatics::PlaySoundAtLocation(this, HitSound, this->GetActorLocation());	float dmg = Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);	Health -= dmg;	if (Health <= 0)	{		GetMesh()->SetSimulatePhysics(true);		GetMesh()->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);		GetCapsuleComponent()->SetCollisionEnabled(ECollisionEnabled::NoCollision);		GetMovementComponent()->SetActive(false);		UGameplayStatics::PlaySoundAtLocation(this, DeathSound, this->GetActorLocation());		if (EventInstigator)		{			if (auto a = Cast<ALD35Character>(EventInstigator->GetPawn()))			{				if (a->Faction == Faction)				{					UE_LOG(LogTemp, Display, TEXT("Teamkilling detected!"));					a->Faction = FMath::Rand();				}			}		}	}	return dmg;}
开发者ID:Quadtree,项目名称:LD35,代码行数:32,


示例24: Super

ATut2Character::ATut2Character(const FObjectInitializer& ObjectInitializer)	: Super(ObjectInitializer){	// 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	// 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:KimBerOK,项目名称:UnrealNetTut2,代码行数:35,


示例25: PlayHit

void ABaseCharacter::OnDeath(float KillingDamage, FDamageEvent const& DamageEvent, APawn* PawnInstigator, AActor* DamageCauser){	bReplicateMovement = false;	bTearOff = true;	PlayHit(true, KillingDamage, DamageEvent, PawnInstigator, DamageCauser);	DetachFromControllerPendingDestroy();	/* Disable all collision on capsule */	UCapsuleComponent* CapsuleComp = GetCapsuleComponent();	CapsuleComp->SetCollisionEnabled(ECollisionEnabled::NoCollision);	CapsuleComp->SetCollisionResponseToAllChannels(ECR_Ignore);	if(bRagdolledAfterDeath)	{		SetRagdollPhysics();		ApplyPhysicsToTheRagdolledBody(DamageEvent);	}	else	{		SetLifeSpan(TimeAfterDeathBeforeDestroy);	}}
开发者ID:1992please,项目名称:Unreal_ShooterGame,代码行数:26,


示例26: Super

ASECharacter::ASECharacter() : Super(){   // Set size for collision capsule   GetCapsuleComponent()->InitCapsuleSize(5.421325f, 44.f);   // Set our turn rates for input   BaseTurnRate = 45.f;   BaseLookUpRate = 45.f;   auto movement = CastChecked<UCharacterMovementComponent>(GetMovementComponent());   movement->MaxWalkSpeed = 100.f;   // Create a CameraComponent   CameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));   CameraComponent->AttachToComponent(GetCapsuleComponent(), FAttachmentTransformRules::KeepWorldTransform);   CameraComponent->RelativeLocation = FVector(0.f, 0.f, GetCapsuleComponent()->GetUnscaledCapsuleHalfHeight()); // Position the camera   CameraComponent->bUsePawnControlRotation = true;}
开发者ID:starryexpanse,项目名称:StarryExpanse,代码行数:17,


示例27: Super

ARadeCharacter::ARadeCharacter(const class FObjectInitializer& PCIP) 	: Super(PCIP){		// Set size for collision capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// Create a CameraComponent		FirstPersonCameraComponent = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera	// Create a camera boom (pulls in towards the player if there is a collision)	ThirdPersonCameraBoom = PCIP.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("CameraBoom"));	ThirdPersonCameraBoom->AttachTo(RootComponent);	ThirdPersonCameraBoom->TargetArmLength = 150;		ThirdPersonCameraBoom->RelativeLocation = FVector(0,50,100);	ThirdPersonCameraBoom->bUsePawnControlRotation = true; 	// Create a follow camera	ThirdPersonCameraComponent = PCIP.CreateDefaultSubobject<UCameraComponent>(this, TEXT("PlayerCamera"));	ThirdPersonCameraComponent->AttachTo(ThirdPersonCameraBoom, USpringArmComponent::SocketName);	// Set First Person Mesh	Mesh1P = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("CharacterMesh1P"));	Mesh1P->SetOnlyOwnerSee(true);			Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->RelativeLocation = FVector(0.f, 0.f, -150.f);	Mesh1P->bCastDynamicShadow = false;	Mesh1P->CastShadow = false;	Mesh1P->bOnlyOwnerSee = true;	Mesh1P->SetIsReplicated(true);	// Set Third Person Mesh	GetMesh()->SetOwnerNoSee(true);	GetMesh()->AttachParent = RootComponent;	GetMesh()->bCastDynamicShadow = true;	GetMesh()->CastShadow = true;	GetMesh()->bOwnerNoSee = true;	GetMesh()->SetIsReplicated(true);}
开发者ID:dcyoung,项目名称:Rade,代码行数:46,


示例28: GetCapsuleComponent

ABETCharacter::ABETCharacter(){	// Set size for collision capsule	GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f);	// set our turn rates for input	BaseTurnRate = 45.f;	BaseLookUpRate = 45.f;	// Create a CameraComponent		FirstPersonCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("FirstPersonCamera"));	FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();	FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 64.f); // Position the camera	FirstPersonCameraComponent->bUsePawnControlRotation = true;		// Create a mesh component that will be used when being viewed from a '1st person' view (when controlling this pawn)	Mesh1P = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("CharacterMesh1P"));	Mesh1P->SetOnlyOwnerSee(true);//	Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->AttachParent = FirstPersonCameraComponent;	Mesh1P->bCastDynamicShadow = false;	Mesh1P->CastShadow = false;	// Note: The ProjectileClass and the skeletal mesh/anim blueprints for Mesh1P are set in the	// derived blueprint asset named MyCharacter (to avoid direct content references in C++)	lightIntensity = 15000.f;	flashLight = CreateDefaultSubobject<USpotLightComponent>(TEXT("Flashlight"));	flashLight->SetIntensity(lightIntensity);	flashLight->SetAttenuationRadius(2000.0f);	flashLight->bVisible = true;	flashLight->AttachParent = FirstPersonCameraComponent;	walkSpeed = 300;	runSpeed = 600;	MAXSTAMINA = 10;	widgetChecker = 0;	stamina = MAXSTAMINA;	running = false;	power = true;	Key = false;	canLeave = false;}
开发者ID:Bearlol,项目名称:BirdsEyeTerrace,代码行数:45,


示例29: BehaviorTree_obj

// Sets default valuesACarcinusCharacter::ACarcinusCharacter(){	// 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;		static ConstructorHelpers::FObjectFinder<UBehaviorTree> BehaviorTree_obj(TEXT("BehaviorTree'/Game/AI/CarcinusCrab/BT_Carcinus.BT_Carcinus'"));	if (BehaviorTree_obj.Object) {		BehaviorTree = BehaviorTree_obj.Object;	}		/*Assign Carcinus Mesh*/	static ConstructorHelpers::FObjectFinder<USkeletalMesh> SkeletalMesh_body(TEXT("SkeletalMesh'/Game/Art/CarcinusCrab/CarcinusCrab.CarcinusCrab'"));	if (SkeletalMesh_body.Object){		GetMesh()->SetSkeletalMesh(SkeletalMesh_body.Object);		GetMesh()->SetRelativeLocation(FVector(-80.0f, 0.0f, -100.0), false);		GetMesh()->SetRelativeRotation(FRotator(0.0f, -90.0f, 0.0f),false);		GetMesh()->SetRenderCustomDepth(true);		GetMesh()->CustomDepthStencilValue = 0;		GetCapsuleComponent()->InitCapsuleSize(60.0f, 100.0f);	}	ParticleComponent = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("ParticleSystemComp"));	static ConstructorHelpers::FObjectFinder<UParticleSystem> ParticleObj(TEXT("ParticleSystem'/Game/Art/ParticleSystem/Blood/PAR_BloodCloud.PAR_BloodCloud'"));	if (ParticleObj.Object)	{		ParticleComponent->Template = ParticleObj.Object;		ParticleComponent->AttachTo(RootComponent);	}	HeadCollider = CreateDefaultSubobject<USphereComponent>(TEXT("HeadCollider"));	HeadCollider->AttachTo(GetMesh(), TEXT("HeadSocket"), EAttachLocation::SnapToTarget, true);	HeadCollider->SetCollisionProfileName(TEXT("Pawn"));	HeadCollider->InitSphereRadius(4.0f);	HeadCollider->bDynamicObstacle = 1;	HeadCollider->CanCharacterStepUpOn = ECanBeCharacterBase::ECB_No;	/* Range Collider Initialization */	RangeCollider = CreateDefaultSubobject<USphereComponent>(TEXT("RangeSphereCollider"));	RangeCollider->InitSphereRadius(1000.0f);	RangeCollider->AttachTo(RootComponent);	RangeCollider->SetCollisionProfileName(TEXT("Spectator"));	RangeCollider->SetVisibility(true);	RangeCollider->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);	/*Assign the Carcinus Animation Blueprint*/	static ConstructorHelpers::FObjectFinder<UAnimBlueprint> AnimBP_obj(TEXT("AnimBlueprint'/Game/Art/CarcinusCrab/Animations/CarcinusCrab_AnimBP.CarcinusCrab_AnimBP'"));	if (AnimBP_obj.Object) {		GetMesh()->SetAnimInstanceClass(AnimBP_obj.Object->GeneratedClass);	}	GetCharacterMovement()->MaxWalkSpeed = 200.0f;	GetCharacterMovement()->MaxAcceleration = 500.0f;	mEnemyMaxHealth = mEnemyHealth = 3;	 }
开发者ID:AndreaOsorio,项目名称:PSI,代码行数:58,



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


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