void VisualDebugger::setActors( physx::debugger::comm::PvdDataStream& inStream, const PxJoint& inJoint, const PxConstraint& c, const PxActor* newActor0, const PxActor* newActor1 )
	{
		PxRigidActor* actor0, *actor1;
		c.getActors( actor0, actor1 );
		if ( actor0 )
			inStream.removeObjectRef( (PxActor*)actor0, "Joints", &inJoint );
		if ( actor1 )
			inStream.removeObjectRef( (PxActor*)actor1, "Joints", &inJoint );

		if ( newActor0 )
			inStream.pushBackObjectRef( newActor0, "Joints", &inJoint );
		if ( newActor1 )
			inStream.pushBackObjectRef( newActor1, "Joints", &inJoint );
		inStream.setPropertyValue( &inJoint, "Actors.actor0", (const void*)newActor0 );
		inStream.setPropertyValue( &inJoint, "Actors.actor1", (const void*)newActor1 );
		const void* parent = newActor0 ? (const void*)newActor0 : (const void*) newActor1;
		inStream.setPropertyValue( &inJoint, "Parent", parent );
	}
コード例 #2
0
void ModuleClothing::initPvdInstances(physx::debugger::comm::PvdDataStream& pvdStream)
{
	// if there's more than one AOFactory we don't know any more for sure that its a clothing asset factory, so we have to adapt the code below
	PX_ASSERT(mAssetAuthorableObjectFactories.getSize() == 1 && "Adapt the code below");

	PVD::PvdBinding* pvdBinding = NxGetApexSDK()->getPvdBinding();
	PX_ASSERT(pvdBinding != NULL);

	// Module Params
	pvdStream.createInstance(NamespacedName(APEX_PVD_NAMESPACE, "ClothingModuleParameters"), mModuleParams);
	pvdStream.setPropertyValue(mApiProxy, "ModuleParams", DataRef<const PxU8>((const PxU8*)&mModuleParams, sizeof(ClothingModuleParameters*)), getPvdNamespacedNameForType<ObjectRef>());
	// update module properties (should we do this per frame? if so, how?)
	pvdBinding->updatePvd(mModuleParams, *mModuleParams);

	// prepare asset list and forward init calls
	NiApexAuthorableObject* ao = static_cast<NiApexAuthorableObject*>(mAssetAuthorableObjectFactories.getResource(0));
	ao->mAssets.initPvdInstances(pvdStream);
}