Hi Cyril,

On 12/5/09 4:09 AM, Cyril Brulebois wrote:
coordinates back. After a quick look, I figured I might be able to
transform an MT into a Transform, and then back into a PAT using the
following:
|   MatrixTransform *mt = new MatrixTransform();
|...   {
|   Transform *t = mt->asTransform();
|...
|   Transform *pat = t->asPositionAttitudeTransform();
|   assert(pat!=0);

I'm getting that:
| a.out: asPAT.cpp:27: int main(): Assertion `pat!=0' failed.

Should I understand that those functions, mimicking dynamic_cast calls,
would only work when a PAT object gets casted into a Transform one and
then back to a PAT object?

No that can never work. asPAT() does a dynamic_cast<> as you say, so you can convert a MatrixTransform to any class it's derived from but not to a class that itself is derived from MT (such as PAT).

You'll need to get the information you require from the Matrix.

Cheers,
/uli
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to