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


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

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


在下文中一共展示了PxPhysics::getPvdConnectionManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createPvdConnection

void PVDHelper::createPvdConnection(const EditableParams& params)
{
	PvdConnectionManager* pvd = mPhysics->getPvdConnectionManager();
	if(!pvd)
		return;

/*	if(0)
	{
		PxDebuggerConnectionFlags PDebuggerFlags;
		PDebuggerFlags |= PxExtensionConnectionType::Debug;
		PDebuggerFlags |= PxExtensionConnectionType::Profile;
		PDebuggerFlags |= PxExtensionConnectionType::Memory;

		PxExtensionVisualDebugger::connect( 
						pvd,
						PVD_HOST,
						5425,
						3000,
						PDebuggerFlags
						);
		return;
	}*/

	//The connection flags state overall what data is to be sent to PVD.  Currently
	//the Debug connection flag requires support from the implementation (don't send
	//the data when debug isn't set) but the other two flags, profile and memory
	//are taken care of by the PVD SDK.

	//Use these flags for a clean profile trace with minimal overhead
	//TConnectionFlagsType theConnectionFlags( PvdConnectionType::Profile )
#ifdef BETA2
	TConnectionFlagsType theConnectionFlags( PvdConnectionType::Debug | PvdConnectionType::Profile | PvdConnectionType::Memory );
	if(!params.mUseFullPvdConnection)
		theConnectionFlags = TConnectionFlagsType(PvdConnectionType::Profile);
#else
	PxVisualDebuggerConnectionFlags theConnectionFlags( PxVisualDebuggerExt::getAllConnectionFlags() );
	if(!params.mUseFullPvdConnection)
		theConnectionFlags = PxVisualDebuggerConnectionFlag::Profile;
#endif

	//Create a pvd connection that writes data straight to the filesystem.  This is
	//the fastest connection on windows for various reasons.  First, the transport is quite fast as
	//pvd writes data in blocks and filesystems work well with that abstraction.
	//Second, you don't have the PVD application parsing data and using CPU and memory bandwidth
	//while your application is running.
	//PxExtensionVisualDebugger::connect(pvd,"c:\\temp.pxd2", PxDebuggerConnectionFlags( (PxU32)theConnectionFlags));
	
	//The normal way to connect to pvd.  PVD needs to be running at the time this function is called.
	//We don't worry about the return value because we are already registered as a listener for connections
	//and thus our onPvdConnected call will take care of setting up our basic connection state.
#ifdef BETA2
	PxExtensionVisualDebugger::connect(pvd, PVD_HOST, 5425, 10, PxDebuggerConnectionFlags( (PxU32)theConnectionFlags) );
#else
	PVD::PvdConnection* theConnection = PxVisualDebuggerExt::createConnection(mPhysics->getPvdConnectionManager(), PVD_HOST, 5425, 10, theConnectionFlags );
	if(theConnection)
		theConnection->release();
#endif
}
开发者ID:Pierre-Terdiman,项目名称:PEEL,代码行数:58,代码来源:PINT_PhysX32.cpp

示例3: PxInitExtensions

bool PxInitExtensions(PxPhysics& physics)
{
    PX_ASSERT(static_cast<Ps::Foundation*>(&physics.getFoundation()) == &Ps::Foundation::getInstance());
    Ps::Foundation::incRefCount();

    physics.registerClass(PxConcreteType::eUSER_SPHERICAL_JOINT,	Ext::SphericalJoint::createInstance);
    physics.registerClass(PxConcreteType::eUSER_REVOLUTE_JOINT,	Ext::RevoluteJoint::createInstance);
    physics.registerClass(PxConcreteType::eUSER_DISTANCE_JOINT,	Ext::DistanceJoint::createInstance);
    physics.registerClass(PxConcreteType::eUSER_D6_JOINT,			Ext::D6Joint::createInstance);
    physics.registerClass(PxConcreteType::eUSER_PRISMATIC_JOINT,	Ext::PrismaticJoint::createInstance);
    physics.registerClass(PxConcreteType::eUSER_FIXED_JOINT,		Ext::FixedJoint::createInstance);
#if PX_SUPPORT_VISUAL_DEBUGGER
    if ( physics.getPvdConnectionManager() != NULL )
        physics.getPvdConnectionManager()->addHandler( gPvdHandler );
#endif
    return true;
}
开发者ID:thomhughes,项目名称:Awe,代码行数:17,代码来源:ExtExtensions.cpp

示例4: togglePvdConnection

void PVDHelper::togglePvdConnection(const EditableParams& params)
{
	PvdConnectionManager* pvd = mPhysics->getPvdConnectionManager();
	if(!pvd)
		return;

	if(pvd->isConnected())
		pvd->disconnect();
	else
		createPvdConnection(params);
}
开发者ID:Pierre-Terdiman,项目名称:PEEL,代码行数:11,代码来源:PINT_PhysX32.cpp


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