Replies: 2 comments
-
Do you mean PositionAttitudeTransform? You can't just use dynamic_cast<> on objects within testing the result, if the object isn't of that type then C++ will return a NULL pointer which will of course cause a seg fault. This is basic C++ and really not OSG so I have to recommend you read up about how dynamic_cast<> works. PositionAttitudeTransform is a transform node in it's own right, you can't use it in place/as vsg::Camera. The vsg::Camera::setViewMatrix() methods are what you'll need to use to control it. |
Beta Was this translation helpful? Give feedback.
-
What I was asking is because the Camera is a Transform and so is a PositionAttitudeTransform, so I thought I could use dynamic_cast to treat a Camera like a PositionAttitudeTransform; but that is evidently not the case given your answer and my experience.
Okay, I will use those then. Sorry about reopening the discussion, but how would I then rotate the Camera in place, after translating it so that it rotates like in this image after being translated: |
Beta Was this translation helpful? Give feedback.
-
Hi,
It's pretty easy to manipulate a Transform using the PositionAttitudeTransform class and it I would like to use it to manipulate the cameras positon and transform; when I try to do this with a dynamic cast it ends up seg faulting. What would be the best way to do this?
NOTE: My goal really is to rotate the camera and translate it independent of eachother and by what I have learned so far the PositionAttitutudeTransform is the easiest way for me to do that. But I'd be happy to rotate and translate the camera using any method.
Beta Was this translation helpful? Give feedback.
All reactions