本文整理汇总了C++中PxBounds3::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ PxBounds3::isValid方法的具体用法?C++ PxBounds3::isValid怎么用?C++ PxBounds3::isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PxBounds3
的用法示例。
在下文中一共展示了PxBounds3::isValid方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void NpSpatialIndex::update(PxSpatialIndexItemId id,
const PxBounds3& bounds)
{
PX_SIMD_GUARD;
PX_CHECK_AND_RETURN(bounds.isValid(), "PxSpatialIndex::update: bounds are not valid.");
mPruner->updateObjects(&id, &bounds);
mPendingUpdates = true;
}
示例2: getWorldBounds
PxBounds3 NpCloth::getWorldBounds(float inflation) const
{
NP_READ_CHECK(NpActor::getOwnerScene(*this));
const PxBounds3 bounds = mCloth.getWorldBounds();
PX_ASSERT(bounds.isValid());
// PT: unfortunately we can't just scale the min/max vectors, we need to go through center/extents.
const PxVec3 center = bounds.getCenter();
const PxVec3 inflatedExtents = bounds.getExtents() * inflation;
return PxBounds3::centerExtents(center, inflatedExtents);
}
示例3: insert
PxSpatialIndexItemId NpSpatialIndex::insert(PxSpatialIndexItem& item,
const PxBounds3& bounds)
{
PX_SIMD_GUARD;
PX_CHECK_AND_RETURN_VAL(bounds.isValid(), "PxSpatialIndex::insert: bounds are not valid.", PX_SPATIAL_INDEX_INVALID_ITEM_ID);
Sq::PrunerHandle output;
Sq::PrunerPayload payload;
payload.data[0] = reinterpret_cast<size_t>(&item);
mPruner->addObjects(&output, &bounds, &payload);
mPendingUpdates = true;
return output;
}
示例4: overlap
void NpSpatialIndex::overlap(const PxBounds3& aabb,
PxSpatialOverlapCallback& callback) const
{
PX_SIMD_GUARD;
PX_CHECK_AND_RETURN(aabb.isValid(), "PxSpatialIndex::overlap: aabb is not valid.");
flushUpdates();
OverlapCallback cb(callback);
PxBoxGeometry boxGeom(aabb.getExtents());
PxTransform xf(aabb.getCenter());
Sq::ShapeData shapeData(boxGeom, xf, 0.0f); // temporary rvalue not compatible with PX_NOCOPY
mPruner->overlap(shapeData, cb);
}
示例5: getWorldBounds
PxBounds3 NpArticulation::getWorldBounds(float inflation) const
{
NP_READ_CHECK(getOwnerScene());
PxBounds3 bounds = PxBounds3::empty();
for(PxU32 i=0; i < mArticulationLinks.size(); i++)
{
bounds.include(mArticulationLinks[i]->getWorldBounds());
}
PX_ASSERT(bounds.isValid());
// PT: unfortunately we can't just scale the min/max vectors, we need to go through center/extents.
const PxVec3 center = bounds.getCenter();
const PxVec3 inflatedExtents = bounds.getExtents() * inflation;
return PxBounds3::centerExtents(center, inflatedExtents);
}
示例6: sweep
void NpSpatialIndex::sweep(const PxBounds3& aabb,
const PxVec3& unitDir,
PxReal maxDist,
PxSpatialLocationCallback& callback) const
{
PX_SIMD_GUARD;
PX_CHECK_AND_RETURN(aabb.isValid(), "PxSpatialIndex::sweep: aabb is not valid.");
PX_CHECK_AND_RETURN(unitDir.isFinite() && unitDir.isNormalized(), "PxSpatialIndex::sweep: unitDir is not valid.");
PX_CHECK_AND_RETURN(maxDist > 0.0f, "PxSpatialIndex::sweep: distance must be positive");
flushUpdates();
LocationCallback cb(callback);
PxBoxGeometry boxGeom(aabb.getExtents());
PxTransform xf(aabb.getCenter());
Sq::ShapeData shapeData(boxGeom, xf, 0.0f); // temporary rvalue not compatible with PX_NOCOPY
mPruner->sweep(shapeData, unitDir, maxDist, cb);
}
示例7: createRegionsFromWorldBounds
PxU32 PxBroadPhaseExt::createRegionsFromWorldBounds(PxBounds3* regions, const PxBounds3& globalBounds, PxU32 nbSubdiv, PxU32 upAxis)
{
PX_CHECK_MSG(globalBounds.isValid(), "PxBroadPhaseExt::createRegionsFromWorldBounds(): invalid bounds provided!");
PX_CHECK_MSG(upAxis<3, "PxBroadPhaseExt::createRegionsFromWorldBounds(): invalid up-axis provided!");
const PxVec3& min = globalBounds.minimum;
const PxVec3& max = globalBounds.maximum;
const float dx = (max.x - min.x) / float(nbSubdiv);
const float dy = (max.y - min.y) / float(nbSubdiv);
const float dz = (max.z - min.z) / float(nbSubdiv);
PxU32 nbRegions = 0;
PxVec3 currentMin, currentMax;
for(PxU32 j=0;j<nbSubdiv;j++)
{
for(PxU32 i=0;i<nbSubdiv;i++)
{
if(upAxis==0)
{
currentMin = PxVec3(min.x, min.y + dy * float(i), min.z + dz * float(j));
currentMax = PxVec3(max.x, min.y + dy * float(i+1), min.z + dz * float(j+1));
}
else if(upAxis==1)
{
currentMin = PxVec3(min.x + dx * float(i), min.y, min.z + dz * float(j));
currentMax = PxVec3(min.x + dx * float(i+1), max.y, min.z + dz * float(j+1));
}
else if(upAxis==2)
{
currentMin = PxVec3(min.x + dx * float(i), min.y + dy * float(j), min.z);
currentMax = PxVec3(min.x + dx * float(i+1), min.y + dy * float(j+1), max.z);
}
regions[nbRegions++] = PxBounds3(currentMin, currentMax);
}
}
return nbRegions;
}