本文整理汇总了C++中PxRigidActor::getConcreteType方法的典型用法代码示例。如果您正苦于以下问题:C++ PxRigidActor::getConcreteType方法的具体用法?C++ PxRigidActor::getConcreteType怎么用?C++ PxRigidActor::getConcreteType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PxRigidActor
的用法示例。
在下文中一共展示了PxRigidActor::getConcreteType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void PhysX3::ApplyActionAtPoint(PintObjectHandle handle, PintActionType action_type, const Point& action, const Point& pos)
{
PxRigidActor* RigidActor = GetActorFromHandle(handle);
if(!RigidActor)
{
PxShape* Shape = GetShapeFromHandle(handle);
ASSERT(Shape);
#ifdef SUPPORT_SHARED_SHAPES
RigidActor = Shape->getActor();
#else
RigidActor = &Shape->getActor();
#endif
}
if(RigidActor->getConcreteType()==PxConcreteType::eRIGID_DYNAMIC)
{
PxRigidDynamic* RigidDynamic = static_cast<PxRigidDynamic*>(RigidActor);
if(!(RigidDynamic->getRigidBodyFlags() & PxRigidBodyFlag::eKINEMATIC))
{
PxForceMode::Enum mode;
if(action_type==PINT_ACTION_FORCE)
mode = PxForceMode::eFORCE;
else if(action_type==PINT_ACTION_IMPULSE)
mode = PxForceMode::eIMPULSE;
else ASSERT(0);
PxRigidBodyExt::addForceAtPos(*RigidDynamic, ToPxVec3(action), ToPxVec3(pos), mode);
}
}
}
示例2: AddWorldImpulseAtWorldPos
void PhysX::AddWorldImpulseAtWorldPos(PintObjectHandle handle, const Point& world_impulse, const Point& world_pos)
{
PxRigidActor* RigidActor = GetActorFromHandle(handle);
if(!RigidActor)
{
PxShape* Shape = GetShapeFromHandle(handle);
ASSERT(Shape);
RigidActor = &Shape->getActor();
}
if(RigidActor->getConcreteType()==PxConcreteType::eRIGID_DYNAMIC)
{
PxRigidDynamic* RigidDynamic = static_cast<PxRigidDynamic*>(RigidActor);
PxRigidBodyExt::addForceAtPos(*RigidDynamic, ToPxVec3(world_impulse), ToPxVec3(world_pos), PxForceMode::eIMPULSE);
}
}
示例3: AddLocalTorque
void PhysX::AddLocalTorque(PintObjectHandle handle, const Point& local_torque)
{
PxRigidActor* RigidActor = GetActorFromHandle(handle);
if(!RigidActor)
{
PxShape* Shape = GetShapeFromHandle(handle);
ASSERT(Shape);
RigidActor = &Shape->getActor();
}
if(RigidActor->getConcreteType()==PxConcreteType::eRIGID_DYNAMIC)
{
PxRigidDynamic* RigidDynamic = static_cast<PxRigidDynamic*>(RigidActor);
const PxVec3 GlobalTorque = RigidDynamic->getGlobalPose().rotate(ToPxVec3(local_torque));
RigidDynamic->addTorque(GlobalTorque, PxForceMode::eACCELERATION, true);
}
}
示例4: setupAllSceneQuery
void NpShapeManager::setupAllSceneQuery(NpScene* scene, const PxRigidActor& actor, bool hasPrunerStructure, const PxBounds3* bounds)
{
PX_ASSERT(scene); // shouldn't get here unless we're in a scene
SceneQueryManager& sqManager = scene->getSceneQueryManagerFast();
const PxU32 nbShapes = getNbShapes();
NpShape*const *shapes = getShapes();
const PxType actorType = actor.getConcreteType();
const bool isDynamic = actorType == PxConcreteType::eRIGID_DYNAMIC || actorType == PxConcreteType::eARTICULATION_LINK;
for(PxU32 i=0;i<nbShapes;i++)
{
if(isSceneQuery(*shapes[i]))
setPrunerData(i, sqManager.addPrunerShape(*shapes[i], actor, isDynamic, bounds ? bounds + i : NULL, hasPrunerStructure));
}
}
示例5: setupSceneQuery
void NpShapeManager::setupSceneQuery(SceneQueryManager& sqManager, const PxRigidActor& actor, PxU32 index)
{
const PxType actorType = actor.getConcreteType();
const bool isDynamic = actorType == PxConcreteType::eRIGID_DYNAMIC || actorType == PxConcreteType::eARTICULATION_LINK;
setPrunerData(index, sqManager.addPrunerShape(*(getShapes()[index]), actor, isDynamic));
}