当前位置: 首页>>代码示例>>C++>>正文


C++ PxPhysics::getTolerancesScale方法代码示例

本文整理汇总了C++中PxPhysics::getTolerancesScale方法的典型用法代码示例。如果您正苦于以下问题:C++ PxPhysics::getTolerancesScale方法的具体用法?C++ PxPhysics::getTolerancesScale怎么用?C++ PxPhysics::getTolerancesScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PxPhysics的用法示例。


在下文中一共展示了PxPhysics::getTolerancesScale方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sceneDesc

void
PhsXWorld::build(void) {
    PxTolerancesScale scale = PxTolerancesScale();
    PxFoundation* gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gAllocator, gErrorCallback);
    PxProfileZoneManager* profileZoneManager = &PxProfileZoneManager::createProfileZoneManager(gFoundation);
    PxPhysics*	gPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *gFoundation, scale, true, profileZoneManager);
    if (gPhysics->getPvdConnectionManager()) {
        gPhysics->getVisualDebugger()->setVisualizeConstraints(true);
        gPhysics->getVisualDebugger()->setVisualDebuggerFlag(PxVisualDebuggerFlag::eTRANSMIT_CONTACTS, true);
        gPhysics->getVisualDebugger()->setVisualDebuggerFlag(PxVisualDebuggerFlag::eTRANSMIT_SCENEQUERIES, true);
        //gPhysics->getVisualDebugger()->setVisualDebuggerFlag(PxVisualDebuggerFlag::eTRANSMIT_CONSTRAINTS, true);
        gConnection = PxVisualDebuggerExt::createConnection(gPhysics->getPvdConnectionManager(), "127.0.0.1", 5425, 100);
    }
    PxSceneDesc sceneDesc(gPhysics->getTolerancesScale());
    sceneDesc.gravity = PxVec3(0.0f, -9.81f, 0.0f);
    PxDefaultCpuDispatcher* gDispatcher = PxDefaultCpuDispatcherCreate(2);
    sceneDesc.cpuDispatcher = gDispatcher;
    sceneDesc.filterShader = PxDefaultSimulationFilterShader;
    sceneDesc.flags |= PxSceneFlag::eENABLE_ACTIVETRANSFORMS;
    m_pDynamicsWorld = gPhysics->createScene(sceneDesc);
    //m_pDynamicsWorld->setFlag(PxSceneFlag::eENABLE_ACTIVETRANSFORMS, true);

    mCooking = PxCreateCooking(PX_PHYSICS_VERSION, *gFoundation, PxCookingParams(scale));
    manager = PxCreateControllerManager(*m_pDynamicsWorld);

    std::srand(time(NULL));
}
开发者ID:david-leal,项目名称:nau,代码行数:27,代码来源:physXWorld.cpp

示例2: PxInitVehicleSDK

bool PxInitVehicleSDK(PxPhysics& physics)
{
	PX_ASSERT(static_cast<Ps::Foundation*>(&physics.getFoundation()) == &Ps::Foundation::getInstance());
	Ps::Foundation::incRefCount();
	setVehicleToleranceScale(physics.getTolerancesScale());
	return true;
}
开发者ID:nmovshov,项目名称:ARSS_win,代码行数:7,代码来源:PxVehicleSDK.cpp

示例3: InitPhysX

		void InitPhysX() {
		        gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gDefaultAllocatorCallback, gDefaultErrorCallback);
		        gPhysicsSDK = PxCreatePhysics(PX_PHYSICS_VERSION, *gFoundation, PxTolerancesScale() );
		        if(gPhysicsSDK == NULL) {
		                cerr<<"Error create PhysX."<<endl;
		        }
		        PxSceneDesc sceneDesc(gPhysicsSDK->getTolerancesScale());
		        sceneDesc.gravity               = PxVec3(0.0f, -9.8f, 0.0f);
		        sceneDesc.cpuDispatcher = PxDefaultCpuDispatcherCreate(1);
		        sceneDesc.filterShader  = PxDefaultSimulationFilterShader;
		        gScene = gPhysicsSDK->createScene(sceneDesc);
		        PxMaterial* material = gPhysicsSDK->createMaterial(0.5,0.5,0.5);
		        PxTransform planePos =  PxTransform(PxVec3(0.0f),PxQuat(PxHalfPi, PxVec3(0.0f, 0.0f, 1.0f)));
		        PxRigidStatic* plane =  gPhysicsSDK->createRigidStatic(planePos);
		        plane->createShape(PxPlaneGeometry(), *material);
		        gScene->addActor(*plane);
		        PxTransform             boxPos(PxVec3(0.0f, 10.0f, 0.0f));
		        PxBoxGeometry   boxGeometry(PxVec3(2,2,2));
		        gBox = PxCreateDynamic(*gPhysicsSDK, boxPos, boxGeometry, *material, 1.0f);
		        gScene->addActor(*gBox);
		}
开发者ID:hexagit,项目名称:physxSceneOF,代码行数:21,代码来源:main.cpp


注:本文中的PxPhysics::getTolerancesScale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。