本文整理汇总了C++中IEntity类的典型用法代码示例。如果您正苦于以下问题:C++ IEntity类的具体用法?C++ IEntity怎么用?C++ IEntity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IEntity类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void Init(IEntity &entity, const float blendTime)
{
m_targetTime = blendTime;
m_lastTime = 0.0f;
m_invalid = false;
m_delta.zero();
m_deltaRot.SetIdentity();
IActor* pActor = gEnv->pGame->GetIGameFramework()->GetIActorSystem()->GetActor(entity.GetId());
m_pAnimatedCharacter = pActor ? pActor->GetAnimatedCharacter() : NULL;
}
示例2: GetEntityId
void CDoorPanel::NotifyScreenSharingEvent(const EDoorPanelGameObjectEvent event)
{
if (m_screenSharingEntities.size() > 0)
{
const EntityId thisEntityId = GetEntityId();
for (size_t i = 0; i < m_screenSharingEntities.size(); i++)
{
const EntityId entityId = m_screenSharingEntities[i];
IEntity* pEntity = gEnv->pEntitySystem->GetEntity( entityId );
if (pEntity)
{
CGameObject* pGameObject = static_cast<CGameObject*>(pEntity->GetProxy(ENTITY_PROXY_USER));
if (pGameObject != NULL)
{
SGameObjectEvent goEvent( (uint32)event, eGOEF_ToExtensions, IGameObjectSystem::InvalidExtensionID, (void*)(&(thisEntityId)) );
pGameObject->SendEvent( goEvent );
}
}
}
}
}
示例3: isFriendlyGrenade
//------------------------------------------------------------------------
void CProjectile::InitWithAI()
{
// register with ai if needed
//FIXME
//make AI ignore grenades thrown by AI; needs proper/readable grenade reaction
if (m_pAmmoParams->aiType!=AIOBJECT_NONE)
{
bool isFriendlyGrenade(true);
IEntity *pOwnerEntity = gEnv->pEntitySystem->GetEntity(m_ownerId);
if (pOwnerEntity && pOwnerEntity->GetAI())
isFriendlyGrenade = (pOwnerEntity->GetAI()->GetAIType()==AIOBJECT_PUPPET);
if (!isFriendlyGrenade)
{
AIObjectParameters params;
GetEntity()->RegisterInAISystem(m_pAmmoParams->aiType, params);
}
}
GetGameObject()->SetAIActivation(eGOAIAM_Always);
}
示例4: GetEntity
void CBoundingContainer::SetupEntity()
{
IEntity* pEntity = GetEntity();
CRY_ASSERT(pEntity != NULL);
IScriptTable* pScriptTable = pEntity->GetScriptTable();
if (pScriptTable != NULL)
{
SmartScriptTable propertiesTable;
if (pScriptTable->GetValue("Properties", propertiesTable))
{
Vec3 boundingDimensions(0.0f,0.0f,0.0f);
propertiesTable->GetValue("DimX", boundingDimensions.x);
propertiesTable->GetValue("DimY", boundingDimensions.y);
propertiesTable->GetValue("DimZ", boundingDimensions.z);
m_vBoundingMin = -boundingDimensions/2.0f;
m_vBoundingMax = boundingDimensions/2.0f;
}
}
}
示例5: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
ICustomAction* pCustomAction = pActInfo->pGraph->GetCustomAction();
switch ( event )
{
case eFE_Update:
pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, false );
if ( pCustomAction )
{
IEntity* pTarget = pCustomAction->GetObjectEntity();
ActivateOutput( pActInfo, 0, pTarget ? pTarget->GetId() : 0 );
}
break;
case eFE_Initialize:
pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, false );
break;
case eFE_Activate:
break;
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:21,代码来源:FlowCustomActionNodes.cpp
示例6: FindWaterPuddle
CWaterPuddle* CWaterPuddleManager::FindWaterPuddle(Vec3 point)
{
size_t numPuddles = m_waterPuddles.size();
for (size_t i = 0; i < numPuddles; ++i)
{
EntityId puddle = m_waterPuddles[i].m_entityId;
IEntity* pEntity = gEnv->pEntitySystem->GetEntity(puddle);
if (!pEntity)
continue;
IGameVolumes::VolumeInfo volumeInfo;
if (!GetVolumeInfoForEntity(puddle, &volumeInfo))
continue;
if (IsPointInsideVolume(pEntity->GetWorldTM(), volumeInfo, point, 0.0f))
return m_waterPuddles[i].m_pPuddle;
}
return 0;
}
示例7: min
void CBodyDestrutibilityInstance::Update( float frameTime )
{
if (m_mikeAttachmentEntityId && m_mikeExplodeAlphaTestFadeOutTimer > 0.0f)
{
m_mikeExplodeAlphaTestFadeOutTimer -= min(frameTime, m_mikeExplodeAlphaTestFadeOutTimer);
float alphaTestValue = max(min(m_mikeExplodeAlphaTestFadeOutTimer*m_mikeExplodeAlphaTestFadeOutScale+1.0f, 1.0f), 0.0f) * m_mikeExplodeAlphaTestMax;
IEntity* pJellyEntity = gEnv->pEntitySystem->GetEntity(m_mikeAttachmentEntityId);
ICharacterInstance* pJellyCharacter = pJellyEntity ? pJellyEntity->GetCharacter(0) : 0;
IMaterial* pJellyMaterial = pJellyCharacter ? pJellyCharacter->GetIMaterial() : 0;
if (pJellyMaterial)
{
int numSubMaterials = pJellyMaterial->GetSubMtlCount();
for (int i = 0; i < numSubMaterials; ++i)
{
IMaterial* pSubJellyMaterial = pJellyMaterial->GetSubMtl(i);
pSubJellyMaterial->SetGetMaterialParamFloat("alpha", alphaTestValue, false);
}
}
}
}
示例8: IMPLEMENT_RMI
//------------------------------------------------------------------------
IMPLEMENT_RMI(CGameRules, ClRenameEntity)
{
IEntity *pEntity = gEnv->pEntitySystem->GetEntity(params.entityId);
if (pEntity)
{
string old = pEntity->GetName();
pEntity->SetName(params.name.c_str());
CryLogAlways("$8%s$o renamed to $8%s", old.c_str(), params.name.c_str());
// if this was a remote player, check we're not spectating them.
// If we are, we need to trigger a spectator hud update for the new name
EntityId clientId = g_pGame->GetIGameFramework()->GetClientActorId();
if(gEnv->bMultiplayer && params.entityId != clientId)
{
CActor *pClientActor = static_cast<CActor *>(g_pGame->GetIGameFramework()->GetClientActor());
}
}
return true;
}
示例9: GetBuildingFromInterface
BuildingGUID CBaseManager::GetBuildingFromInterface(EntityId nEntityId, IBuildingController **ppController) const
{
if (NULL != ppController) *ppController = NULL;
// Get the entity
IEntity *pEntity = gEnv->pEntitySystem->GetEntity(nEntityId);
if (NULL == pEntity) return GUID_INVALID;
if (false == pEntity->CheckFlags(ENTITY_FLAG_ISINTERFACE)) return GUID_INVALID;
// Check all controllers
for (ControllerList::const_iterator itBuilding = m_ControllerList.begin(); itBuilding != m_ControllerList.end(); itBuilding++)
{
if (true == itBuilding->second->HasInterface(pEntity))
{
// Got it
if (NULL != ppController) *ppController = itBuilding->second;
return itBuilding->first;
}
}
return GUID_INVALID;
}
示例10: Reset
//------------------------------------------------------------------------
void CVehicleViewSteer::Reset()
{
CVehicleViewBase::Reset();
IEntity* pEntity = m_pVehicle->GetEntity();
assert(pEntity);
m_position = pEntity->GetWorldTM() * m_localSpaceCameraOffset;
Vec3 entityPos = pEntity->GetPos();
CalcLookAt(pEntity->GetWorldTM());
m_lastOffset = m_position - m_lookAt;
m_lastOffsetBeforeElev = m_lastOffset;
m_angReturnSpeed = 0.f;
m_angSpeedCorrection = 0.f;
// Going Forwards
m_flags &= ~m_backwardsFlags;
m_flags |= eVCam_goingForwards | m_forwardFlags;
m_radius = fabsf(m_localSpaceCameraOffset.y);
m_curYaw = 0.f;
m_lastVehVel.zero();
m_radiusVel = 0.f;
}
示例11: GetLocalPlayerFaction
uint8 CAutoAimManager::GetLocalPlayerFaction() const
{
if (m_localPlayerFaction != IFactionMap::InvalidFactionID)
{
return m_localPlayerFaction;
}
else
{
IEntity* pLocalPlayerEntity = gEnv->pEntitySystem->GetEntity(g_pGame->GetIGameFramework()->GetClientActorId());
if (pLocalPlayerEntity)
{
IAIObject* pAIObject = pLocalPlayerEntity->GetAI();
if (pAIObject)
{
m_localPlayerFaction = pAIObject->GetFactionID();
}
}
}
return m_localPlayerFaction;
}
示例12: PreparePlaybackForEvent
void CDeformingBreak::PreparePlaybackForEvent( int event )
{
m_pPhysEnt = 0;
if (m_bes[event].itype == PHYS_FOREIGN_ID_ENTITY)
{
IEntity * pEnt = gEnv->pEntitySystem->GetEntity(m_bes[event].idEnt);
if (!pEnt)
{
GameWarning("Unable to find entity to perform deforming break on");
return;
}
pEnt->SetPosRotScale(m_bes[event].pos, m_bes[event].rot, m_bes[event].scale);
m_pPhysEnt = pEnt->GetPhysics();
}
else if (m_bes[event].itype == PHYS_FOREIGN_ID_STATIC)
{
m_pPhysEnt = CObjectSelector::FindPhysicalEntity(m_bes[event].eventPos, m_bes[event].hash, CObjectSelector_Eps);
if (!m_pPhysEnt)
GameWarning("Unable to find static object to perform deforming break on");
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:21,代码来源:DeformingBreak.cpp
示例13: isReachableByWalking
bool Map::isReachableByWalking (const IEntity *start, const IEntity *end, int startPos, int endPos) const
{
// check that there is nothing solid in between
IEntity* entity = nullptr;
trace(start, end, &entity);
if (entity != nullptr && entity->isSolid())
return false;
if (startPos == -1 || endPos == -1)
getPlatformDimensions(static_cast<int>(start->getPos().x), static_cast<int>(start->getPos().y), &startPos, &endPos);
// if there is a start and end pos of a platform given, then let's check whether end is inside the range
const gridCoord xStart = start->getPos().x;
const gridCoord xEnd = end->getPos().x;
if (xStart < xEnd) {
// walking right
return xEnd <= endPos;
}
// walking left
return startPos <= xEnd;
}
示例14: ProcessEvent
virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
switch (event)
{
case eFE_Activate:
if (IsPortActive(pActInfo, 0))
{
string state = "invalid entity";
IEntity *ent = pActInfo->pEntity;
if(ent)
{
IEntityScriptProxy *pScriptProxy = (IEntityScriptProxy*)ent->GetProxy(ENTITY_PROXY_SCRIPT);
state = "invalid script";
if(pScriptProxy)
state = pScriptProxy->GetState();
}
ActivateOutput(pActInfo, OUT_STATE, state);
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:21,代码来源:FlowGameNodes.cpp
示例15: OnCheckpointLoaded
void CCheckpointSystem::OnCheckpointLoaded(SCheckpointData metaData)
{
IEntity *pCheckpoint = gEnv->pEntitySystem->GetEntity(metaData.m_checkPointId);
if(pCheckpoint)
{
//Trigger OnLoad
IScriptTable *pScript = pCheckpoint->GetScriptTable();
if (pScript)
{
HSCRIPTFUNCTION hScriptFunc(NULL);
pScript->GetValue("Event_OnLoadCheckpoint", hScriptFunc);
if (hScriptFunc) //this will trigger the flowgraph output
{
IScriptSystem *pIScriptSystem = gEnv->pScriptSystem;
Script::Call(pIScriptSystem,hScriptFunc,pScript);
pIScriptSystem->ReleaseFunc(hScriptFunc);
}
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:21,代码来源:CheckPointSystem.cpp