Hey there guys, i'm having a bit of trouble, probably stemming from the fact that my coding is rudamentary :)
XML Document
<?xml version="1.0"?> <data> <PositionX x='0' /> <PositionY y='-200' /> <PositionZ z='0' /> <ScalingX x='0.4' /> <ScalingY y='0.4' /> <ScalingZ z='0.4' /> <CenterX x='0' /> <CenterY y='0' /> <CenterZ z='0' /> <Radius x='1000' /> <Speed x='200' /> <Direction x='0' /> </data>
Coding
fileName.append(".xml"); IrrXMLReader* reader = createIrrXMLReader(fileName.c_str());
// parse the file until end reached while(reader->read()) { if (!strcmp("PositionX", reader->getNodeName())) posX = reader->getAttributeValueAsFloat("x"); else if (!strcmp("ScalingX", reader->getNodeName())) scaleX = reader->getAttributeValueAsFloat("x"); else if (!strcmp("CenterX", reader->getNodeName())) rotationCenterX = reader->getAttributeValueAsFloat("x"); else if (!strcmp("PositionY", reader->getNodeName())) posY = reader->getAttributeValueAsFloat("y"); else if (!strcmp("ScalingY", reader->getNodeName())) scaleY = reader->getAttributeValueAsFloat("y"); else if (!strcmp("CenterY", reader->getNodeName())) rotationCenterY = reader->getAttributeValueAsFloat("y"); else if (!strcmp("PositionZ", reader->getNodeName())) posZ = reader->getAttributeValueAsFloat("z"); else if (!strcmp("ScalingZ", reader->getNodeName())) scaleZ = reader->getAttributeValueAsFloat("z"); else if (!strcmp("CenterZ", reader->getNodeName())) rotationCenterZ = reader->getAttributeValueAsFloat("z"); else if (!strcmp("Radius", reader->getNodeName())) radius = reader->getAttributeValueAsFloat("x"); else if (!strcmp("Speed", reader->getNodeName())) speed = reader->getAttributeValueAsFloat("x"); else if (!strcmp("Direction", reader->getNodeName())) direction = reader->getAttributeValueAsFloat("x"); break; };
// delete the xml parser after usage delete reader;
It appears to read all values at 0. But then again I do have within my code settings to 0 within my constr
|