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

C++ GetMesh函数代码示例

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

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



在下文中一共展示了GetMesh函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:AndreaOsorio,项目名称:PSI,代码行数:35,代码来源:CarcinusCharacter.cpp


示例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(
}
开发者ID:Guy-Sensei,项目名称:ShuffleBoard,代码行数:26,代码来源:Rock.cpp


示例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();
}
开发者ID:dcyoung,项目名称:Rade,代码行数:29,代码来源:RadeCharacter.cpp


示例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;
}
开发者ID:Quadtree,项目名称:LD35,代码行数:32,代码来源:LD35Character.cpp


示例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);
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:25,代码来源:EditPolyData.cpp


示例6: GetMesh

BOOL 
TriObject::PolygonCount(TimeValue t, int& numFaces, int& numVerts) 
{
    numFaces = GetMesh().getNumFaces();
    numVerts = GetMesh().getNumVerts();
    return TRUE;
}
开发者ID:artemeliy,项目名称:inf4715,代码行数:7,代码来源:triobj.cpp


示例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);
			}
		}
	}
}
开发者ID:Gardern,项目名称:FPSGame_code,代码行数:32,代码来源:FPSGCharacter.cpp


示例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());
		}
	}
}
开发者ID:Nimgoble,项目名称:NimMod,代码行数:33,代码来源:NimModCharacter.cpp


示例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;
	}
}
开发者ID:TheComet93,项目名称:iceweasel,代码行数:30,代码来源:BaseCharacter.cpp


示例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);
}
开发者ID:Alagong,项目名称:projectanarchy,代码行数:10,代码来源:_ClothEntity.cpp


示例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);
}
开发者ID:Nimgoble,项目名称:NimMod,代码行数:12,代码来源:NimModCharacter.cpp


示例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 );
	}
}
开发者ID:ChiahungTai,项目名称:OpenCL-playgorund,代码行数:14,代码来源:SceneUtils.cpp


示例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();
}
开发者ID:iniside,项目名称:ActionRPGGame,代码行数:26,代码来源:ARCharacter.cpp


示例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());
		}
	}
}
开发者ID:damorton,项目名称:raider,代码行数:15,代码来源:Monster.cpp


示例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]);
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:51,代码来源:TransitionBarbarian.cpp


示例16: GetMesh

void XTCSample::DeleteFaces(TimeValue t,Object *obj)
{
	if(bNF_OnOff)
	{
		Mesh *mesh = GetMesh(obj);
		
		if(!mesh)
			return;
		
		Interval ivalid = FOREVER;
		int nf;
		bo->GetParamBlockByID(x_params)->GetValue(pb_nf_spin,t,nf, ivalid);
		BitArray ba;
		ba.SetSize(mesh->getNumFaces());
		ba.ClearAll();
		
		for(int i = nf ; i < mesh->getNumFaces() ; i++ )
		{
			ba.Set(i);
		}
		
		if(!ba.IsEmpty())
			mesh->DeleteFaceSet(ba);
	}
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:25,代码来源:xmodifier.cpp


示例17: DbgAssert

int XTCSample::Display(TimeValue t, INode* inode, ViewExp *vpt, int flags, Object *pObj)
{
	if ( ! vpt || ! vpt->IsAlive() )
	{
		// why are we here
		DbgAssert(!_T("Doing Display() on invalid viewport!"));
		return FALSE;
	}

	if(pObj->ClassID() == XGSPHERE_CLASS_ID || pObj->IsSubClassOf(triObjectClassID))
	{
		return DisplayMesh(t, inode, vpt, flags, GetMesh(pObj));
	}
#ifndef NO_PATCHES
	else if( pObj->IsSubClassOf(patchObjectClassID) )
	{
		return DisplayPatch(t, inode, vpt, flags, (PatchObject *) pObj);
	}
#endif
	else if(pObj->CanConvertToType(triObjectClassID))
	{
		TriObject *pTri = (TriObject *) pObj->ConvertToType(t,triObjectClassID);
		DisplayMesh(t, inode, vpt, flags, &pTri->mesh);
		if(pTri != pObj)
			pTri->DeleteThis();
		
	}
	
	return 0;
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:30,代码来源:xmodifier.cpp


示例18: GetMesh

void ABaseCharacter::SetRagdollPhysics()
{
	USkeletalMeshComponent* Mesh3P = GetMesh();
	if (Mesh3P)
	{
		Mesh3P->SetCollisionProfileName(TEXT("Ragdoll"));
	}
	SetActorEnableCollision(true);

	if (!IsPendingKill() || Mesh3P || Mesh3P->GetPhysicsAsset())
	{
		Mesh3P->SetAllBodiesSimulatePhysics(true);
		Mesh3P->SetSimulatePhysics(true);
		Mesh3P->WakeAllRigidBodies();
		Mesh3P->bBlendPhysics = true;

		SetLifeSpan(TimeAfterDeathBeforeDestroy);
	}
	else
	{
		// Immediately hide the pawn
		TurnOff();
		SetActorHiddenInGame(true);
		SetLifeSpan(1.0f);
	}

	UCharacterMovementComponent* CharacterComp = Cast<UCharacterMovementComponent>(GetMovementComponent());
	if (CharacterComp)
	{
		CharacterComp->StopMovementImmediately();
		CharacterComp->DisableMovement();
		CharacterComp->SetComponentTickEnabled(false);
	}
}
开发者ID:1992please,项目名称:Unreal_ShooterGame,代码行数:34,代码来源:BaseCharacter.cpp


示例19: GetMesh

// Set Default Value
AWirePickup::AWirePickup()
{
    GetMesh()->SetSimulatePhysics(true);
    
    // Drain power level of the Wire
    DrainPower = -50.f;
}
开发者ID:gsvendso,项目名称:SER432_HomeWork,代码行数:8,代码来源:WirePickup.cpp


示例20: GetWorld

void AVehiclePawn::ReceiveHit(class UPrimitiveComponent* MyComp, class AActor* Other, class UPrimitiveComponent* OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalForce, const FHitResult& Hit)
{
	Super::ReceiveHit(MyComp, Other, OtherComp, bSelfMoved, HitLocation, HitNormal, NormalForce, Hit);

	if (ImpactTemplate && NormalForce.Size() > ImpactEffectNormalForceThreshold)
	{
		AVehicleImpactEffect* EffectActor = GetWorld()->SpawnActorDeferred<AVehicleImpactEffect>(ImpactTemplate, HitLocation, HitNormal.Rotation());
		if (EffectActor)
		{
			float DotBetweenHitAndUpRotation = FVector::DotProduct(HitNormal, GetMesh()->GetUpVector());
			EffectActor->HitSurface = Hit;
			EffectActor->HitForce = NormalForce;
			EffectActor->bWheelLand = DotBetweenHitAndUpRotation > 0.8;
			UGameplayStatics::FinishSpawningActor(EffectActor, FTransform(HitNormal.Rotation(), HitLocation));
		}
	}

	if (ImpactCameraShake)
	{
		AVehiclePlayerController* PC = Cast<AVehiclePlayerController>(Controller);
		if (PC != NULL && PC->IsLocalController())
		{
			PC->ClientPlayCameraShake(ImpactCameraShake, 1);
		}
	}
}
开发者ID:WesMC,项目名称:UnrealVehicleExampleNetworked,代码行数:26,代码来源:VehiclePawn.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetMessage函数代码示例发布时间:2022-05-30
下一篇:
C++ GetMenuString函数代码示例发布时间: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