void VisualDebugger::releasePvdInstance(physx::debugger::comm::PvdDataStream& pvdConnection, const PxConstraint& c, const PxJoint& joint) { if(!pvdConnection.isConnected()) return; //remove from scene and from any attached actors. PxRigidActor* actor0, *actor1; c.getActors( actor0, actor1 ); pvdConnection.removeObjectRef( c.getScene(), "Joints", &joint ); if ( actor0 ) pvdConnection.removeObjectRef( actor0, "Joints", &joint ); if ( actor1 ) pvdConnection.removeObjectRef( actor1, "Joints", &joint ); pvdConnection.destroyInstance(&joint); }
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 ); }