예제 #1
0
void SoundNode::outputContext(std::ostream &printStream, const char *indentString) const
{
	SFBool *spatialize = getSpatializeField();
	SFVec3f *direction = getDirectionField();
	SFVec3f *location = getLocationField();

	printStream << indentString << "\t" << "direction " << direction << std::endl;
	printStream << indentString << "\t" << "location " << location << std::endl;
	printStream << indentString << "\t" << "maxFront " << getMaxFront() << std::endl;
	printStream << indentString << "\t" << "minFront " << getMinFront() << std::endl;
	printStream << indentString << "\t" << "maxBack " << getMaxBack() << std::endl;
	printStream << indentString << "\t" << "minBack " << getMinBack() << std::endl;
	printStream << indentString << "\t" << "intensity " << getIntensity() << std::endl;
	printStream << indentString << "\t" << "priority " << getPriority() << std::endl;
	printStream << indentString << "\t" << "spatialize " << spatialize << std::endl;

	AudioClipNode *aclip = getAudioClipNodes();
	if (aclip != NULL) {
		if (aclip->isInstanceNode() == false) {
			if (aclip->getName() != NULL && strlen(aclip->getName()))
				printStream << indentString << "\t" << "source " << "DEF " << aclip->getName() << " AudioClip {" << std::endl;
			else
				printStream << indentString << "\t" << "source AudioClip {" << std::endl;
			aclip->Node::outputContext(printStream, indentString, "\t");
			printStream << indentString << "\t" << "}" << std::endl;
		}
		else 
			printStream << indentString << "\t" << "source USE " << aclip->getName() << std::endl;
	}

	MovieTextureNode *mtexture = getMovieTextureNodes();
	if (mtexture != NULL) {
		if (mtexture->isInstanceNode() == false) {
			if (mtexture->getName() != NULL && strlen(mtexture->getName()))
				printStream << indentString << "\t" << "source " << "DEF " << mtexture->getName() << " MovieTexture {" << std::endl;
			else
				printStream << indentString << "\t" << "source MovieTexture {" << std::endl;
			mtexture->Node::outputContext(printStream, indentString, "\t");
			printStream << indentString << "\t" << "}" << std::endl;
		}
		else 
			printStream << indentString << "\t" << "source USE " << mtexture->getName() << std::endl;
	}
}
예제 #2
0
AudioClipNode *SceneGraph::findAudioClipNode(char *name) {
	if (!name || strlen(name) <= 0)
		return NULL;
	for (AudioClipNode *node = findAudioClipNode(); node; node = node->nextTraversal()) {
		const char *nodeName = node->getName();
		if (nodeName && strlen(nodeName)) {
			if (!strcmp(name, nodeName))
				return node;
		}
	}
	return NULL;
}