osg::PositionAttitudeTransform equivalent class in vsg #704
-
I am currently rewriting code that uses OpenSceneGraph to use VulkanSceneGraph. Now I have some code that uses a class called osg::PositionAttitudeTransform and it seems that it is a class that makes translation and rotation of subgraphs easy. However, I cannot find an equivalent class in VulkanSceneGraph. Is there a way I can achieve the same behavior in VulkanSceneGraph? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I haven't implemented an directly replacement for osg::PositionAttitudeTransform in the VSG, but I've implemented variations on this several times for different client projects by subclassing from vsg::Transform and override the transform method:
The are currently two subclasses from Transform in the core VSG that could be used as a guide to what is required:
Potentially we could include a vsg::PositionAttitudeTransform if it's something that will be widely used, or we could just leave this up to the user to create the transform subclasses that suit them best - for instance not everyone will need a scale and pivot point etc. If you want to use existing VSG without subclassesing from vsg::Transform the way to do it would be to use a MatrixTransfom and set the matrix member directly i.e.
This will be just fine if you just set the Transform node and then don't modify it, but if you need to keep updating the position and attitude then you'd end up forced to hold this members somewhere and keep applying them to the MatrixTransform when they are updated. In this case it might be easier to just implement a subclass of Transform, |
Beta Was this translation helpful? Give feedback.
I haven't implemented an directly replacement for osg::PositionAttitudeTransform in the VSG, but I've implemented variations on this several times for different client projects by subclassing from vsg::Transform and override the transform method:
The are currently two subclasses from Transform in the core VSG that could be used as a guide to what is required:
Potentially we could include a vsg::PositionAttitudeTransform if it's something that will be widely used, …