本文整理汇总了C++中IPersistantDebug类的典型用法代码示例。如果您正苦于以下问题:C++ IPersistantDebug类的具体用法?C++ IPersistantDebug怎么用?C++ IPersistantDebug使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IPersistantDebug类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearEntityTags
//-------------------------------------------------------------------------
int CScriptBind_Action::ClearEntityTags(IFunctionHandler* pH, ScriptHandle entityId)
{
IPersistantDebug* pPD = CCryAction::GetCryAction()->GetIPersistantDebug();
pPD->ClearEntityTags((EntityId)entityId.n);
return pH->EndFunction();
}
示例2: ProcessEvent
virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
{
#if !defined(_RELEASE)
switch (event)
{
case eFE_Activate:
{
if (IsPortActive(pActInfo, eIP_Draw))
{
IPersistantDebug* pPersistentDebug = CCryAction::GetCryAction()->GetIPersistantDebug();
if (pPersistentDebug)
{
const Vec3 pos1 = GetPortVec3(pActInfo, eIP_Pos1);
const Vec3 pos2 = GetPortVec3(pActInfo, eIP_Pos2);
const float time = GetPortFloat(pActInfo, eIP_Time);
const ColorF color = GetPortVec3(pActInfo, eIP_Color);
Vec3 offset(pos2);
if (pos2.IsZero())
{
offset = pos1 + (GetPortVec3(pActInfo, eIP_Dir) * GetPortFloat(pActInfo, eIP_Length));
}
pPersistentDebug->Begin("FG_Line", false);
pPersistentDebug->AddLine(pos1, offset, color, time);
}
}
break;
}
}
#endif
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:33,代码来源:FlowDebugNodes.cpp
示例3: ClearStaticTag
//-------------------------------------------------------------------------
int CScriptBind_Action::ClearStaticTag(IFunctionHandler* pH, ScriptHandle entityId, const char *staticId)
{
IPersistantDebug* pPD = CCryAction::GetCryAction()->GetIPersistantDebug();
pPD->ClearStaticTag((EntityId)entityId.n, staticId);
return pH->EndFunction();
}
示例4: DebugDrawPersistanceDirection
int CScriptBind_Game::DebugDrawPersistanceDirection(
IFunctionHandler *pH,
float startX, float startY, float startZ,
float dirX, float dirY, float dirZ,
int r, int g, int b,
float duration)
{
IPersistantDebug* debugRenderer = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug();
assert(debugRenderer != NULL);
debugRenderer->Begin("CScriptBind_Game::DebugDrawPersistanceDirection", false);
const Vec3 direction(dirX, dirY, dirZ);
const float length = direction.GetLength();
const float radius = max(0.1f, length * 0.05f);
debugRenderer->AddDirection(Vec3(startX, startY, startZ), radius, direction,
ColorF(
((float)r) / 256.0f,
((float)g) / 256.0f,
((float)b) / 256.0f,
1.0f),
duration);
return pH->EndFunction();
}
示例5: PersistantArrow
//-------------------------------------------------------------------------
int CScriptBind_Action::PersistantArrow(IFunctionHandler* pH, Vec3 pos, float radius, Vec3 dir, Vec3 color, const char* name, float timeout)
{
IPersistantDebug* pPD = CCryAction::GetCryAction()->GetIPersistantDebug();
pPD->Begin(name, false);
pPD->AddDirection(pos, radius, dir, ColorF(color, 1.f), timeout);
return pH->EndFunction();
}
示例6: ColorF
//-------------------------------------------------------------------------
int CScriptBind_Action::Persistant2DText(IFunctionHandler* pH, const char* text, float size, Vec3 color, const char* name, float timeout)
{
IPersistantDebug* pPD = CCryAction::GetCryAction()->GetIPersistantDebug();
pPD->Begin(name, false);
pPD->Add2DText(text, size, ColorF(color, 1.f), timeout);
return pH->EndFunction();
}
示例7: PersistantLine
//-------------------------------------------------------------------------
int CScriptBind_Action::PersistantLine(IFunctionHandler* pH, Vec3 start, Vec3 end, Vec3 color, const char* name, float timeout)
{
IPersistantDebug* pPD = CCryAction::GetCryAction()->GetIPersistantDebug();
pPD->Begin(name, false);
pPD->AddLine(start, end, ColorF(color, 1.f), timeout);
return pH->EndFunction();
}
示例8:
//-----------------------------------------------------------------------
IPersistantDebug* CSpectacularKill::BeginPersistantDebug() const
{
#ifndef _RELEASE
IPersistantDebug* pPersistantDebug = g_pGame->GetIGameFramework()->GetIPersistantDebug();
pPersistantDebug->Begin((PERSISTANT_DEBUG_NOT_VALID_ANIM_TAG + m_pOwner->GetEntity()->GetName()).c_str(), true);
return pPersistantDebug;
#else
return NULL;
#endif
}
示例9: CHANGED_NETWORK_STATE
void CNetPlayerInput::DoSetState(const SSerializedPlayerInput& input )
{
m_newInterpolation |= (input.position != m_curInput.position) || (input.deltaMovement != m_curInput.deltaMovement);
const bool wasSprinting = m_curInput.sprint;
m_curInput = input;
CHANGED_NETWORK_STATE(m_pPlayer, CPlayer::ASPECT_INPUT_CLIENT );
if(wasSprinting != input.sprint)
{
SInputEventData inputEventData( SInputEventData::EInputEvent_Sprint, m_pPlayer->GetEntityId(), CCryName("sprint"), input.sprint ? eAAM_OnPress : eAAM_OnRelease, 0.f );
m_pPlayer->StateMachineHandleEventMovement( SStateEventPlayerInput( &inputEventData ) );
}
// not having these set seems to stop a remote avatars rotation being reflected
m_curInput.aiming = true;
m_curInput.allowStrafing = true;
m_curInput.usinglookik = true;
IAIActor* pAIActor = CastToIAIActorSafe(m_pPlayer->GetEntity()->GetAI());
if (pAIActor)
pAIActor->GetState().bodystate=input.bodystate;
CMovementRequest moveRequest;
moveRequest.SetStance( (EStance)m_curInput.stance );
if(IsDemoPlayback())
{
Vec3 localVDir(m_pPlayer->GetViewQuatFinal().GetInverted() * m_curInput.lookDirection);
Ang3 deltaAngles(asinf(localVDir.z),0,atan2_tpl(-localVDir.x,localVDir.y));
moveRequest.AddDeltaRotation(deltaAngles*gEnv->pTimer->GetFrameTime());
}
moveRequest.SetPseudoSpeed(CalculatePseudoSpeed());
moveRequest.SetAllowStrafing(input.allowStrafing);
m_pPlayer->GetMovementController()->RequestMovement(moveRequest);
#if !defined(_RELEASE)
// debug..
if (g_pGameCVars->g_debugNetPlayerInput & 1)
{
IPersistantDebug * pPD = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug();
pPD->Begin( string("net_player_input_") + m_pPlayer->GetEntity()->GetName(), true );
pPD->AddSphere( moveRequest.GetLookTarget(), 0.5f, ColorF(1,0,1,1), 1.0f );
// pPD->AddSphere( moveRequest.GetMoveTarget(), 0.5f, ColorF(1,1,0,1), 1.0f );
Vec3 wp(m_pPlayer->GetEntity()->GetWorldPos() + Vec3(0,0,2));
pPD->AddDirection( wp, 1.5f, m_curInput.deltaMovement, ColorF(1,0,0,1), 1.0f );
pPD->AddDirection( wp, 1.5f, m_curInput.lookDirection, ColorF(0,1,0,1), 1.0f );
}
#endif
}
示例10: BeginPersistantDebug
//-----------------------------------------------------------------------
bool CSpectacularKill::ObstacleCheck(const Vec3& vKillerPos, const Vec3& vTargetPos, const SSpectacularKillAnimation& anim) const
{
// [*DavidR | 13/Sep/2010] ToDo: Find a way to make this asynchronously
const float OBSTACLE_CHECK_RADIUS = 0.6f;
const float OBSTACLE_CHECK_GROUND_OFFSET = 0.2f;
const Vec3& vCapsuleKillerEnd = vKillerPos + anim.vKillerObstacleCheckOffset;
primitives::capsule capsPrim;
const Vec3& vKillerToTargetDist = vTargetPos - vCapsuleKillerEnd;
capsPrim.axis = vKillerToTargetDist.GetNormalized();
capsPrim.r = OBSTACLE_CHECK_RADIUS;
// hh is actually half the total height (it's measured from the center)
capsPrim.hh = static_cast<float>(__fsel(anim.fObstacleCheckLength,
(anim.fObstacleCheckLength * 0.5f) - capsPrim.r,
(min(g_pGameCVars->g_spectacularKill.maxDistanceError, vKillerToTargetDist.GetLength()) * 0.5f) - capsPrim.r));
capsPrim.center = vCapsuleKillerEnd + (capsPrim.axis * (capsPrim.hh + capsPrim.r));
capsPrim.center.z += capsPrim.r + OBSTACLE_CHECK_GROUND_OFFSET;
geom_contact* pContact = NULL;
int collisionEntityTypes = ent_static | ent_terrain | ent_sleeping_rigid | ent_ignore_noncolliding;
float d = gEnv->pPhysicalWorld->PrimitiveWorldIntersection(capsPrim.type, &capsPrim, Vec3Constants<float>::fVec3_Zero, collisionEntityTypes, &pContact, 0, geom_colltype0);
bool bObstacleFound = (d != 0.0f) && pContact;
#ifndef _RELEASE
if (bObstacleFound && (g_pGameCVars->g_spectacularKill.debug > 1))
{
const float fTime = 6.0f;
// visually show why it failed
IPersistantDebug* pPersistantDebug = BeginPersistantDebug();
// Draw a capsule using a cylinder and two spheres
const ColorF debugColor = Col_Coral * ColorF(1.0f, 1.0f, 1.0f, 0.6f);
pPersistantDebug->AddCylinder(capsPrim.center, capsPrim.axis, capsPrim.r, capsPrim.hh * 2.0f, debugColor, fTime);
pPersistantDebug->AddSphere(capsPrim.center - (capsPrim.axis * capsPrim.hh), capsPrim.r, debugColor, fTime);
pPersistantDebug->AddSphere(capsPrim.center + (capsPrim.axis * capsPrim.hh), capsPrim.r, debugColor, fTime);
for (int i = 0; i < (int)d; ++i)
{
// Draw the collision point
geom_contact collisionData(pContact[i]);
pPersistantDebug->AddCone(collisionData.pt, -collisionData.n, 0.1f, 0.8f, Col_Red, fTime + 2.0f);
}
}
#endif
return bObstacleFound;
}
示例11: RenderDebug
// ============================================================================
// Render debug information.
//
void HazardModule::RenderDebug() const
{
IPersistantDebug *debugRenderer = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug();
if (debugRenderer == NULL)
{
return;
}
debugRenderer->Begin("HazardDebugGraphics", false);
RenderDebugProcessContainer(m_ProjectileHazards, *debugRenderer);
RenderDebugProcessContainer(m_SphereHazards, *debugRenderer);
}
示例12: localVDir
void CNetPlayerInput::DoSetState(const SSerializedPlayerInput& input )
{
m_curInput = input;
m_pPlayer->GetGameObject()->ChangedNetworkState( INPUT_ASPECT );
CMovementRequest moveRequest;
moveRequest.SetStance( (EStance)m_curInput.stance );
if(IsDemoPlayback())
{
Vec3 localVDir(m_pPlayer->GetViewQuatFinal().GetInverted() * m_curInput.lookDirection);
Ang3 deltaAngles(asin(localVDir.z),0,cry_atan2f(-localVDir.x,localVDir.y));
moveRequest.AddDeltaRotation(deltaAngles*gEnv->pTimer->GetFrameTime());
}
//else
{
moveRequest.SetLookTarget( m_pPlayer->GetEntity()->GetWorldPos() + 10.0f * m_curInput.lookDirection );
moveRequest.SetAimTarget(moveRequest.GetLookTarget());
}
float pseudoSpeed = 0.0f;
if (m_curInput.deltaMovement.len2() > 0.0f)
{
pseudoSpeed = m_pPlayer->CalculatePseudoSpeed(m_curInput.sprint);
}
moveRequest.SetPseudoSpeed(pseudoSpeed);
moveRequest.SetAllowStrafing(true);
float lean=0.0f;
if (m_curInput.leanl)
lean-=1.0f;
if (m_curInput.leanr)
lean+=1.0f;
moveRequest.SetLean(lean);
m_pPlayer->GetMovementController()->RequestMovement(moveRequest);
// debug..
if (g_pGameCVars->g_debugNetPlayerInput & 1)
{
IPersistantDebug * pPD = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug();
pPD->Begin( string("net_player_input_") + m_pPlayer->GetEntity()->GetName(), true );
pPD->AddSphere( moveRequest.GetLookTarget(), 0.5f, ColorF(1,0,1,1), 1.0f );
// pPD->AddSphere( moveRequest.GetMoveTarget(), 0.5f, ColorF(1,1,0,1), 1.0f );
Vec3 wp(m_pPlayer->GetEntity()->GetWorldPos() + Vec3(0,0,2));
pPD->AddDirection( wp, 1.5f, m_curInput.deltaMovement, ColorF(1,0,0,1), 1.0f );
pPD->AddDirection( wp, 1.5f, m_curInput.lookDirection, ColorF(0,1,0,1), 1.0f );
}
}
示例13: CCCPOINT_IF
//-----------------------------------------------------------------------
void CMelee::PerformMelee(const Vec3 &pos, const Vec3 &dir, bool remote)
{
CCCPOINT_IF(! remote, Melee_PerformLocal);
CCCPOINT_IF(remote, Melee_PerformRemote);
MeleeDebugLog ("CMelee<%p> PerformMelee(remote=%s)", this, remote ? "true" : "false");
#if !defined(_RELEASE)
if(g_pGameCVars->pl_melee.debug_gfx)
{
IPersistantDebug *pDebug = g_pGame->GetIGameFramework()->GetIPersistantDebug();
pDebug->Begin("CMelee::PerformMelee", false);
pDebug->AddLine(pos, (pos + dir), ColorF(1.f,0.f,0.f,1.f), 15.f);
}
#endif
m_collisionHelper.DoCollisionTest(SCollisionTestParams(pos, dir, GetRange(), m_pWeapon->GetOwnerId(), 0, remote));
}
示例14: PersistantEntityTag
//-------------------------------------------------------------------------
// Required Params: entityId, const char *text
// Optional Params: float size, Vec3 color, float visibleTime, float fadeTime, float viewDistance, const char* staticId, int columnNum, const char* contextTag
int CScriptBind_Action::PersistantEntityTag(IFunctionHandler* pH, ScriptHandle entityId, const char *text)
{
IPersistantDebug* pPD = CCryAction::GetCryAction()->GetIPersistantDebug();
SEntityTagParams params;
params.entity = (EntityId)entityId.n;
params.text = text;
params.tagContext = "scriptbind";
// Optional params
if (pH->GetParamType(3) != svtNull) // Size
pH->GetParam(3, params.size);
if (pH->GetParamType(4) != svtNull) // Color
{
Vec3 color;
pH->GetParam(4, color);
params.color = ColorF(color, 1.f);
}
if (pH->GetParamType(5) != svtNull) // Visible Time
pH->GetParam(5, params.visibleTime);
if (pH->GetParamType(6) != svtNull) // Fade Time
pH->GetParam(6, params.fadeTime);
if (pH->GetParamType(7) != svtNull) // View Distance
pH->GetParam(7, params.viewDistance);
if (pH->GetParamType(8) != svtNull) // Static ID
{
const char *staticId;
pH->GetParam(8, staticId);
params.staticId = staticId;
}
if (pH->GetParamType(9) != svtNull) // Column Num
pH->GetParam(9, params.column);
if (pH->GetParamType(10) != svtNull) // Context Tag
{
const char *tagContext;
pH->GetParam(10, tagContext);
params.tagContext = tagContext; // overrides default one set above
}
pPD->AddEntityTag(params);
return pH->EndFunction();
}
示例15: gun
void CGunTurret::DrawDebug()
{
IPersistantDebug *pDebug = gEnv->pGame->GetIGameFramework()->GetIPersistantDebug();
pDebug->Begin("CGunTurret::DrawDebug", true);
Vec3 gun(ZERO),rocket(ZERO),radar(ZERO),barrel(ZERO);
gun = GetSlotHelperPos(eIGS_ThirdPerson,m_fireHelper,true);
rocket = GetSlotHelperPos(eIGS_ThirdPerson,m_rocketHelper,true);
barrel = GetSlotHelperPos(eIGS_ThirdPerson,m_barrelHelper,true);
radar = GetSlotHelperPos(eIGS_Aux0,m_radarHelper,true);
pDebug->AddSphere(gun, 0.2f, ColorF(1,0,0,1), 1.f);
pDebug->AddSphere(rocket, 0.2f, ColorF(0,1,0,1), 1.f);
pDebug->AddSphere(radar, 0.2f, ColorF(0,0,1,1), 1.f);
pDebug->AddSphere(barrel, 0.2f, ColorF(1,0,1,1), 1.f);
}