Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Projectors - an object that projects a texture onto a surface. In order to get this new feature in gz-rendering7 in an ABI compatible way, I introduced a new SceneExt class that provides a generic CreateExt function for creating a Projector object. The proper way is to add CreateProjector virtual function in base class and override them in ogre 1.x and 2.x implementation which changes vtable and so breaks ABI. I have added all these functions but they are commented out with a todo not to uncomment them when forward porting to gz-rendering8 * The ogre 1.x implementation is ported from gazebo-classic's Projector class. It uses ogre material projective texturing feature. in addition, I extended the implementation to support visibility flags so that we can toggle the visibility of the projected texture based on the camera's visibility mask. * The ogre 2.x implementation uses screen space decals (instead of projective texturing) and has a different behavior. Also added support for setting visibility flags. Note: There is one major caveat with this implementation. The projection is not in the form of a "frustum" (i.e. projection becomes larger at longer distance). It uses ogre 2.x screen space decals. Think of a as a rectangular volume and any surface that intersects with the volume will have the texture mapped onto it. We will need to investigate whether it's possible to change the implementation to match the ogre 1.x behavior in the future. --------- Signed-off-by: Ian Chen <[email protected]>
- Loading branch information