本文整理汇总了C++中PxShape::setGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ PxShape::setGeometry方法的具体用法?C++ PxShape::setGeometry怎么用?C++ PxShape::setGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PxShape
的用法示例。
在下文中一共展示了PxShape::setGeometry方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PxMax
void SampleParticles::Raygun::updateRayCapsule(PxRigidDynamic* actor, const PxTransform& pose, float radiusMaxMultiplier)
{
// move and resize capsule
actor->setGlobalPose(pose);
// scale force (represented with capsule RB)
if (mForceTimer < RAYGUN_FORCE_GROW_TIME)
{
float newRadius = PxMax(RAYGUN_FORCE_SIZE_MAX*radiusMaxMultiplier*mForceTimer/RAYGUN_FORCE_GROW_TIME, RAYGUN_FORCE_SIZE_MIN);
PxShape* shape;
actor->getShapes(&shape, 1);
shape->setGeometry(PxCapsuleGeometry(newRadius, 150.0f));
}
}
示例2: updateKinematicProxy
bool BoxController::updateKinematicProxy()
{
// Set extents for kinematic proxy
if(mKineActor)
{
PxShape* shape = getKineShape();
PX_ASSERT(shape->getGeometryType() == PxGeometryType::eBOX);
PxBoxGeometry bg;
shape->getBoxGeometry(bg);
bg.halfExtents = CCTtoProxyExtents(mHalfHeight, mHalfSideExtent, mHalfForwardExtent, mProxyScaleCoeff);
shape->setGeometry(bg);
}
return true;
}
示例3: setRadius
bool CapsuleController::setRadius(PxF32 r)
{
// Set radius for CCT volume
mRadius = r;
// Set radius for kinematic proxy
if(mKineActor)
{
PxShape* shape = getKineShape();
PX_ASSERT(shape->getGeometryType() == PxGeometryType::eCAPSULE);
PxCapsuleGeometry cg;
shape->getCapsuleGeometry(cg);
cg.radius = CCTtoProxyRadius(r, mProxyScaleCoeff);
shape->setGeometry(cg);
}
return true;
}
示例4: setHeight
bool CapsuleController::setHeight(PxF32 h)
{
// Set height for CCT volume
mHeight = h;
// Set height for kinematic proxy
if(mKineActor)
{
PxShape* shape = getKineShape();
PX_ASSERT(shape->getGeometryType() == PxGeometryType::eCAPSULE);
PxCapsuleGeometry cg;
shape->getCapsuleGeometry(cg);
cg.halfHeight = CCTtoProxyHeight(h, mProxyScaleCoeff);
shape->setGeometry(cg);
}
return true;
}