本文整理汇总了C++中PODVector::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ PODVector::Clear方法的具体用法?C++ PODVector::Clear怎么用?C++ PODVector::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PODVector
的用法示例。
在下文中一共展示了PODVector::Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetComponents
void Component::GetComponents(PODVector<Component*>& dest, StringHash type) const
{
if (node_)
node_->GetComponents(dest, type);
else
dest.Clear();
}
示例2: callback
void PhysicsWorld2D::Raycast(PODVector<PhysicsRaycastResult2D>& results, const Vector2& startPoint, const Vector2& endPoint, unsigned collisionMask)
{
results.Clear();
RayCastCallback callback(results, startPoint, collisionMask);
world_->RayCast(&callback, ToB2Vec2(startPoint), ToB2Vec2(endPoint));
}
示例3:
template<> void* ToluaToPODVector<Vector2>(lua_State* L, int narg, void* def)
{
if (!lua_istable(L, narg))
return 0;
static PODVector<Vector2> result;
result.Clear();
tolua_Error tolua_err;
int length = lua_objlen(L, narg);
for (int i = 1; i <= length; ++i)
{
lua_pushinteger(L, i);
lua_gettable(L, narg);
if (!tolua_isusertype(L, -1, "Vector2", 0, &tolua_err))
{
lua_pop(L, 1);
return 0;
}
Vector2* value = (Vector2*)tolua_touserdata(L, -1, 0);
result.Push(*value);
lua_pop(L, 1);
}
return &result;
}
示例4: ClipPolygon
static void ClipPolygon(PODVector<DecalVertex>& dest, const PODVector<DecalVertex>& src, const Plane& plane, bool skinned)
{
unsigned last = 0;
float lastDistance = 0.0f;
dest.Clear();
if (src.Empty())
return;
for (unsigned i = 0; i < src.Size(); ++i)
{
float distance = plane.Distance(src[i].position_);
if (distance >= 0.0f)
{
if (lastDistance < 0.0f)
dest.Push(ClipEdge(src[last], src[i], lastDistance, distance, skinned));
dest.Push(src[i]);
}
else
{
if (lastDistance >= 0.0f && i != 0)
dest.Push(ClipEdge(src[last], src[i], lastDistance, distance, skinned));
}
last = i;
lastDistance = distance;
}
// Recheck the distances of the last and first vertices and add the final clipped vertex if applicable
float distance = plane.Distance(src[0].position_);
if ((lastDistance < 0.0f && distance >= 0.0f) || (lastDistance >= 0.0f && distance < 0.0f))
dest.Push(ClipEdge(src[last], src[0], lastDistance, distance, skinned));
}
示例5: GetCollidingBodies
void RigidBody::GetCollidingBodies(PODVector<RigidBody*>& result) const
{
if (physicsWorld_)
physicsWorld_->GetRigidBodies(result, this);
else
result.Clear();
}
示例6: CopyStrippedCode
void CopyStrippedCode(PODVector<unsigned char>& dest, void* src, unsigned srcSize)
{
unsigned const D3DSIO_COMMENT = 0xFFFE;
unsigned* srcWords = (unsigned*)src;
unsigned srcWordSize = srcSize >> 2;
dest.Clear();
for (unsigned i = 0; i < srcWordSize; ++i)
{
unsigned opcode = srcWords[i] & 0xffff;
unsigned paramLength = (srcWords[i] & 0x0f000000) >> 24;
unsigned commentLength = srcWords[i] >> 16;
// For now, skip comment only at fixed position to prevent false positives
if (i == 1 && opcode == D3DSIO_COMMENT)
{
// Skip the comment
i += commentLength;
}
else
{
// Not a comment, copy the data
unsigned char* srcBytes = (unsigned char*)(srcWords + i);
dest.Push(*srcBytes++);
dest.Push(*srcBytes++);
dest.Push(*srcBytes++);
dest.Push(*srcBytes++);
}
}
}
示例7: GetComponents
void Node::GetComponents(PODVector<Component*>& dest, ShortStringHash type) const
{
dest.Clear();
for (Vector<SharedPtr<Component> >::ConstIterator i = components_.Begin(); i != components_.End(); ++i)
{
if ((*i)->GetType() == type)
dest.Push(*i);
}
}
示例8: FindPath
void NavigationMesh::FindPath(PODVector<Vector3>& dest, const Vector3& start, const Vector3& end, const Vector3& extents,
const dtQueryFilter* filter)
{
PODVector<NavigationPathPoint> navPathPoints;
FindPath(navPathPoints, start, end, extents, filter);
dest.Clear();
for (unsigned i = 0; i < navPathPoints.Size(); ++i)
dest.Push(navPathPoints[i].position_);
}
示例9: GetResources
void ResourceCache::GetResources(PODVector<Resource*>& result, ShortStringHash type) const
{
result.Clear();
HashMap<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
if (i != resourceGroups_.End())
{
for (HashMap<StringHash, SharedPtr<Resource> >::ConstIterator j = i->second_.resources_.Begin();
j != i->second_.resources_.End(); ++j)
result.Push(j->second_);
}
}
示例10: GetNodesWithTag
bool Scene::GetNodesWithTag(PODVector<Node*>& dest, const String& tag) const
{
dest.Clear();
HashMap<StringHash, PODVector<Node*> >::ConstIterator it = taggedNodes_.Find(tag);
if (it != taggedNodes_.End())
{
dest = it->second_;
return true;
}
else
return false;
}
示例11: GetChildren
void Node::GetChildren(PODVector<Node*>& dest, bool recursive) const
{
dest.Clear();
if (!recursive)
{
for (Vector<SharedPtr<Node> >::ConstIterator i = children_.Begin(); i != children_.End(); ++i)
dest.Push(*i);
}
else
GetChildrenRecursive(dest);
}
示例12: GetDirtyAssets
void AssetDatabase::GetDirtyAssets(PODVector<Asset*>& assets)
{
assets.Clear();
List<SharedPtr<Asset>>::ConstIterator itr = assets_.Begin();
while (itr != assets_.End())
{
if ((*itr)->IsDirty())
assets.Push(*itr);
itr++;
}
}
示例13:
template <> void* ToluaToPODVector<bool>(double /*overload*/, lua_State* L, int narg, void* /*def*/)
{
if (!lua_istable(L, narg))
return 0;
static PODVector<bool> result;
result.Clear();
result.Resize((unsigned)lua_objlen(L, narg));
for (unsigned i = 0; i < result.Size(); ++i)
{
lua_rawgeti(L, narg, i + 1);
result[i] = (bool)tolua_toboolean(L, -1, 0);
lua_pop(L, 1);
}
return &result;
}
示例14: GetRigidBodies
void PhysicsWorld::GetRigidBodies(PODVector<RigidBody*>& result, const RigidBody* body)
{
PROFILE(GetCollidingBodies);
result.Clear();
for (HashMap<Pair<WeakPtr<RigidBody>, WeakPtr<RigidBody> >, btPersistentManifold*>::Iterator i = currentCollisions_.Begin();
i != currentCollisions_.End(); ++i)
{
if (i->first_.first_ == body)
result.Push(i->first_.second_);
else if (i->first_.second_ == body)
result.Push(i->first_.first_);
}
}
示例15: GetChildrenWithComponent
void Node::GetChildrenWithComponent(PODVector<Node*>& dest, ShortStringHash type, bool recursive) const
{
dest.Clear();
if (!recursive)
{
for (Vector<SharedPtr<Node> >::ConstIterator i = children_.Begin(); i != children_.End(); ++i)
{
if ((*i)->HasComponent(type))
dest.Push(*i);
}
}
else
GetChildrenWithComponentRecursive(dest, type);
}