本文整理汇总了C++中GetMesh函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMesh函数的具体用法?C++ GetMesh怎么用?C++ GetMesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMesh函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: GameObject
Rock::Rock(D3DCOLORVALUE color, const btVector3 &startPos) :
GameObject(
new btCylinderShape(btVector3(1.5, 1, 1)),
10,
startPos,
btQuaternion((90), (0), (1), (0))
)
{
D3DCOLORVALUE ambColor;
ambColor.r = color.r * 0.3;
ambColor.g = color.g * 0.3;
ambColor.b = color.b * 0.3;
ambColor.a = 0;
D3DCOLORVALUE diffColor;
diffColor.r = color.r*1;
diffColor.g = color.g*1;
diffColor.b = color.b*1;
diffColor.a = 0;
CreateMeshFromShape();
GetMesh()->SetColour(diffColor, Advanced2D::Mesh::MT_DIFFUSE);
GetMesh()->SetColour(ambColor,Advanced2D::Mesh::MT_AMBIENT);
GetMesh()->SetRotation(0, 90, 0);
//GetRigidBody()->setWorldTransform(btTransform(
}
示例3: GetMesh
// Player Died, Called on all users
void ARadeCharacter::GlobalDeath_Implementation()
{
// save third person mesh Relative Location and rotation before ragdoll
if (GetMesh())
{
Mesh_InGameRelativeLoc = GetMesh()->RelativeLocation;
Mesh_InGameRelativeRot = GetMesh()->RelativeRotation;
}
// Disable player input
DisableInput(Cast<APlayerController>(Controller));
// If Player can revive, revive hit after a delay
if (bCanRevive)
{
FTimerHandle MyHandle;
GetWorldTimerManager().SetTimer(MyHandle, this, &ARadeCharacter::Revive, ReviveTime, false);
}
// Event and Ragdoll
Super::GlobalDeath_Implementation();
// Update Visibility
UpdateComponentsVisibility();
// Call on Blueprint
BP_PlayerDied();
}
示例4: 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;
}
示例5: GetMesh
float *EditPolyData::GetSoftSelection (TimeValue t,
float falloff, float pinch, float bubble, int edist,
bool ignoreBackfacing, Interval & edistValid) {
if (!GetMesh()) return NULL;
if (GetMesh()->numv == 0) return NULL;
if (!mpTemp) mpTemp = new MNTempData();
mpTemp->SetMesh (GetMesh());
int nv = GetMesh()->numv;
mpTemp->InvalidateSoftSelection (); // have to do, or it might remember last time's falloff, etc.
if (!mVertexDistanceValidity.InInterval (t)) {
mpTemp->InvalidateDistances ();
mVertexDistanceValidity = mGeomValid;
mVertexDistanceValidity &= mTopoValid;
mVertexDistanceValidity &= edistValid;
}
// Question: Should we be using MN_SEL here, or MN_EDITPOLY_OP_SELECT based on our selection BitArrays?
// Answer: As of this writing, this method is only called from EditPolyMod::ModifyObject,
// where the MN_SEL flags are set to the appropriate selection, or from the Display code, which is based
// on the cache set in ModifyObject. So I think we're fine.
return mpTemp->VSWeight (edist, edist, ignoreBackfacing,
falloff, pinch, bubble, MN_SEL)->Addr(0);
}
示例6: GetMesh
BOOL
TriObject::PolygonCount(TimeValue t, int& numFaces, int& numVerts)
{
numFaces = GetMesh().getNumFaces();
numVerts = GetMesh().getNumVerts();
return TRUE;
}
示例7: serverEquipWeapon_Implementation
void AFPSGCharacter::serverEquipWeapon_Implementation(int32 in_currentWeaponIndex)
{
if (weaponInventory[in_currentWeaponIndex] != NULL)
{
//Detach previous weapon
if (currentWeapon != NULL)
{
//If previous weapon is attached to firstPersonMesh, then detach it and attach it to the inventory socket
if (currentWeapon->IsAttachedTo(firstPersonMesh->GetOwner()))
{
currentWeapon->DetachRootComponentFromParent(true);
currentWeapon->AttachRootComponentTo(GetMesh(), inventoryWeaponSocket, EAttachLocation::SnapToTarget);
currentWeapon->SetActorHiddenInGame(true);
}
}
//Retrieve the new weapon from the inventory
currentWeapon = weaponInventory[in_currentWeaponIndex];
//Attach the new weapon
if (currentWeapon != NULL)
{
//If current weapon is attached to the inventory socket, detach it and then attach it to the equipped weapon socket
if (currentWeapon->IsAttachedTo(GetMesh()->GetOwner()))
{
currentWeapon->DetachRootComponentFromParent(true);
currentWeapon->AttachRootComponentTo(firstPersonMesh, currentWeapon->getEquipAtSocket(), EAttachLocation::SnapToTarget);
currentWeapon->SetActorHiddenInGame(false);
}
}
}
}
示例8: GetMaxHealth
void ANimModCharacter::PostInitializeComponents()
{
Super::PostInitializeComponents();
if (Role == ROLE_Authority)
{
Health = GetMaxHealth();
SpawnDefaultInventory();
}
// set initial mesh visibility (3rd person view)
UpdatePawnMeshes();
// create material instance for setting team colors (3rd person view)
for (int32 iMat = 0; iMat < GetMesh()->GetNumMaterials(); iMat++)
{
MeshMIDs.Add(GetMesh()->CreateAndSetMaterialInstanceDynamic(iMat));
}
// play respawn effects
if (GetNetMode() != NM_DedicatedServer)
{
if (RespawnFX)
{
UGameplayStatics::SpawnEmitterAtLocation(this, RespawnFX, GetActorLocation(), GetActorRotation());
}
if (RespawnSound)
{
UGameplayStatics::PlaySoundAtLocation(this, RespawnSound, GetActorLocation());
}
}
}
示例9: GetMesh
void ABaseCharacter::SetCameraView(bool bFirstPerson)
{
if (bFirstPerson)
{
GetMesh()->SetOwnerNoSee(true);
FirstPersonViewMesh->SetOnlyOwnerSee(true);
FirstPersonViewMesh->SetOwnerNoSee(false);
WeaponMesh->SetOnlyOwnerSee(false);
WeaponMesh->SetOwnerNoSee(false);
CameraBoom->TargetArmLength = 0.0f;
bIsInFirstPersonView = true;
}
else
{
GetMesh()->SetOwnerNoSee(false);
FirstPersonViewMesh->SetOnlyOwnerSee(false);
FirstPersonViewMesh->SetOwnerNoSee(true);
WeaponMesh->SetOnlyOwnerSee(false);
WeaponMesh->SetOwnerNoSee(true);
CameraBoom->TargetArmLength = 300.0f;
bIsInFirstPersonView = false;
}
}
示例10: GetPosition
void ClothEntity_cl::InitFunction()
{
m_vCurrentPos = GetPosition();
m_vCurrentOri = GetOrientation();
BaseInit();
if (!GetMesh())
return;
const char *szModel = GetMesh()->GetFilename();
SetMeshModel(szModel,m_vCurrentScaling);
}
示例11: IsFirstPerson
void ANimModCharacter::UpdatePawnMeshes()
{
bool const bFirstPerson = IsFirstPerson();
if (Mesh1P != nullptr)
{
Mesh1P->MeshComponentUpdateFlag = !bFirstPerson ? EMeshComponentUpdateFlag::OnlyTickPoseWhenRendered : EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;
Mesh1P->SetOwnerNoSee(!bFirstPerson);
}
GetMesh()->MeshComponentUpdateFlag = bFirstPerson ? EMeshComponentUpdateFlag::OnlyTickPoseWhenRendered : EMeshComponentUpdateFlag::AlwaysTickPoseAndRefreshBones;
GetMesh()->SetOwnerNoSee(bFirstPerson);
}
示例12: assert
void GeometryInstanceIterator::StepNext()
{
assert(IsValid());
++m_batchIdx;
if( m_batchIdx >= GetMesh()->GetBatchCount() )
{
m_batchIdx = 0;
m_currentMesh = NULL;
do
{
++m_instIdx; // skip empty meshes
} while( IsValid() && GetMesh()->GetBatchCount() == 0 );
}
}
示例13: OnConstruction
void AARCharacter::OnConstruction(const FTransform& Transform)
{
Head->SetMasterPoseComponent(GetMesh());
Head->UpdateMasterBoneMap();
Shoulders->SetMasterPoseComponent(GetMesh());
Shoulders->UpdateMasterBoneMap();
Arms->SetMasterPoseComponent(GetMesh());
Arms->UpdateMasterBoneMap();
Hands->SetMasterPoseComponent(GetMesh());
Hands->UpdateMasterBoneMap();
Torso->SetMasterPoseComponent(GetMesh());
Torso->UpdateMasterBoneMap();
Legs->SetMasterPoseComponent(GetMesh());
Legs->UpdateMasterBoneMap();
Feets->SetMasterPoseComponent(GetMesh());
Feets->UpdateMasterBoneMap();
Backpack->SetMasterPoseComponent(GetMesh());
Backpack->UpdateMasterBoneMap();
}
示例14: GetWorld
void AMonster::PostInitializeComponents()
{
Super::PostInitializeComponents();
// instantiate the melee weapon if a bp was selected
if (BPMeleeWeapon)
{
MeleeWeapon = GetWorld()->SpawnActor<AMeleeWeapon>(BPMeleeWeapon, FVector(), FRotator());
if (MeleeWeapon)
{
const USkeletalMeshSocket *meshSocket = (USkeletalMeshSocket*)GetMesh()->GetSocketByName("RightHandSocket"); // be sure to use correct
// socket name!
meshSocket->AttachActor(MeleeWeapon, GetMesh());
}
}
}
示例15: SetCastShadows
// **************************************************
// OVERRIDDEN ENTITY FUNCTIONS
// **************************************************
void TransitionBarbarian_cl::InitFunction()
{
if (!HasMesh())
return;
SetCastShadows(TRUE);
// Setup all animation sequences
SetupAnimations();
if (!m_bModelValid)
return;
if( !m_pPhys)
{
m_pPhys = new vHavokCharacterController();
m_pPhys->Initialize();
hkvAlignedBBox bbox;
VDynamicMesh *pMesh = GetMesh();
pMesh->GetCollisionBoundingBox(bbox);
float r = bbox.getSizeX() * 0.5f;
m_pPhys->Capsule_Radius = r;
m_pPhys->Character_Top.set(0,0,bbox.m_vMax.z - r);
m_pPhys->Character_Bottom.set(0,0,bbox.m_vMin.z + r);
m_pPhys->Max_Slope = 75.0f;
AddComponent(m_pPhys);
// pPhys->SetDebugRendering(TRUE);
}
// Get Model
VDynamicMesh* pModel = GetMesh();
VASSERT(pModel);
// Transition table to use
VTransitionTable *pTable = VTransitionManager::GlobalManager().LoadTransitionTable(pModel,"Barbarian.vTransition");
VASSERT(pTable && pTable->IsLoaded());
// Setup the state machine component and pass the filename of the transition file
// in which the transitions between the various animation states are defined.
m_pStateMachine = new VTransitionStateMachine();
m_pStateMachine->Init(this, pTable);
AddComponent(m_pStateMachine);
// Set initial state
m_pStateMachine->SetState(m_pSkeletalSequenceList[ANIMID_IDLE]);
}