Checked in Macro Jez's additions to osgText to support .osg IO make it
a fully functioning NodeKit. Also reimplement notify() to try an prevent a crash which has been caused by to objects in notify.cpp being initiliazed twice, the second time the auto_ptr holding the dev/null ofstream was being initilized to 0.
This commit is contained in:
@@ -39,7 +39,6 @@ bool Transform_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
Transform& transform = static_cast<Transform&>(obj);
|
||||
|
||||
|
||||
if (fr[0].matchWord("Type"))
|
||||
{
|
||||
if (fr[1].matchWord("DYNAMIC"))
|
||||
@@ -69,6 +68,19 @@ bool Transform_readLocalData(Object& obj, Input& fr)
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
if (fr[0].matchWord("referenceFrame")) {
|
||||
if (fr[1].matchWord("RELATIVE_TO_ABSOLUTE")) {
|
||||
transform.setReferenceFrame(Transform::RELATIVE_TO_ABSOLUTE);
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
if (fr[1].matchWord("RELATIVE_TO_PARENTS")) {
|
||||
transform.setReferenceFrame(Transform::RELATIVE_TO_PARENTS);
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
}
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
|
||||
@@ -79,5 +91,15 @@ bool Transform_writeLocalData(const Object& obj, Output& fw)
|
||||
|
||||
fw.writeObject(transform.getMatrix());
|
||||
|
||||
fw.indent() << "referenceFrame ";
|
||||
switch (transform.getReferenceFrame()) {
|
||||
case Transform::RELATIVE_TO_ABSOLUTE:
|
||||
fw << "RELATIVE_TO_ABSOLUTE\n";
|
||||
break;
|
||||
case Transform::RELATIVE_TO_PARENTS:
|
||||
default:
|
||||
fw << "RELATIVE_TO_PARENTS\n";
|
||||
};
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user