本文整理汇总了C++中hsTArray::GetCount方法的典型用法代码示例。如果您正苦于以下问题:C++ hsTArray::GetCount方法的具体用法?C++ hsTArray::GetCount怎么用?C++ hsTArray::GetCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hsTArray
的用法示例。
在下文中一共展示了hsTArray::GetCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void plEAXListener::ProcessMods( hsTArray<plEAXListenerMod *> &modArray )
{
#ifdef EAX_SDK_AVAILABLE
int i;
float totalStrength;
hsBool firstOne;
plEAXListenerMod *thisBigRegion = nil;
EAXLISTENERPROPERTIES finalProps;
static int oldTime = timeGetTime(); // Get starting time
int newTime;
hsBool bMorphing = false;
static plStatusLog *myLog = nil;
if( myLog == nil && plgAudioSys::AreExtendedLogsEnabled() )
myLog = plStatusLogMgr::GetInstance().CreateStatusLog( 30, "EAX Reverbs", plStatusLog::kFilledBackground | plStatusLog::kDeleteForMe | plStatusLog::kDontWriteFile );
else if( myLog != nil && !plgAudioSys::AreExtendedLogsEnabled() )
{
delete myLog;
myLog = nil;
}
if( myLog != nil )
myLog->Clear();
if( modArray.GetCount() != fLastModCount )
{
kDebugLog "Clearing cache..." );
ClearProcessCache(); // Code path changed, clear the entire cache
fLastModCount = modArray.GetCount();
}
示例2: ITakeHalfPoly
void plCullNode::ITakeHalfPoly(const plCullPoly& srcPoly,
const hsTArray<int>& vtxIdx,
const hsBitVector& onVerts,
plCullPoly& outPoly) const
{
if( vtxIdx.GetCount() > 2 )
{
int i;
for( i = 0; i < vtxIdx.GetCount(); i++ )
{
int next = i < vtxIdx.GetCount()-1 ? i+1 : 0;
int last = i ? i-1 : vtxIdx.GetCount()-1;
// If these 3 verts are all on the plane, we may have created a collinear vertex (the middle one)
// which we now want to skip.
if( onVerts.IsBitSet(vtxIdx[i]) && onVerts.IsBitSet(vtxIdx[last]) && onVerts.IsBitSet(vtxIdx[next]) )
{
#if 0 // FISH
float dot = hsVector3(&srcPoly.fVerts[vtxIdx[last]], &srcPoly.fVerts[vtxIdx[i]]).InnerProduct(hsVector3(&srcPoly.fVerts[vtxIdx[next]], &srcPoly.fVerts[vtxIdx[i]]));
if( dot <= 0 )
#endif // FISH
continue;
}
if( srcPoly.fClipped.IsBitSet(vtxIdx[i])
||(onVerts.IsBitSet(vtxIdx[i]) && onVerts.IsBitSet(vtxIdx[next])) )
outPoly.fClipped.SetBit(outPoly.fVerts.GetCount());
outPoly.fVerts.Append(srcPoly.fVerts[vtxIdx[i]]);
}
}
else
{
// Just need a break point
hsStatusMessage("Under 2"); // FISH
}
}
示例3: SetDeltas
void plMorphDelta::SetDeltas(int iSpan, const hsTArray<plVertDelta>& deltas, int numUVWChans, const hsPoint3* uvws)
{
AllocDeltas(iSpan, deltas.GetCount(), numUVWChans);
if( deltas.GetCount() )
{
HSMemory::BlockMove(&deltas[0], fSpans[iSpan].fDeltas.AcquireArray(), deltas.GetCount() * sizeof(plVertDelta));
if( numUVWChans )
HSMemory::BlockMove(uvws, fSpans[iSpan].fUVWs, deltas.GetCount() * numUVWChans * sizeof(*uvws));
}
}
示例4: ComputeDeltas
// MorphDelta - ComputeDeltas
void plMorphDelta::ComputeDeltas(const hsTArray<plAccessSpan>& base, const hsTArray<plAccessSpan>& moved)
{
SetNumSpans(base.GetCount());
// For each span
{
// for( i = 0; i < numVerts; i++ )
{
// NOTE: we want to discard zero deltas, but a
// delta in any channel forces us to save the whole thing.
// But we don't want to compare to zero (because we'll end
// up with a lot of near zero deltas), but the epsilon we
// compare to needs to be different for comparing something
// like a normal delta and a position delta.
//
// For position, normal, color and all uvws
// Calc del and delLenSq
// If any delLenSq big enough, set nonZero to true
// If nonZero
{
// Append to deltas (i, del's)
}
}
}
}
示例5: ISearchLayerRecur
static int ISearchLayerRecur(hsGMaterial* mat, const ST::string &segName, hsTArray<plKey>& keys)
{
ST::string name = ( segName.compare( ENTIRE_ANIMATION_NAME ) == 0 ) ? ST::null : segName;
int i;
for( i = 0; i < mat->GetNumLayers(); i++ )
ISearchLayerRecur(mat->GetLayer(i), name, keys);
return keys.GetCount();
}
示例6: Harvest
void plSceneNode::Harvest(plVolumeIsect* isect, hsTArray<plDrawVisList>& levList)
{
static hsTArray<int16_t> visList;
visList.SetCount(0);
GetSpaceTree()->HarvestLeaves(isect, visList);
static hsTArray<int16_t> visSpans;
visSpans.SetCount(0);
int i;
for( i = 0; i < visList.GetCount(); i++ )
{
int idx = visList[i];
fDrawPool[idx]->GetSpaceTree()->HarvestLeaves(isect, visSpans);
if( visSpans.GetCount() )
{
plDrawVisList* drawVis = levList.Push();
drawVis->fDrawable = fDrawPool[idx];
drawVis->fVisList.Swap(visSpans);
}
}
}
示例7: IRenormalize
void plMorphSequence::IRenormalize(hsTArray<plAccessSpan>& dst) const
{
int i;
for( i = 0; i < dst.GetCount(); i++ )
{
hsAssert(dst[i].HasAccessVtx(), "Come on, everyone has vertices");
plAccessVtxSpan& accVtx = dst[i].AccessVtx();
int j;
for( j = 0; j < accVtx.VertCount(); j++ )
{
hsFastMath::Normalize(accVtx.Normal(j));
}
}
}
示例8: Dice
bool plGeoSpanDice::Dice(hsTArray<plGeometrySpan*>& spans) const
{
int startingCount = spans.GetCount();
hsTArray<plGeometrySpan*> out;
hsTArray<plGeometrySpan*> next;
while(spans.GetCount())
{
int i;
for( i = 0; i < spans.GetCount(); i++ )
{
if( !IHalf(spans[i], next) )
{
out.Append(spans[i]);
}
}
spans.Swap(next);
next.SetCount(0);
}
spans.Swap(out);
return spans.GetCount() != startingCount;
}
示例9: FindEdges
void plInterMeshSmooth::FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<uint16_t>* edgeVerts)
{
int i;
for( i = 0; i < sets.GetCount(); i++ )
{
const plSpan* span = sets[i].fDrawable->GetSpan(sets[i].fSpanIdx);
if( !(span->fTypeMask & plSpan::kIcicleSpan) )
continue;
uint32_t nTris = sets[i].fDrawable->CvtGetNumTris(sets[i].fSpanIdx);
uint16_t* idxList = sets[i].fDrawable->CvtGetIndexList(sets[i].fSpanIdx);
uint32_t maxVertIdx = sets[i].fDrawable->CvtGetNumVerts(sets[i].fSpanIdx)-1;
FindEdges(maxVertIdx, nTris, idxList, edgeVerts[i]);
}
}
示例10: SubmitOccluders
bool plPipelineViewSettings::SubmitOccluders(const hsTArray<const plCullPoly*>& polyList)
{
fCullPolys.SetCount(0);
fCullHoles.SetCount(0);
int i;
for (i = 0; i < polyList.GetCount(); i++)
{
if (polyList[i]->IsHole())
fCullHoles.Append(polyList[i]);
else
fCullPolys.Append(polyList[i]);
}
fCullTreeDirty = true;
return true;
}
示例11: FindSharedVerts
void plInterMeshSmooth::FindSharedVerts(hsPoint3& searchPos, plSpanHandle& set, hsTArray<uint16_t>& edgeVerts, hsTArray<uint16_t>& shareVtx, hsVector3& normAccum)
{
int i;
for( i = 0; i < edgeVerts.GetCount(); i++ )
{
hsPoint3 pos = GetPosition(set, edgeVerts[i]);
hsVector3 norm = GetNormal(set, edgeVerts[i]);
if( searchPos == pos )
{
if( norm.InnerProduct(normAccum) > fMinNormDot )
{
shareVtx.Append(edgeVerts[i]);
normAccum += norm;
}
}
}
}
示例12:
void pl3DPipeline::IAttachSlaveToReceivers(int which, plDrawableSpans* drawable, const hsTArray<int16_t>& visList)
{
plShadowSlave* slave = fShadows[which];
// Whether the drawable is a character affects which lights/shadows affect it.
bool isChar = drawable->GetNativeProperty(plDrawable::kPropCharacter);
// If the shadow is part of a light group, it gets handled in ISetShadowFromGroup.
// Unless the drawable is a character (something that moves around indeterminately,
// like the avatar or a physical object), and the shadow affects all characters.
if (slave->ObeysLightGroups() && !(slave->IncludesChars() && isChar))
return;
// Do a space tree harvest looking for spans that are visible and whose bounds
// intercect the shadow volume.
plSpaceTree* space = drawable->GetSpaceTree();
static hsBitVector cache;
cache.Clear();
space->EnableLeaves(visList, cache);
static hsTArray<int16_t> hitList;
hitList.SetCount(0);
space->HarvestEnabledLeaves(slave->fIsect, cache, hitList);
// For the visible spans that intercect the shadow volume, attach the shadow
// to all appropriate for receiving this shadow map.
for (size_t i = 0; i < hitList.GetCount(); i++)
{
const plSpan* span = drawable->GetSpan(hitList[i]);
hsGMaterial* mat = drawable->GetMaterial(span->fMaterialIdx);
// Check that the span isn't flagged as unshadowable, or has
// a material that we can't shadow onto.
if (!IReceivesShadows(span, mat))
continue;
// Check for self shadowing. If the shadow doesn't want self shadowing,
// and the span is part of the shadow caster, then skip.
if (!IAcceptsShadow(span, slave))
continue;
// Add it to this span's shadow list for this frame.
span->AddShadowSlave(fShadows[which]->fIndex);
}
}
示例13: HarvestVisible
bool plPipelineViewSettings::HarvestVisible(plSpaceTree* space, hsTArray<int16_t>& visList)
{
if (!space)
return false;
space->SetViewPos(GetViewPositionWorld());
space->Refresh();
if (fCullTreeDirty)
RefreshCullTree();
plProfile_BeginTiming(Harvest);
fCullTree.Harvest(space, visList);
plProfile_EndTiming(Harvest);
return visList.GetCount() != 0;
}
示例14: SmoothNormals
void plInterMeshSmooth::SmoothNormals(hsTArray<plSpanHandle>& sets)
{
hsTArray<uint16_t>* shareVtx = new hsTArray<uint16_t>[sets.GetCount()];
hsTArray<uint16_t>* edgeVerts = new hsTArray<uint16_t>[sets.GetCount()];
FindEdges(sets, edgeVerts);
int i;
for( i = 0; i < sets.GetCount()-1; i++ )
{
int j;
for( j = edgeVerts[i].GetCount()-1; j >= 0; --j )
{
hsPoint3 pos = GetPosition(sets[i], edgeVerts[i][j]);
hsVector3 normAccum = GetNormal(sets[i], edgeVerts[i][j]);;
shareVtx[i].Append(edgeVerts[i][j]);
int k;
for( k = i+1; k < sets.GetCount(); k++ )
{
FindSharedVerts(pos, sets[k], edgeVerts[k], shareVtx[k], normAccum);
}
normAccum.Normalize();
GetNormal(sets[i], edgeVerts[i][j]) = normAccum;
for( k = i+1; k < sets.GetCount(); k++ )
{
SetNormals(sets[k], shareVtx[k], normAccum);
}
// Now remove all the shared verts (which we just processed)
// from edgeVerts so we don't process them again.
for( k = i; k < sets.GetCount(); k++ )
{
int m;
for( m = 0; m < shareVtx[k].GetCount(); m++ )
{
int idx = edgeVerts[k].Find(shareVtx[k][m]);
hsAssert(idx != edgeVerts[k].kMissingIndex, "Lost vertex between find and remove");
edgeVerts[k].Remove(idx);
}
shareVtx[k].SetCount(0);
}
}
}
delete [] shareVtx;
delete [] edgeVerts;
}
示例15: CollectForRender
void plSceneNode::CollectForRender(plPipeline* pipe, hsTArray<plDrawVisList>& levList, plVisMgr* visMgr)
{
static hsTArray<int16_t> visList;
visList.SetCount(0);
pipe->HarvestVisible(GetSpaceTree(), visList);
static hsTArray<int16_t> visSpans;
visSpans.SetCount(0);
int i;
for( i = 0; i < visList.GetCount(); i++ )
{
int idx = visList[i];
if( pipe->PreRender(fDrawPool[idx], visSpans, visMgr) )
{
plDrawVisList* drawVis = levList.Push();
drawVis->fDrawable = fDrawPool[idx];
drawVis->fVisList.Swap(visSpans);
}
}
}