18 #include <QDomDocument>
25 QDomElement elemLight = doc.createElement( QStringLiteral(
"point-light" ) );
26 elemLight.setAttribute( QStringLiteral(
"x" ), mPosition.
x() );
27 elemLight.setAttribute( QStringLiteral(
"y" ), mPosition.
y() );
28 elemLight.setAttribute( QStringLiteral(
"z" ), mPosition.
z() );
30 elemLight.setAttribute( QStringLiteral(
"intensity" ), mIntensity );
31 elemLight.setAttribute( QStringLiteral(
"attenuation-0" ), mConstantAttenuation );
32 elemLight.setAttribute( QStringLiteral(
"attenuation-1" ), mLinearAttenuation );
33 elemLight.setAttribute( QStringLiteral(
"attenuation-2" ), mQuadraticAttenuation );
39 mPosition.
set( elem.attribute( QStringLiteral(
"x" ) ).toDouble(),
40 elem.attribute( QStringLiteral(
"y" ) ).toDouble(),
41 elem.attribute( QStringLiteral(
"z" ) ).toDouble() );
43 mIntensity = elem.attribute( QStringLiteral(
"intensity" ) ).toFloat();
44 mConstantAttenuation = elem.attribute( QStringLiteral(
"attenuation-0" ) ).toDouble();
45 mLinearAttenuation = elem.attribute( QStringLiteral(
"attenuation-1" ) ).toDouble();
46 mQuadraticAttenuation = elem.attribute( QStringLiteral(
"attenuation-2" ) ).toDouble();
51 return mPosition == other.mPosition && mColor == other.mColor && mIntensity == other.mIntensity &&
52 mConstantAttenuation == other.mConstantAttenuation && mLinearAttenuation == other.mLinearAttenuation &&
53 mQuadraticAttenuation == other.mQuadraticAttenuation;