本文整理汇总了C++中IPersistantDebug::AddCylinder方法的典型用法代码示例。如果您正苦于以下问题:C++ IPersistantDebug::AddCylinder方法的具体用法?C++ IPersistantDebug::AddCylinder怎么用?C++ IPersistantDebug::AddCylinder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPersistantDebug
的用法示例。
在下文中一共展示了IPersistantDebug::AddCylinder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ObstacleCheck
//-----------------------------------------------------------------------
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;
}
示例2: ProcessEvent
virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
{
#if !defined(_RELEASE)
if (event == eFE_Activate)
{
if (IsPortActive(pActInfo, eIP_Draw))
{
IPersistantDebug* pPersistentDebug = CCryAction::GetCryAction()->GetIPersistantDebug();
if (pPersistentDebug)
{
const Vec3 pos = GetPortVec3(pActInfo, eIP_Pos);
const Vec3 dir = GetPortVec3(pActInfo, eIP_Dir);
const float radius = GetPortFloat(pActInfo, eIP_Radius);
const float height = GetPortFloat(pActInfo, eIP_Height);
const float time = GetPortFloat(pActInfo, eIP_Time);
const ColorF color = GetPortVec3(pActInfo, eIP_Color);
pPersistentDebug->Begin("FG_Cylinder", false);
pPersistentDebug->AddCylinder(pos, dir, radius, height, color, time);
}
}
}
#endif
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:24,代码来源:FlowDebugNodes.cpp