这篇教程C++ GetEntity函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetEntity函数的典型用法代码示例。如果您正苦于以下问题:C++ GetEntity函数的具体用法?C++ GetEntity怎么用?C++ GetEntity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetEntity函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetEntityvoid CAnimatedCharacter::SetBlendWeightParam(const EMotionParamID motionParamID, const float value, const uint8 targetFlags/* = eBWPT_All*/){ if (motionParamID >= eMotionParamID_BlendWeight && motionParamID <= eMotionParamID_BlendWeight_Last) { //only allowed on the generic blend weights params IEntity* pEntity = GetEntity(); CRY_ASSERT(pEntity); if (targetFlags & eBWPT_FirstPersonSkeleton) { if (ICharacterInstance* pCharacterInstance = pEntity->GetCharacter(0)) { if (ISkeletonAnim* pSkeletonAnim = pCharacterInstance->GetISkeletonAnim()) { pSkeletonAnim->SetDesiredMotionParam(motionParamID, value, 0.0f); } } } if (targetFlags & eBWPT_ShadowSkeleton) { if (m_hasShadowCharacter) { if (ICharacterInstance* pShadowCharacter = pEntity->GetCharacter(m_shadowCharacterSlot)) { if (ISkeletonAnim* pShadowSkeletonAnim = pShadowCharacter->GetISkeletonAnim()) { pShadowSkeletonAnim->SetDesiredMotionParam(motionParamID, value, 0.0f); } } } } } else { CryLogAlways("[CryAnimation] ERROR: motionParam that was sent: %d is not within allowed range of blendweights %d to %d", motionParamID, eMotionParamID_BlendWeight, eMotionParamID_BlendWeight_Last); }}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:39,
示例2: RequireUpdatevoid CHeavyMountedWeapon::Update( SEntityUpdateContext& ctx, int slot ){ BaseClass::Update(ctx, slot); if (m_rotatingSoundID!=INVALID_SOUNDID) { if (m_RotationSoundTimeOut>0) { m_RotationSoundTimeOut -= ctx.fFrameTime; RequireUpdate( eIUS_General ); } else { StopSound(m_rotatingSoundID); m_rotatingSoundID = INVALID_SOUNDID; } } // Helper for editor placing if (gEnv->IsEditing()) { // If host id is not 0, it means it is mounted to a vehicle, so don't render the helper in that case if (!GetHostId()) { IRenderAuxGeom* pRenderAux = gEnv->pRenderer->GetIRenderAuxGeom(); const Matrix34& weaponTM = GetEntity()->GetWorldTM(); const Vec3 point1 = weaponTM.GetTranslation(); const Vec3 point2 = point1 - (m_sharedparams->pMountParams->ground_distance * weaponTM.GetColumn2()); const Vec3 point3 = point2 - (m_sharedparams->pMountParams->body_distance * weaponTM.GetColumn1()); pRenderAux->DrawLine(point1, ColorB(0, 192, 0), point2, ColorB(0, 192, 0), 3.0f); pRenderAux->DrawLine(point2, ColorB(0, 192, 0), point3, ColorB(0, 192, 0), 3.0f); pRenderAux->DrawSphere(point3, 0.15f, ColorB(192, 0, 0)); RequireUpdate(eIUS_General); } }}
开发者ID:Xydrel,项目名称:Infected,代码行数:39,
示例3: rot//-----------------------------------------------------------------------void CVehiclePartLight::UpdateLight(const float frameTime){ if (m_slot == -1) return; // move to vehicle event change view? if (m_diffuseMult[0] != m_diffuseMult[1]) { SEntitySlotInfo info; if (m_pVehicle->GetEntity()->GetSlotInfo(m_slot, info) && info.pLight) { CDLight& light = info.pLight->GetLightProperties(); IActor* pActor = CCryAction::GetCryAction()->GetClientActor(); bool localPlayer = (pActor != NULL) && (pActor->GetLinkedVehicle() == m_pVehicle); IVehicleSeat* pSeat = pActor ? m_pVehicle->GetSeatForPassenger(pActor->GetEntityId()) : NULL; IVehicleView* pView = pSeat? pSeat->GetView(pSeat->GetCurrentView()) : NULL; bool isThirdPersonView = pView? pView->IsThirdPerson() : true; if (localPlayer && !isThirdPersonView) light.SetLightColor(ColorF(m_diffuseCol * m_diffuseMult[0], 1.f)); else light.SetLightColor(ColorF(m_diffuseCol * m_diffuseMult[1], 1.f)); } } if (m_pHelper) { const static Matrix33 rot(Matrix33::CreateRotationXYZ(Ang3(0.f, 0.f, DEG2RAD(90.f)))); Matrix34 helperTM; m_pHelper->GetVehicleTM(helperTM); Matrix34 localTM = Matrix33(helperTM) * rot; localTM.SetTranslation(helperTM.GetTranslation()); GetEntity()->SetSlotLocalTM(m_slot, localTM); }}
开发者ID:aronarts,项目名称:FireNET,代码行数:40,
示例4: DrawSlot//----------------------------------------------------void CRocketLauncher::ActivateTPLaser(bool activate){ if(activate) { DrawSlot( eIGS_Aux1,true); ActivateLaserDot(true,false); m_laserTPOn = true; //Force first update m_lastUpdate = 0.0f; m_smoothLaserLength = -1.0f; UpdateTPLaser(0.0f); RequireUpdate(eIUS_General); } else { DrawSlot( eIGS_Aux1,false); GetEntity()->SetSlotLocalTM( eIGS_Aux1,Matrix34::CreateIdentity()); ActivateLaserDot(false,false); m_laserTPOn = false; }}
开发者ID:nhnam,项目名称:Seasons,代码行数:23,
示例5: GetEntity//------------------------------------------bool CC4Projectile::Init(IGameObject *pGameObject){ bool ok = CProjectile::Init(pGameObject); // C4 should always be saved (unlike other projectiles) IEntity* pEntity = GetEntity(); pEntity->SetFlags(pEntity->GetFlags() & ~ENTITY_FLAG_NO_SAVE); if(!gEnv->bServer) { CreateLight(); } if(gEnv->bMultiplayer) { CGameRules *pGameRules = g_pGame->GetGameRules(); pGameRules->RegisterTeamChangedListener(this); pGameRules->RegisterClientConnectionListener(this); } return ok;}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:23,
示例6: GetEntityvoid CMonoEntityExtension::FullSerialize(TSerialize ser){ IEntity *pEntity = GetEntity(); ser.BeginGroup("Properties"); auto pPropertyHandler = static_cast<CEntityPropertyHandler *>(pEntity->GetClass()->GetPropertyHandler()); for(int i = 0; i < pPropertyHandler->GetPropertyCount(); i++) { if(ser.IsWriting()) { IEntityPropertyHandler::SPropertyInfo propertyInfo; pPropertyHandler->GetPropertyInfo(i, propertyInfo); ser.Value(propertyInfo.name, pPropertyHandler->GetProperty(pEntity, i)); } else { IEntityPropertyHandler::SPropertyInfo propertyInfo; pPropertyHandler->GetPropertyInfo(i, propertyInfo); char *propertyValue = nullptr; ser.ValueChar(propertyInfo.name, propertyValue, 0); pPropertyHandler->SetProperty(pEntity, i, propertyValue); } } ser.EndGroup(); ser.BeginGroup("ManagedEntity"); IMonoArray *pArgs = CreateMonoArray(1); pArgs->InsertNativePointer(&ser); m_pScript->GetClass()->InvokeArray(m_pScript->GetManagedObject(), "InternalFullSerialize", pArgs); pArgs->Release(); ser.EndGroup();}
开发者ID:nathanpapke,项目名称:CryMono,代码行数:39,
示例7: GetMovementControllervoid CFlyer::SetActorMovement(SMovementRequestParams& movementRequestParams){ SMovementState state; GetMovementController()->GetMovementState(state); if (movementRequestParams.vMoveDir.IsZero()) { Vec3 vDesiredDirection = movementRequestParams.vLookTargetPos.IsZero() ? GetEntity()->GetWorldRotation() * FORWARD_DIRECTION : (movementRequestParams.vLookTargetPos - state.eyePosition).GetNormalizedSafe(); SetDesiredDirection(vDesiredDirection); SetDesiredVelocity(Vec3Constants<float>::fVec3_Zero); } else { Vec3 vDesiredDirection = movementRequestParams.vLookTargetPos.IsZero() ? movementRequestParams.vMoveDir.GetNormalizedSafe() : (movementRequestParams.vLookTargetPos - state.eyePosition).GetNormalizedSafe(); SetDesiredDirection(vDesiredDirection); SetDesiredVelocity(movementRequestParams.vMoveDir * movementRequestParams.fDesiredSpeed); }}
开发者ID:Adi0927,项目名称:alecmercer-origins,代码行数:22,
示例8: switchvoid CBoundingContainer::ProcessEvent( SEntityEvent& entityEvent ){ switch(entityEvent.event) { case ENTITY_EVENT_RESET: { const bool bEnteringGameMode = ( entityEvent.nParam[ 0 ] == 1 ); Reset( bEnteringGameMode ); } break; case ENTITY_EVENT_START_LEVEL: // Need to wait till all entities are loaded since other entities can be inside { bool bHideContainedItemsOnStart = false; EntityScripts::GetEntityProperty(GetEntity(), "bHideContainedItemsOnStart", bHideContainedItemsOnStart); if (bHideContainedItemsOnStart && !gEnv->IsEditor()) { HideContainedItems(); } } break; }}
开发者ID:eBunny,项目名称:EmberProject,代码行数:22,
示例9: UnusedRodinBTNode::ETickStatus RodinBTNodePlayActions::Tick(float DeltaTime) { Unused(DeltaTime); WBEntity* const pEntity = GetEntity(); WBEvent BTNodePlayActionsEvent; STATIC_HASHED_STRING(BTNodePlayActionsEvent); BTNodePlayActionsEvent.SetEventName(sBTNodePlayActionsEvent); pEntity->AddContextToEvent(BTNodePlayActionsEvent); const uint NumActions = m_Actions.Size(); for (uint ActionIndex = 0; ActionIndex < NumActions; ++ActionIndex) { WBAction* const pAction = m_Actions[ActionIndex]; ASSERT(pAction); WBActionStack::Push(BTNodePlayActionsEvent); pAction->Execute(); WBActionStack::Pop(); } return ETS_Success;}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:22,
示例10: GetEntityvoid CComponentVida::Decrease(float _fAmount){ if(m_fVida > 0.0f) { m_fTimeSinceHit = 0.0f; if(_fAmount < 0.0f) _fAmount *= -1; m_fVida -= _fAmount; if(m_fVida <= 0.f) { m_fVida = 0.0f; SEvent l_morir; l_morir.Msg = SEvent::MORIR; l_morir.Receiver = l_morir.Sender = GetEntity()->GetGUID(); CORE->GetEntityManager()->SendEvent(l_morir); } }}
开发者ID:Atridas,项目名称:biogame,代码行数:22,
示例11: MakeVectorsbool Bot::IsFriendInLineOfFire (float distance){ // bot can't hurt teammates, if friendly fire is not enabled... if (!engine->IsFriendlyFireOn ()) return false; MakeVectors (pev->v_angle); TraceResult tr; TraceLine (EyePosition (), EyePosition () + pev->v_angle.Normalize () * distance, false, false, GetEntity (), &tr); // check if we hit something if (!FNullEnt (tr.pHit)) { int playerIndex = ENTINDEX (tr.pHit) - 1; // check valid range if (playerIndex >= 0 && playerIndex < engine->GetMaxClients () && g_clients[playerIndex].team == GetTeam (GetEntity ()) && (g_clients[playerIndex].flags & CFLAG_ALIVE)) return true; } // search the world for players for (int i = 0; i < engine->GetMaxClients (); i++) { if (!(g_clients[i].flags & CFLAG_USED) || !(g_clients[i].flags & CFLAG_ALIVE) || g_clients[i].team != GetTeam (GetEntity ()) || g_clients[i].ent == GetEntity ()) continue; edict_t *ent = g_clients[i].ent; float friendDistance = (GetEntityOrigin (ent) - pev->origin).GetLength (); float squareDistance = sqrtf (1089.0f + (friendDistance * friendDistance)); if ((GetShootingConeDeviation (GetEntity (), &GetEntityOrigin (ent))) > ((friendDistance * friendDistance) / (squareDistance * squareDistance)) && friendDistance <= distance) return true; } return false;}
开发者ID:CCNHsK-Dev,项目名称:SyPB,代码行数:39,
示例12: IsGroupOfEnemiesbool Bot::IsGroupOfEnemies (Vector location, int numEnemies, int radius){ int numPlayers = 0; // search the world for enemy players... for (int i = 0; i < engine->GetMaxClients (); i++) { if (!(g_clients[i].flags & CFLAG_USED) || !(g_clients[i].flags & CFLAG_ALIVE) || g_clients[i].ent == GetEntity ()) continue; if ((GetEntityOrigin (g_clients[i].ent) - location).GetLength () < radius) { // don't target our teammates... if (g_clients[i].team == GetTeam (GetEntity ())) return false; if (numPlayers++ > numEnemies) return true; } } return false;}
开发者ID:CCNHsK-Dev,项目名称:SyPB,代码行数:22,
示例13: if//------------------------------------------------------------------------void CVehiclePartEntity::UpdateEntity(){ if(IEntity *pEntity = GetPartEntity()) { Matrix34 worldTM; if(m_pHelper) { m_pHelper->GetWorldTM(worldTM); } else if(IVehiclePart *pParent = GetParent()) { worldTM = pParent->GetWorldTM(); } else { worldTM = GetEntity()->GetWorldTM(); } pEntity->SetWorldTM(worldTM); }}
开发者ID:aronarts,项目名称:FireNET,代码行数:23,
示例14: VPROF_BUDGET//================================================================================// Update hitbox positions and visibility// This function can be very expensive, it should only be called for the active enemy.//================================================================================void CEntityMemory::UpdateHitboxAndVisibility(){ VPROF_BUDGET("CEntityMemory::UpdateHitboxAndVisibility", VPROF_BUDGETGROUP_BOTS_EXPENSIVE); // For now let's assume that we do not know Hitbox and therefore we have no vision UpdateVisibility(false); m_Hitbox.Reset(); m_VisibleHitbox.Reset(); // We obtain the positions of the Hitbox Utils::GetHitboxPositions(GetEntity(), m_Hitbox); if (!m_Hitbox.IsValid()) return; { VPROF_BUDGET("UpdateVisibility", VPROF_BUDGETGROUP_BOTS_EXPENSIVE); // Now let's check if we can see any of them if (m_pBot->GetDecision()->IsAbleToSee(m_Hitbox.head)) { m_VisibleHitbox.head = m_Hitbox.head; UpdateVisibility(true); } if (m_pBot->GetDecision()->IsAbleToSee(m_Hitbox.chest)) { m_VisibleHitbox.chest = m_Hitbox.chest; UpdateVisibility(true); } if (m_pBot->GetDecision()->IsAbleToSee(m_Hitbox.feet)) { m_VisibleHitbox.feet = m_Hitbox.feet; UpdateVisibility(true); } } // We update the ideal position GetVisibleHitboxPosition(m_vecIdealPosition, m_pBot->GetProfile()->GetFavoriteHitbox());}
开发者ID:WootsMX,项目名称:InSource,代码行数:43,
示例15: GetEntityvoid CBoundingContainer::HideContainedItems(){ IEntity* pEntity = GetEntity(); if (pEntity) { // Proximity query all entities in area AABB aabbBounds(m_vBoundingMin, m_vBoundingMax); OBB obbBounds; Matrix34 worldTM = pEntity->GetWorldTM(); obbBounds.SetOBBfromAABB(Matrix33(worldTM), aabbBounds); aabbBounds.Reset(); aabbBounds.SetAABBfromOBB(pEntity->GetWorldPos(), obbBounds); SEntityProximityQuery query; query.box = aabbBounds; gEnv->pEntitySystem->QueryProximity(query); const int iQueryCount = query.nCount; for (int i = 0; i < iQueryCount; ++i) { IEntity* pQueryEntity = query.pEntities[i]; if (pQueryEntity) { const EntityId queryEntityId = pQueryEntity->GetId(); if (!stl::find(m_hiddenEntities, queryEntityId)) // Only if not already hidden { // Make sure entity type should be hidden and entity pos is also inside, not just an intersection if (ShouldHide(queryEntityId, pQueryEntity) && aabbBounds.IsContainPoint(pQueryEntity->GetWorldPos())) { pQueryEntity->Hide(true); m_hiddenEntities.push_back(pQueryEntity->GetId()); } } } } }}
开发者ID:eBunny,项目名称:EmberProject,代码行数:38,
示例16: assertvoid CAICorpse::HandleEvent( const SGameObjectEvent& gameObjectEvent ){ if(gameObjectEvent.event == eCGE_ItemTakenFromCorpse) { assert(gameObjectEvent.param != NULL); bool matchFound = false; const EntityId itemId = *static_cast<const EntityId*>(gameObjectEvent.param); for (uint32 i = 0; i < m_attachedItemsInfo.size(); ++i) { if(m_attachedItemsInfo[i].id == itemId) { ICharacterInstance* pCharacter = GetEntity()->GetCharacter(0); if(pCharacter != NULL) { IAttachment* pAttachment = pCharacter->GetIAttachmentManager()->GetInterfaceByName( m_attachedItemsInfo[i].attachmentName.c_str() ); if(pAttachment != NULL) { pAttachment->ClearBinding(); } } m_attachedItemsInfo.removeAt(i); matchFound = true; break; } } if(matchFound) { if(m_attachedItemsInfo.empty()) { m_priority = 0; //Lower the priority once all attached items have been removed } } }}
开发者ID:aronarts,项目名称:FireNET,代码行数:38,
示例17: CalcFrameCentreAndSize //----------------------------------------------------------- /// The image from the texture atlas will have potentially /// been cropped by the tool. This will affect the sprites /// position within the uncropped image and we need to /// account for that when positioning the corners //----------------------------------------------------------- void SpriteComponent::UpdateVertexPositions() { Core::Vector2 frameCenter; Core::Vector2 frameSize; if(m_textureAtlas != nullptr && m_hashedTextureAtlasId > 0) { CalcFrameCentreAndSize(frameCenter, frameSize); } else if(mpMaterial != nullptr && mpMaterial->GetTexture() != nullptr) { auto texture = mpMaterial->GetTexture().get(); frameSize = m_sizePolicyDelegate(m_originalSize, Core::Vector2((f32)texture->GetWidth(), (f32)texture->GetHeight())); } const Core::Matrix4& worldTransform = GetEntity()->GetTransform().GetWorldTransform(); Core::Vector2 halfFrameSize(frameSize.x * 0.5f, frameSize.y * 0.5f); Core::Vector2 alignedPosition = -GetAnchorPoint(m_originAlignment, halfFrameSize); Core::Vector4 vertexCentre(alignedPosition.x + frameCenter.x, alignedPosition.y + frameCenter.y, 0.0f, 1.0f); //TL Core::Vector4 vertexOffset(-halfFrameSize.x, halfFrameSize.y, 0.0f, 0.0f); m_spriteData.sVerts[(u32)SpriteBatch::Verts::k_topLeft].vPos = (vertexCentre + vertexOffset) * worldTransform; //TR vertexOffset.x = halfFrameSize.x; vertexOffset.y = halfFrameSize.y; m_spriteData.sVerts[(u32)SpriteBatch::Verts::k_topRight].vPos = (vertexCentre + vertexOffset) * worldTransform; //BL vertexOffset.x = -halfFrameSize.x; vertexOffset.y = -halfFrameSize.y; m_spriteData.sVerts[(u32)SpriteBatch::Verts::k_bottomLeft].vPos = (vertexCentre + vertexOffset) * worldTransform; //BR vertexOffset.x = halfFrameSize.x; vertexOffset.y = -halfFrameSize.y; m_spriteData.sVerts[(u32)SpriteBatch::Verts::k_bottomRight].vPos = (vertexCentre + vertexOffset) * worldTransform; }
开发者ID:DNSMorgan,项目名称:ChilliSource,代码行数:44,
示例18: GetEntity//------------------------------------------------------------------------void CProjectile::SetParams(EntityId ownerId, EntityId hostId, EntityId weaponId, int damage, int hitTypeId, float damageDrop /*= 0.0f*/, float damageDropMinR /*=0.0f*/){ m_ownerId = ownerId; m_weaponId = weaponId; m_hostId = hostId; m_damage = damage; m_hitTypeId = hitTypeId; m_damageDropPerMeter = damageDrop; m_damageDropMinDisSqr = damageDropMinR*damageDropMinR; if (m_hostId || m_ownerId) { IEntity* pSelfEntity = GetEntity(); if (pSelfEntity) pSelfEntity->AddEntityLink("Shooter", m_ownerId); IEntity *pEntity = gEnv->pEntitySystem->GetEntity(m_hostId?m_hostId:m_ownerId); if (pEntity) { if (pSelfEntity) { //need to set AI species to the shooter - not to be scared of it's own rockets IAIObject* projectileAI = pSelfEntity->GetAI(); IAIObject* shooterAI = pEntity->GetAI(); if (projectileAI && shooterAI) projectileAI->SetFactionID(shooterAI->GetFactionID()); } if (m_pPhysicalEntity && m_pPhysicalEntity->GetType()==PE_PARTICLE) { pe_params_particle pparams; pparams.pColliderToIgnore = pEntity->GetPhysics(); m_pPhysicalEntity->SetParams(&pparams); } } }}
开发者ID:nhnam,项目名称:Seasons,代码行数:39,
示例19: GetEntityvoid CFlyer::PrePhysicsUpdate(){ if(m_stats.isRagDoll) return; if(GetHealth() <= 0.f) return; IEntity *pEntity = GetEntity(); if(pEntity->IsHidden()) return; if(IPhysicalEntity *pPhysicalEntity = pEntity->GetPhysics()) { pe_player_dynamics player_dynamics; player_dynamics.gravity.zero(); pPhysicalEntity->SetParams(&player_dynamics); } float frameTime = gEnv->pTimer->GetFrameTime(); if(m_pMovementController) { SActorFrameMovementParams params; m_pMovementController->Update(frameTime, params); } if(m_linkStats.CanMove() && m_linkStats.CanRotate()) { ProcessMovement(frameTime); if(m_pAnimatedCharacter) { m_pAnimatedCharacter->AddMovement(m_moveRequest); } }}
开发者ID:Hellraiser666,项目名称:CryGame,代码行数:38,
示例20: GetFlockint CScriptBind_Boids::SetFlockParams(IFunctionHandler *pH,SmartScriptTable entity,SmartScriptTable paramTable){ CFlock *flock = GetFlock(entity); if (!flock) return pH->EndFunction(); string currModel = flock->GetModelName(); int currCount = flock->GetBoidsCount(); SBoidContext bc; flock->GetBoidSettings(bc); SBoidsCreateContext ctx; if (ReadParamsTable( paramTable,bc,ctx )) { flock->SetBoidSettings( bc ); string model = ""; if (!ctx.models.empty()) model = ctx.models[0]; if ((!model.empty() && stricmp(model.c_str(),currModel.c_str()) == 0) || (ctx.boidsCount > 0 && ctx.boidsCount != currCount)) { flock->CreateBoids( ctx ); } } IEntity *pEntity = GetEntity(entity); if (pEntity) { CBoidsProxy *pBoidsProxy = (CBoidsProxy*)pEntity->GetProxy(ENTITY_PROXY_BOIDS); if (pBoidsProxy) { // Update pBoidsProxy->SetFlock(flock); } } return pH->EndFunction();}
开发者ID:aronarts,项目名称:FireNET,代码行数:38,
示例21: whileint XENTITYS::Ref2Entity( const char* estr, char* str, int strlen ){ char* pes = (char*)estr; char* ps = str; char* ps_end = ps+strlen; while( pes && *pes && ps < ps_end ) { XENTITY *ent = GetEntity( pes ); if( ent ) { // copy entity meanning char *ps = ent->entity; pes += ent->ref_len; } else *ps = *pes++; // default character copy ps++; } *ps = '/0'; // total copied characters return ps-str; }
开发者ID:Braunson,项目名称:openitg,代码行数:23,
示例22: whileint _tagXMLEntitys::Ref2Entity( LPCTSTR estr, LPTSTR str, int strlen ){ LPTSTR pes = (LPTSTR)estr; LPTSTR ps = str; LPTSTR ps_end = ps+strlen; while( pes && *pes && ps < ps_end ) { LPXENTITY ent = GetEntity( pes ); if( ent ) { // copy entity meanning char *ps = ent->entity; pes += ent->ref_len; } else *ps = *pes++; // default character copy ps++; } *ps = '/0'; // total copied characters return ps-str; }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:23,
示例23: GetEntity//------------------------------------------------------------------------void CItem::StopLayer(const ItemString& layerName, int flags, bool record){ TLayerMap::iterator it = m_sharedparams->layers.find(CONST_TEMPITEM_STRING(layerName)); if (it == m_sharedparams->layers.end()) return; for (int i=0; i<eIGS_Last; i++) { if (!(flags&1<<i)) continue; ICharacterInstance *pCharacter = GetEntity()->GetCharacter(i); if (pCharacter) pCharacter->GetISkeletonAnim()->StopAnimationInLayer(it->second.id[i],0.0f); } if (record) { TActiveLayerMap::iterator ait = m_activelayers.find(CONST_TEMPITEM_STRING(layerName)); if (ait != m_activelayers.end()) m_activelayers.erase(ait); }}
开发者ID:kitnet,项目名称:project-o,代码行数:24,
示例24: Physicalizevoid CHeavyMountedWeapon::OnReset(){ BaseClass::OnReset(); m_rippedOff = m_rippingOff = false; m_stats.mounted = true; m_rotatingSoundID = INVALID_SOUNDID; m_lastUsedFrame = -1; Physicalize(false, false); RequireUpdate(eIUS_General); if (m_linkedParentId != 0) { IEntity* pLinkedParent = gEnv->pEntitySystem->GetEntity(m_linkedParentId); if (pLinkedParent) { pLinkedParent->AttachChild(GetEntity()); } m_linkedParentId = 0; }}
开发者ID:Xydrel,项目名称:Infected,代码行数:23,
示例25: GetEntityvoid CLivingEntitySample::StartAnimationForCurrentAnimationState(){ IEntity* pEntity = GetEntity(); const int slot = 0; ICharacterInstance* pCharacterInstance = pEntity->GetCharacter( slot ); if ( pCharacterInstance == NULL ) { return; } ISkeletonAnim* pSkeletonAnim = pCharacterInstance->GetISkeletonAnim(); if ( pSkeletonAnim == NULL ) { return; } CryCharAnimationParams animationParams; animationParams.m_nFlags |= CA_LOOP_ANIMATION; animationParams.m_nLayerID = 0; animationParams.m_fTransTime = 0.3f; const char* animationName = IDLE_ANIMATION_NAME; switch ( m_animationState ) { case None: case Idle: animationName = IDLE_ANIMATION_NAME; break; case Walk: animationName = WALK_ANIMATION_NAME; break; } pSkeletonAnim->StartAnimation( animationName, animationParams );}
开发者ID:AiYong,项目名称:CryGame,代码行数:37,
示例26: GiveExtraTubeToInventoryvoid CJaw::PickUp(EntityId pickerId, bool sound, bool select, bool keepHistory, const char* setup){ for (TAmmoVector::iterator it = m_bonusammo.begin(); it != m_bonusammo.end(); ++it) { SWeaponAmmo& currentBonusAmmo = *it; currentBonusAmmo.count = 0; } IItemSystem* pItemSystem = gEnv->pGame->GetIGameFramework()->GetIItemSystem(); IActor* pPicketActor = gEnv->pGame->GetIGameFramework()->GetIActorSystem()->GetActor(pickerId); IInventory* pInventory = pPicketActor->GetInventory(); bool giveExtraTube = GiveExtraTubeToInventory(pPicketActor, pItemSystem); if (pPicketActor->IsClient()) SetAmmoCount(m_fm->GetAmmoType(), 1); BaseClass::PickUp(pickerId,sound,select,keepHistory, setup); if (giveExtraTube) { int numJaws = m_weaponsharedparams->ammoParams.extraItems; while(numJaws-- > 0) { pItemSystem->GiveItem(pPicketActor, GetEntity()->GetClass()->GetName(), false, false, false); } m_extraTubesAdded = true; } if(m_auxSlotUsed) { DrawSlot(eIGS_ThirdPersonAux,false); m_auxSlotUsed = false; } if(GetOwnerActor() && !GetOwnerActor()->IsPlayer()) m_stats.first_selection = false;}
开发者ID:amrhead,项目名称:eaascode,代码行数:37,
示例27: UnusedRodinBTNode::ETickStatus RodinBTNodeEldLookAt::Tick(float DeltaTime) { Unused(DeltaTime); WBEntity* const pEntity = GetEntity(); WBCompRodinBlackboard* const pAIBlackboard = GET_WBCOMP(pEntity, RodinBlackboard); ASSERT(pAIBlackboard); const WBEvent::EType TargetType = pAIBlackboard->GetType(m_LookTargetBlackboardKey); if (TargetType == WBEvent::EWBEPT_Vector) { const Vector LookTarget = pAIBlackboard->GetVector(m_LookTargetBlackboardKey); WB_MAKE_EVENT(LookAt, pEntity); WB_SET_AUTO(LookAt, Vector, LookAtLocation, LookTarget); WB_DISPATCH_EVENT(GetEventManager(), LookAt, pEntity); return ETS_Success; } else if (TargetType == WBEvent::EWBEPT_Entity) { WBEntity* const pLookTargetEntity = pAIBlackboard->GetEntity(m_LookTargetBlackboardKey); if (!pLookTargetEntity) { return ETS_Fail; } WB_MAKE_EVENT(LookAt, pEntity); WB_SET_AUTO(LookAt, Entity, LookAtEntity, pLookTargetEntity); WB_DISPATCH_EVENT(GetEventManager(), LookAt, pEntity); return ETS_Success; } return ETS_Fail;}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:37,
示例28: SetStateByIdvoid CDoorPanel::Update( SEntityUpdateContext& ctx, int slot ){ if (m_bHasDelayedStateEvent) { if (m_fDelayedStateEventTimeDelay > FLT_EPSILON) { m_fDelayedStateEventTimeDelay -= ctx.fFrameTime; } else { m_fDelayedStateEventTimeDelay = -1.0f; m_bHasDelayedStateEvent = false; const EDoorPanelBehaviorState delayedState = m_delayedState; m_delayedState = eDoorPanelBehaviorState_Invalid; SetStateById(delayedState); } } // Check visible distance if (m_fVisibleDistanceSq > 0.0f) { const float fCurTime = ctx.fCurrTime; if ((fCurTime - m_fLastVisibleDistanceCheckTime) >= GetGameConstCVar(g_flashdoorpanel_distancecheckinterval)) { m_fLastVisibleDistanceCheckTime = fCurTime; const Vec3& clientPos = CHUDUtils::GetClientPos(); const float fDistSqFromClientToObject = clientPos.GetSquaredDistance(GetEntity()->GetWorldPos()); const bool bVisible = fDistSqFromClientToObject <= m_fVisibleDistanceSq; if (bVisible != m_bFlashVisible) { m_bFlashVisible = bVisible; SDoorPanelVisibleEvent visibleEvent( bVisible ); StateMachineHandleEventBehavior( visibleEvent ); } } }}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:37,
示例29: HandleEntityEventvoid CMonoActor::ProcessEvent(SEntityEvent& event){ if(m_pScript == nullptr) return; HandleEntityEvent(event, GetEntity(), m_pScript); switch (event.event) { case ENTITY_EVENT_UNHIDE: case ENTITY_EVENT_VISIBLE: GetGameObject()->RequestRemoteUpdate(eEA_Physics | eEA_GameClientDynamic | eEA_GameServerDynamic | eEA_GameClientStatic | eEA_GameServerStatic); break; case ENTITY_EVENT_START_GAME: { GetGameObject()->RequestRemoteUpdate(eEA_Physics | eEA_GameClientDynamic | eEA_GameServerDynamic | eEA_GameClientStatic | eEA_GameServerStatic); if (m_pAnimatedCharacter) m_pAnimatedCharacter->ResetState(); } break; case ENTITY_EVENT_RESET: { if (m_pAnimatedCharacter) m_pAnimatedCharacter->ResetState(); GetGameObject()->RequestRemoteUpdate(eEA_Physics | eEA_GameClientDynamic | eEA_GameServerDynamic | eEA_GameClientStatic | eEA_GameServerStatic); } break; case ENTITY_EVENT_INIT: { if (m_pAnimatedCharacter) m_pAnimatedCharacter->ResetState(); } break; } }
开发者ID:my5800mkk,项目名称:CryMono,代码行数:37,
注:本文中的GetEntity函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetEntityId函数代码示例 C++ GetEngine函数代码示例 |