Ejemplo n.º 1
0
 virtual void onPvdSendClassDescriptions( physx::debugger::comm::PvdConnection& inFactory )
 {
     using namespace physx::debugger;
     //register the joint classes.
     PvdDataStream* connection = &inFactory.createDataStream();
     connection->addRef();
     Ext::VisualDebugger::sendClassDescriptions( *connection );
     connection->flush();
     connection->release();
 }
Ejemplo n.º 2
0
	void onPvdConnected()
	{
		PvdDataStream* stream = PvdDataStream::create(mPvd);
		if(stream)
		{
			mConnected = true;
			Ext::Pvd::sendClassDescriptions(*stream);	
			stream->release();
		}		
	}
Ejemplo n.º 3
0
bool PvdImpl::connect(PxPvdTransport& transport, PxPvdInstrumentationFlags flags)
{
	if(mIsConnected)
	{
		physx::shdfnd::getFoundation().error(PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, "PxPvd::connect - recall connect! Should call disconnect before re-connect.");
	    return false;
	}

	mFlags = flags;	
	mPvdTransport = &transport;

	mIsConnected = mPvdTransport->connect();

	if(mIsConnected)
	{
		mSharedMetaProvider = PVD_NEW(MetaDataProvider);
		sendTransportInitialization();

		PvdDataStream* stream = PvdDataStream::create(this);
		initializeModelTypes(*stream);
		stream->release();

		if(mFlags & PxPvdInstrumentationFlag::eMEMORY)
		{
			mMemClient = PVD_NEW(PvdMemClient)(*this);
			mPvdClients.pushBack(mMemClient);
		}

		if((mFlags & PxPvdInstrumentationFlag::ePROFILE) && mProfileZoneManager)
		{			
			mPvdClients.pushBack(mProfileClient);
			mProfileZone = &physx::profile::PxProfileZone::createProfileZone(&physx::shdfnd::getAllocator(),gSdkName,gProfileNameProvider.getProfileNames());
		}

		for(uint32_t i = 0; i < mPvdClients.size(); i++)
			mPvdClients[i]->onPvdConnected();

		if (mProfileZone)
		{
			mProfileZoneManager->addProfileZoneHandler(*mProfileClient);
			mProfileZoneManager->addProfileZone( *mProfileZone );
		}

		if ((mFlags & PxPvdInstrumentationFlag::ePROFILE))
		{
			PxSetProfilerCallback(this);
		}
	}
	return mIsConnected;
}
Ejemplo n.º 4
0
	void createInstance( PvdDataStream& inStream, const PxConstraint& c, const TObjType& inSource )
	{
		const PxJoint* theJoint = &inSource;
		PxRigidActor* actor0, *actor1;
		c.getActors( actor0, actor1 );
		inStream.createInstance( &inSource );
		inStream.pushBackObjectRef( c.getScene(), "Joints", (const void*)theJoint );
		if ( actor0 && (actor0->getScene() != NULL ) )
			inStream.pushBackObjectRef( (PxActor*)actor0, "Joints", theJoint );
		if ( actor1 && (actor1->getScene() != NULL ))
			inStream.pushBackObjectRef( (PxActor*)actor1, "Joints", theJoint );
		const void* parent = actor0 ? (const void*)actor0 : (const void*) actor1;
		inStream.setPropertyValue( theJoint, "Parent", parent );
	}
Ejemplo n.º 5
0
	void registerProperties( PvdDataStream& inStream )
	{
		inStream.createClass<TObjType>();
		PvdPropertyDefinitionHelper& theHelper( inStream.getPropertyDefinitionHelper() );
		PvdClassInfoDefine theDefinitionObj( theHelper, getPvdNamespacedNameForType<TObjType>() );
		visitPvdInstanceProperties<TObjType>( theDefinitionObj );
	}
Ejemplo n.º 6
0
	void registerPropertiesAndValueStruct( PvdDataStream& inStream )
	{
		inStream.createClass<TObjType>();
		inStream.deriveClass<PxJoint,TObjType>();
		PvdPropertyDefinitionHelper& theHelper( inStream.getPropertyDefinitionHelper() );
		{
			PvdClassInfoDefine theDefinitionObj( theHelper, getPvdNamespacedNameForType<TObjType>() );
			visitPvdInstanceProperties<TObjType>( theDefinitionObj );
		}
		{
			PvdClassInfoValueStructDefine theDefinitionObj( theHelper );
			visitPvdProperties<TObjType>( theDefinitionObj );
			theHelper.addPropertyMessage<TObjType,TValueStructType>();
		}
	}
Ejemplo n.º 7
0
	void sendAllProperties( PvdDataStream& inStream, const TObjType& inSource )
	{
		TValueStructType theValueStruct( &inSource );
		inStream.setPropertyMessage( &inSource, theValueStruct );
	}