本文整理汇总了C++中hsTArray::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ hsTArray::getSize方法的具体用法?C++ hsTArray::getSize怎么用?C++ hsTArray::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hsTArray
的用法示例。
在下文中一共展示了hsTArray::getSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildDIIndex
size_t plDrawableSpans::buildDIIndex(const hsTArray < std::shared_ptr<plGeometrySpan> >& spans) {
plDISpanIndex di_idx;
for (size_t i=0; i<spans.getSize(); ++i) {
di_idx.fIndices.append(fSourceSpans.find(spans[i]));
}
size_t result = fDIIndices.getSize();
fDIIndices.append(di_idx);
return result;
}
示例2: setPosDeltas
void plSpanInstance::setPosDeltas(const hsTArray<hsVector3>& verts) {
delete[] fPosDelta;
fNumVerts = verts.getSize();
fPosDelta = new unsigned char[fNumVerts * CalcPosStride(fEncoding)];
switch (fEncoding.getCode() & plSpanEncoding::kPosMask) {
case plSpanEncoding::kPos888:
{
unsigned char* pp = fPosDelta;
for (unsigned int i=0; i<fNumVerts; i++) {
pp[0] = (unsigned char)(verts[i].X / fEncoding.getPosScale());
pp[1] = (unsigned char)(verts[i].Y / fEncoding.getPosScale());
pp[2] = (unsigned char)(verts[i].Z / fEncoding.getPosScale());
pp += 3;
}
}
break;
case plSpanEncoding::kPos161616:
{
unsigned short* pp = (unsigned short*)fPosDelta;
for (unsigned int i=0; i<fNumVerts; i++) {
pp[0] = (unsigned short)(verts[i].X / fEncoding.getPosScale());
pp[1] = (unsigned short)(verts[i].X / fEncoding.getPosScale());
pp[2] = (unsigned short)(verts[i].X / fEncoding.getPosScale());
pp += 3;
}
}
break;
case plSpanEncoding::kPos101010:
{
unsigned int* pp = (unsigned int*)fPosDelta;
for (unsigned int i=0; i<fNumVerts; i++) {
*pp = ((unsigned int)(verts[i].Z / fEncoding.getPosScale()) & 0x3F) << 20
| ((unsigned int)(verts[i].Y / fEncoding.getPosScale()) & 0x3F) << 10
| ((unsigned int)(verts[i].X / fEncoding.getPosScale()) & 0x3F);
pp++;
}
}
break;
case plSpanEncoding::kPos008:
{
unsigned char* pp = fPosDelta;
for (unsigned int i=0; i<fNumVerts; i++) {
*pp = (unsigned char)(verts[i].Z / fEncoding.getPosScale());
pp++;
}
}
break;
}
}
示例3: setEaseControllers
void plLeafController::setEaseControllers(const hsTArray<class plEaseController*>& controllers) {
DeallocControllers();
AllocControllers(controllers.getSize());
for (size_t i=0; i<controllers.getSize(); i++)
fEaseControllers[i] = controllers[i];
}
示例4: setKeys
void plLeafController::setKeys(const hsTArray<hsKeyFrame*>& keys, unsigned int type) {
DeallocKeys();
AllocKeys(keys.getSize(), type);
for (size_t i=0; i<keys.getSize(); i++)
fKeys[i] = keys[i];
}
示例5: append
void append(const hsTArray<T>& items) {
size_t ins = getSize();
incSize(items.getSize());
for (size_t i=0; i<items.getSize(); i++)
data[ins + i] = items.get(i);
}