Beispiel #1
0
OrientationInterpolatorNode *SceneGraph::findOrientationInterpolatorNode(char *name) {
	if (!name || strlen(name) <= 0)
		return NULL;
	for (OrientationInterpolatorNode *node = findOrientationInterpolatorNode(); node; node = node->nextTraversal()) {
		const char *nodeName = node->getName();
		if (nodeName && strlen(nodeName)) {
			if (!strcmp(name, nodeName))
				return node;
		}
	}
	return NULL;
}
Beispiel #2
0
void AddSFRotation(float rotation[4])
{	
    switch (GetCurrentNodeType()) {
	case VRML_NODETYPE_EXTRUSION_ORIENTATION:
		{
			ExtrusionNode *ex = (ExtrusionNode *)GetCurrentNodeObject();
			ex->addOrientation(rotation);
		}
		break;
	case VRML_NODETYPE_INTERPOLATOR_KEYVALUE:
		switch (GetPrevNodeType()) {
		case VRML_NODETYPE_ORIENTATIONINTERPOLATOR:
			{
				OrientationInterpolatorNode *oriInterp = (OrientationInterpolatorNode *)GetCurrentNodeObject();
				oriInterp->addKeyValue(rotation);
			}
			break;
		}
	}
}
void CyberX3D::AddSFRotation(float rotation[4])
{	
    switch (ParserGetCurrentNodeType()) {
	case VRML97_EXTRUSION_ORIENTATION:
		{
			ExtrusionNode *ex = (ExtrusionNode *)ParserGetCurrentNode();
			ex->addOrientation(rotation);
		}
		break;
	case VRML97_INTERPOLATOR_KEYVALUE:
		switch (ParserGetParentNodeType()) {
		case VRML97_ORIENTATIONINTERPOLATOR:
			{
				OrientationInterpolatorNode *oriInterp = (OrientationInterpolatorNode *)ParserGetCurrentNode();
				oriInterp->addKeyValue(rotation);
			}
			break;
		}
	}
}
Beispiel #4
0
void AddSFFloat(float value)
{	
    switch (GetCurrentNodeType()) {
	case VRML_NODETYPE_ELEVATIONGRID_HEIGHT:
		{
			ElevationGridNode *elev = (ElevationGridNode *)GetCurrentNodeObject();
			elev->addHeight(value);
		}
		break;
    case VRML_NODETYPE_BACKGROUND_GROUNDANGLE:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addGroundAngle(value);
		}		
	    break;
    case VRML_NODETYPE_BACKGROUND_SKYANGLE:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addSkyAngle(value);
		}		
	    break;
	case VRML_NODETYPE_INTERPOLATOR_KEY:
		switch (GetPrevNodeType()) {
		case VRML_NODETYPE_COLORINTERPOLATOR:
			{
				ColorInterpolatorNode *colorInterp = (ColorInterpolatorNode *)GetCurrentNodeObject();
				colorInterp->addKey(value);
			}
			break;
		case VRML_NODETYPE_COORDINATEINTERPOLATOR:
			{
				CoordinateInterpolatorNode *coordInterp = (CoordinateInterpolatorNode *)GetCurrentNodeObject();
				coordInterp->addKey(value);
			}
			break;
		case VRML_NODETYPE_NORMALINTERPOLATOR:
			{
				NormalInterpolatorNode *normInterp = (NormalInterpolatorNode *)GetCurrentNodeObject();
				normInterp->addKey(value);
			}
			break;
		case VRML_NODETYPE_ORIENTATIONINTERPOLATOR:
			{
				OrientationInterpolatorNode *oriInterp = (OrientationInterpolatorNode *)GetCurrentNodeObject();
				oriInterp->addKey(value);
			}
			break;
		case VRML_NODETYPE_POSITIONINTERPOLATOR:
			{
				PositionInterpolatorNode *posInterp = (PositionInterpolatorNode *)GetCurrentNodeObject();
				posInterp->addKey(value);
			}
			break;
		case VRML_NODETYPE_SCALARINTERPOLATOR:
			{
				ScalarInterpolatorNode *scalarInterp = (ScalarInterpolatorNode *)GetCurrentNodeObject();
				scalarInterp->addKey(value);
			}
			break;
		}
		break;
	case VRML_NODETYPE_INTERPOLATOR_KEYVALUE:
		switch (GetPrevNodeType()) {
		case VRML_NODETYPE_SCALARINTERPOLATOR:
			{
				ScalarInterpolatorNode *scalarInterp = (ScalarInterpolatorNode *)GetCurrentNodeObject();
				scalarInterp->addKeyValue(value);
			}
			break;
		}
		break;
	case VRML_NODETYPE_LOD_RANGE:
		{
			((LodNode *)GetCurrentNodeObject())->addRange(value);
		}
		break;
	case VRML_NODETYPE_NAVIGATIONINFO_AVATARSIZE:
		{
			NavigationInfoNode *navInfo = (NavigationInfoNode *)GetCurrentNodeObject();
			navInfo->addAvatarSize(value);
		}
		break;
	case VRML_NODETYPE_TEXT_LENGTH:
		{
			TextNode *text = (TextNode *)GetCurrentNodeObject();
			text->addLength(value);
		}
		break;
    }
}