Renamed osg::CameraNode to osg::Camera, cleaned up osg::View.
Added beginnings of new osgViewer::Scene,View,Viewer,CompositeViewer and GraphicsWindowProxy files.
This commit is contained in:
parent
b82e521444
commit
fd2ffeb310
@ -24,7 +24,7 @@ Windows Registry Editor Version 5.00
|
||||
"buffered_value"=""
|
||||
"BufferObject"=""
|
||||
"BumpMapping"=""
|
||||
"CameraNode"=""
|
||||
"Camera"=""
|
||||
"CameraView"=""
|
||||
"Cartoon"=""
|
||||
"CenteredPlacer"=""
|
||||
|
@ -24,7 +24,7 @@ Windows Registry Editor Version 5.00
|
||||
"buffered_value"=""
|
||||
"BufferObject"=""
|
||||
"BumpMapping"=""
|
||||
"CameraNode"=""
|
||||
"Camera"=""
|
||||
"CameraView"=""
|
||||
"Cartoon"=""
|
||||
"CenteredPlacer"=""
|
||||
|
@ -24,7 +24,7 @@ Windows Registry Editor Version 5.00
|
||||
"buffered_value"=""
|
||||
"BufferObject"=""
|
||||
"BumpMapping"=""
|
||||
"CameraNode"=""
|
||||
"Camera"=""
|
||||
"CameraView"=""
|
||||
"Cartoon"=""
|
||||
"CenteredPlacer"=""
|
||||
|
@ -208,7 +208,7 @@ SOURCE=..\..\src\osg\BufferObject.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osg\CameraNode.cpp
|
||||
SOURCE=..\..\src\osg\Camera.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@ -676,7 +676,7 @@ SOURCE=..\..\include\osg\BufferObject
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\osg\CameraNode
|
||||
SOURCE=..\..\include\osg\Camera
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
|
@ -193,7 +193,7 @@ SOURCE=..\..\..\src\osgPlugins\ive\BlinkSequence.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\CameraNode.cpp
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\Camera.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@ -553,7 +553,7 @@ SOURCE=..\..\..\src\osgPlugins\ive\BlinkSequence.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\CameraNode.h
|
||||
SOURCE=..\..\..\src\osgPlugins\ive\Camera.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
|
@ -177,7 +177,7 @@ SOURCE=..\..\..\src\osgPlugins\osg\BlendFunc.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osg\CameraNode.cpp
|
||||
SOURCE=..\..\..\src\osgPlugins\osg\Camera.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
|
@ -155,6 +155,22 @@ LIB32=link.exe -lib
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osgViewer\View.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osgViewer\Viewer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osgViewer\CompositeViewer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osgViewer\Scene.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\osgViewer\SimpleViewer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -175,6 +191,26 @@ SOURCE=..\..\Include\osgViewer\GraphicsWindow
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\osgViewer\GraphicsWindowProxy
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\osgViewer\Scene
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\osgViewer\View
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\osgViewer\Viewer
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\osgViewer\CompositeViewer
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Include\osgViewer\SimpleViewer
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -148,7 +148,7 @@ SOURCE=..\..\..\src\osgWrappers\osg\BufferObject.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osg\CameraNode.cpp
|
||||
SOURCE=..\..\..\src\osgWrappers\osg\Camera.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
|
@ -96,17 +96,33 @@ LINK32=link.exe
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\Export.cpp
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\CompositeViewer.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\GraphicsWindow.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\GraphicsWindowProxy.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\Scene.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\SimpleViewer.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\View.cpp
|
||||
# End Source File
|
||||
|
||||
# Begin Source File
|
||||
SOURCE=..\..\..\src\osgWrappers\osgViewer\Viewer.cpp
|
||||
# End Source File
|
||||
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
|
@ -1509,10 +1509,10 @@
|
||||
006CE73809218D9400985402 /* Viewport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE73209218D9300985402 /* Viewport.cpp */; };
|
||||
006CE73909218D9400985402 /* Viewport.h in Headers */ = {isa = PBXBuildFile; fileRef = 006CE73309218D9300985402 /* Viewport.h */; };
|
||||
006CE73B09218DEE00985402 /* Scissor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE73A09218DEE00985402 /* Scissor.cpp */; };
|
||||
006CE73E09218E2400985402 /* CameraNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE73C09218E2300985402 /* CameraNode.cpp */; };
|
||||
006CE73E09218E2400985402 /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE73C09218E2300985402 /* Camera.cpp */; };
|
||||
006CE73F09218E2400985402 /* CameraView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE73D09218E2400985402 /* CameraView.cpp */; };
|
||||
006CE74409218E6900985402 /* CameraNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE74009218E6800985402 /* CameraNode.cpp */; };
|
||||
006CE74509218E6900985402 /* CameraNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 006CE74109218E6800985402 /* CameraNode.h */; };
|
||||
006CE74409218E6900985402 /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE74009218E6800985402 /* Camera.cpp */; };
|
||||
006CE74509218E6900985402 /* Camera.h in Headers */ = {isa = PBXBuildFile; fileRef = 006CE74109218E6800985402 /* Camera.h */; };
|
||||
006CE74609218E6900985402 /* CameraView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 006CE74209218E6800985402 /* CameraView.cpp */; };
|
||||
006CE74709218E6900985402 /* CameraView.h in Headers */ = {isa = PBXBuildFile; fileRef = 006CE74309218E6900985402 /* CameraView.h */; };
|
||||
006CE7FF092195B500985402 /* OverlayNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0096C5FA0919637300B255F2 /* OverlayNode.cpp */; };
|
||||
@ -1707,7 +1707,7 @@
|
||||
0096C51309195DBF00B255F2 /* StateGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0096C51109195DBE00B255F2 /* StateGraph.cpp */; };
|
||||
0096C51409195E3E00B255F2 /* PositionalStateContainer in Headers */ = {isa = PBXBuildFile; fileRef = 0096C50C09195D8B00B255F2 /* PositionalStateContainer */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C51509195E3E00B255F2 /* StateGraph in Headers */ = {isa = PBXBuildFile; fileRef = 0096C50D09195D8B00B255F2 /* StateGraph */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C54309195F3E00B255F2 /* CameraNode in Headers */ = {isa = PBXBuildFile; fileRef = 0096C51909195F1000B255F2 /* CameraNode */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C54309195F3E00B255F2 /* Camera in Headers */ = {isa = PBXBuildFile; fileRef = 0096C51909195F1000B255F2 /* Camera */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C54409195F3E00B255F2 /* CameraView in Headers */ = {isa = PBXBuildFile; fileRef = 0096C51A09195F1000B255F2 /* CameraView */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C54509195F3E00B255F2 /* FrameBufferObject in Headers */ = {isa = PBXBuildFile; fileRef = 0096C51B09195F1000B255F2 /* FrameBufferObject */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C54609195F3E00B255F2 /* GraphicsContext in Headers */ = {isa = PBXBuildFile; fileRef = 0096C51C09195F1000B255F2 /* GraphicsContext */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
@ -1721,7 +1721,7 @@
|
||||
0096C54E09195F3E00B255F2 /* Vec4b in Headers */ = {isa = PBXBuildFile; fileRef = 0096C52409195F1200B255F2 /* Vec4b */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C54F09195F3E00B255F2 /* Vec4s in Headers */ = {isa = PBXBuildFile; fileRef = 0096C52509195F1300B255F2 /* Vec4s */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C55009195F3E00B255F2 /* Vec4ub in Headers */ = {isa = PBXBuildFile; fileRef = 0096C52609195F1300B255F2 /* Vec4ub */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
0096C55A09195FE500B255F2 /* CameraNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0096C55309195FE300B255F2 /* CameraNode.cpp */; };
|
||||
0096C55A09195FE500B255F2 /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0096C55309195FE300B255F2 /* Camera.cpp */; };
|
||||
0096C55B09195FE500B255F2 /* CameraView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0096C55409195FE300B255F2 /* CameraView.cpp */; };
|
||||
0096C55C09195FE500B255F2 /* FrameBufferObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0096C55509195FE400B255F2 /* FrameBufferObject.cpp */; };
|
||||
0096C55D09195FE500B255F2 /* GraphicsContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0096C55609195FE400B255F2 /* GraphicsContext.cpp */; };
|
||||
@ -5521,10 +5521,10 @@
|
||||
006CE73209218D9300985402 /* Viewport.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = Viewport.cpp; sourceTree = "<group>"; };
|
||||
006CE73309218D9300985402 /* Viewport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Viewport.h; sourceTree = "<group>"; };
|
||||
006CE73A09218DEE00985402 /* Scissor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = Scissor.cpp; sourceTree = "<group>"; };
|
||||
006CE73C09218E2300985402 /* CameraNode.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = CameraNode.cpp; sourceTree = "<group>"; };
|
||||
006CE73C09218E2300985402 /* Camera.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = Camera.cpp; sourceTree = "<group>"; };
|
||||
006CE73D09218E2400985402 /* CameraView.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = CameraView.cpp; sourceTree = "<group>"; };
|
||||
006CE74009218E6800985402 /* CameraNode.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = CameraNode.cpp; sourceTree = "<group>"; };
|
||||
006CE74109218E6800985402 /* CameraNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CameraNode.h; sourceTree = "<group>"; };
|
||||
006CE74009218E6800985402 /* Camera.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = Camera.cpp; sourceTree = "<group>"; };
|
||||
006CE74109218E6800985402 /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = "<group>"; };
|
||||
006CE74209218E6800985402 /* CameraView.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = CameraView.cpp; sourceTree = "<group>"; };
|
||||
006CE74309218E6900985402 /* CameraView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CameraView.h; sourceTree = "<group>"; };
|
||||
006CE90B0921A83D00985402 /* osgcamera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = osgcamera.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@ -5651,7 +5651,7 @@
|
||||
0096C50D09195D8B00B255F2 /* StateGraph */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = StateGraph; path = ../../include/osgUtil/StateGraph; sourceTree = SOURCE_ROOT; };
|
||||
0096C51009195DBE00B255F2 /* PositionalStateContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PositionalStateContainer.cpp; path = ../../src/osgUtil/PositionalStateContainer.cpp; sourceTree = SOURCE_ROOT; };
|
||||
0096C51109195DBE00B255F2 /* StateGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = StateGraph.cpp; path = ../../src/osgUtil/StateGraph.cpp; sourceTree = SOURCE_ROOT; };
|
||||
0096C51909195F1000B255F2 /* CameraNode */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CameraNode; sourceTree = "<group>"; };
|
||||
0096C51909195F1000B255F2 /* Camera */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Camera; sourceTree = "<group>"; };
|
||||
0096C51A09195F1000B255F2 /* CameraView */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CameraView; sourceTree = "<group>"; };
|
||||
0096C51B09195F1000B255F2 /* FrameBufferObject */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = FrameBufferObject; sourceTree = "<group>"; };
|
||||
0096C51C09195F1000B255F2 /* GraphicsContext */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = GraphicsContext; sourceTree = "<group>"; };
|
||||
@ -5665,7 +5665,7 @@
|
||||
0096C52409195F1200B255F2 /* Vec4b */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Vec4b; sourceTree = "<group>"; };
|
||||
0096C52509195F1300B255F2 /* Vec4s */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Vec4s; sourceTree = "<group>"; };
|
||||
0096C52609195F1300B255F2 /* Vec4ub */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Vec4ub; sourceTree = "<group>"; };
|
||||
0096C55309195FE300B255F2 /* CameraNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CameraNode.cpp; sourceTree = "<group>"; };
|
||||
0096C55309195FE300B255F2 /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = "<group>"; };
|
||||
0096C55409195FE300B255F2 /* CameraView.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CameraView.cpp; sourceTree = "<group>"; };
|
||||
0096C55509195FE400B255F2 /* FrameBufferObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FrameBufferObject.cpp; sourceTree = "<group>"; };
|
||||
0096C55609195FE400B255F2 /* GraphicsContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext.cpp; sourceTree = "<group>"; };
|
||||
@ -8780,7 +8780,7 @@
|
||||
001D02A3065AACB6003310BF /* AnimationPath.cpp */,
|
||||
001D02A4065AACB6003310BF /* Billboard.cpp */,
|
||||
001D02A5065AACB6003310BF /* BlendFunc.cpp */,
|
||||
006CE73C09218E2300985402 /* CameraNode.cpp */,
|
||||
006CE73C09218E2300985402 /* Camera.cpp */,
|
||||
006CE73D09218E2400985402 /* CameraView.cpp */,
|
||||
001D02A6065AACB6003310BF /* ClearNode.cpp */,
|
||||
0079500C09D36132003FC8A1 /* ClusterCullingCallback.cpp */,
|
||||
@ -8989,8 +8989,8 @@
|
||||
0079500309D360F6003FC8A1 /* Depth.h */,
|
||||
0079500409D360F7003FC8A1 /* TextureRectangle.cpp */,
|
||||
0079500509D360F7003FC8A1 /* TextureRectangle.h */,
|
||||
006CE74009218E6800985402 /* CameraNode.cpp */,
|
||||
006CE74109218E6800985402 /* CameraNode.h */,
|
||||
006CE74009218E6800985402 /* Camera.cpp */,
|
||||
006CE74109218E6800985402 /* Camera.h */,
|
||||
006CE74209218E6800985402 /* CameraView.cpp */,
|
||||
006CE74309218E6900985402 /* CameraView.h */,
|
||||
006CE72E09218D9200985402 /* PolygonMode.cpp */,
|
||||
@ -10833,7 +10833,7 @@
|
||||
BE117FC105D63B8900EB53E5 /* BoundingBox.cpp */,
|
||||
BE117FC205D63B8900EB53E5 /* BoundingSphere.cpp */,
|
||||
009D9F99081D7216001FA987 /* BufferObject.cpp */,
|
||||
0096C55309195FE300B255F2 /* CameraNode.cpp */,
|
||||
0096C55309195FE300B255F2 /* Camera.cpp */,
|
||||
0096C55409195FE300B255F2 /* CameraView.cpp */,
|
||||
004E4CF00A51F17800EC8521 /* ClampColor.cpp */,
|
||||
BE117FC305D63B8900EB53E5 /* ClearNode.cpp */,
|
||||
@ -10979,7 +10979,7 @@
|
||||
BE1181F905D63C0900EB53E5 /* BoundsChecking */,
|
||||
BE1181FA05D63C0900EB53E5 /* buffered_value */,
|
||||
009D9F89081D717F001FA987 /* BufferObject */,
|
||||
0096C51909195F1000B255F2 /* CameraNode */,
|
||||
0096C51909195F1000B255F2 /* Camera */,
|
||||
0096C51A09195F1000B255F2 /* CameraView */,
|
||||
004E4CD70A51F12700EC8521 /* ClampColor */,
|
||||
BE1181FB05D63C0900EB53E5 /* ClearNode */,
|
||||
@ -11818,7 +11818,7 @@
|
||||
006CE73509218D9400985402 /* PolygonMode.h in Headers */,
|
||||
006CE73709218D9400985402 /* Scissor.h in Headers */,
|
||||
006CE73909218D9400985402 /* Viewport.h in Headers */,
|
||||
006CE74509218E6900985402 /* CameraNode.h in Headers */,
|
||||
006CE74509218E6900985402 /* Camera.h in Headers */,
|
||||
006CE74709218E6900985402 /* CameraView.h in Headers */,
|
||||
0079500709D360F7003FC8A1 /* AutoTransform.h in Headers */,
|
||||
0079500909D360F7003FC8A1 /* Depth.h in Headers */,
|
||||
@ -12679,7 +12679,7 @@
|
||||
BE11842C05D70D1800EB53E5 /* BoundsChecking in Headers */,
|
||||
BE11842D05D70D1800EB53E5 /* buffered_value in Headers */,
|
||||
009D9FB3081D7392001FA987 /* BufferObject in Headers */,
|
||||
0096C54309195F3E00B255F2 /* CameraNode in Headers */,
|
||||
0096C54309195F3E00B255F2 /* Camera in Headers */,
|
||||
0096C54409195F3E00B255F2 /* CameraView in Headers */,
|
||||
004E4CD80A51F12800EC8521 /* ClampColor in Headers */,
|
||||
BE11842E05D70D1800EB53E5 /* ClearNode in Headers */,
|
||||
@ -17264,7 +17264,7 @@
|
||||
00A14B36084D61B2000150AD /* Uniform.cpp in Sources */,
|
||||
00A14B37084D61B2000150AD /* Viewport.cpp in Sources */,
|
||||
006CE73B09218DEE00985402 /* Scissor.cpp in Sources */,
|
||||
006CE73E09218E2400985402 /* CameraNode.cpp in Sources */,
|
||||
006CE73E09218E2400985402 /* Camera.cpp in Sources */,
|
||||
006CE73F09218E2400985402 /* CameraView.cpp in Sources */,
|
||||
0079500D09D36132003FC8A1 /* ClusterCullingCallback.cpp in Sources */,
|
||||
);
|
||||
@ -17453,7 +17453,7 @@
|
||||
006CE73409218D9400985402 /* PolygonMode.cpp in Sources */,
|
||||
006CE73609218D9400985402 /* Scissor.cpp in Sources */,
|
||||
006CE73809218D9400985402 /* Viewport.cpp in Sources */,
|
||||
006CE74409218E6900985402 /* CameraNode.cpp in Sources */,
|
||||
006CE74409218E6900985402 /* Camera.cpp in Sources */,
|
||||
006CE74609218E6900985402 /* CameraView.cpp in Sources */,
|
||||
0079500609D360F7003FC8A1 /* AutoTransform.cpp in Sources */,
|
||||
0079500809D360F7003FC8A1 /* Depth.cpp in Sources */,
|
||||
@ -18425,7 +18425,7 @@
|
||||
009D9FA5081D7218001FA987 /* Shader.cpp in Sources */,
|
||||
009D9FA6081D7218001FA987 /* StateAttribute.cpp in Sources */,
|
||||
009D9FA7081D7218001FA987 /* Uniform.cpp in Sources */,
|
||||
0096C55A09195FE500B255F2 /* CameraNode.cpp in Sources */,
|
||||
0096C55A09195FE500B255F2 /* Camera.cpp in Sources */,
|
||||
0096C55B09195FE500B255F2 /* CameraView.cpp in Sources */,
|
||||
0096C55C09195FE500B255F2 /* FrameBufferObject.cpp in Sources */,
|
||||
0096C55D09195FE500B255F2 /* GraphicsContext.cpp in Sources */,
|
||||
|
@ -61,7 +61,7 @@
|
||||
#include <osg/BoundingSphere>
|
||||
#include <osg/BoundsChecking>
|
||||
#include <osg/BufferObject>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/CameraView>
|
||||
#include <osg/ClearNode>
|
||||
#include <osg/ClipNode>
|
||||
|
@ -181,7 +181,7 @@ int main( int argc, char **argv )
|
||||
osgUtil::UpdateVisitor updateVisitor;
|
||||
updateVisitor.setFrameStamp(frameStamp.get());
|
||||
|
||||
typedef std::list< osg::ref_ptr<osg::CameraNode> > CameraList;
|
||||
typedef std::list< osg::ref_ptr<osg::Camera> > CameraList;
|
||||
typedef std::set< osg::GraphicsContext* > GraphicsContextSet;
|
||||
|
||||
CameraList cameraList;
|
||||
@ -192,7 +192,7 @@ int main( int argc, char **argv )
|
||||
osg::GraphicsContext* previousContext = 0;
|
||||
for(unsigned int i=0; i< numberCameras; ++i)
|
||||
{
|
||||
osg::ref_ptr<osg::CameraNode> camera = new osg::CameraNode;
|
||||
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
|
||||
camera->addChild(loadedModel.get());
|
||||
|
||||
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
||||
@ -284,7 +284,7 @@ int main( int argc, char **argv )
|
||||
citr != cameraList.end();
|
||||
++citr)
|
||||
{
|
||||
osg::CameraNode* camera = citr->get();
|
||||
osg::Camera* camera = citr->get();
|
||||
osg::GraphicsThread* graphicsThread = camera->getGraphicsContext()->getGraphicsThread();
|
||||
|
||||
// create a scene view to do the cull and draw
|
||||
|
@ -28,7 +28,7 @@ void CURRENT_CLASS::init()
|
||||
_active = true;
|
||||
_numCameras = 0;
|
||||
setCullingActive(false);
|
||||
_renderOrder = osg::CameraNode::POST_RENDER;
|
||||
_renderOrder = osg::Camera::POST_RENDER;
|
||||
_clearColorBuffer = true;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ void CURRENT_CLASS::setClearColorBuffer(bool clear)
|
||||
{
|
||||
_clearColorBuffer = clear;
|
||||
|
||||
// Update the render order for the first CameraNode if it exists
|
||||
// Update the render order for the first Camera if it exists
|
||||
if(!_cameraList.empty())
|
||||
{
|
||||
if(clear)
|
||||
@ -52,11 +52,11 @@ void CURRENT_CLASS::setClearColorBuffer(bool clear)
|
||||
}
|
||||
}
|
||||
|
||||
void CURRENT_CLASS::setRenderOrder(osg::CameraNode::RenderOrder order)
|
||||
void CURRENT_CLASS::setRenderOrder(osg::Camera::RenderOrder order)
|
||||
{
|
||||
_renderOrder = order;
|
||||
|
||||
// Update the render order for existing CameraNodes
|
||||
// Update the render order for existing Cameras
|
||||
unsigned int numCameras = _cameraList.size();
|
||||
for(unsigned int i = 0; i < numCameras; i++)
|
||||
{
|
||||
@ -104,18 +104,18 @@ void CURRENT_CLASS::traverse(osg::NodeVisitor &nv)
|
||||
_children[i]->accept(*(_distAccumulator.get()));
|
||||
}
|
||||
|
||||
// Step 2: Compute the near and far distances for every CameraNode that
|
||||
// Step 2: Compute the near and far distances for every Camera that
|
||||
// should be used to render the scene.
|
||||
_distAccumulator->computeCameraPairs();
|
||||
|
||||
// Step 3: Create the CameraNodes, and add them as children.
|
||||
// Step 3: Create the Cameras, and add them as children.
|
||||
DistanceAccumulator::PairList& camPairs = _distAccumulator->getCameraPairs();
|
||||
_numCameras = camPairs.size(); // Get the number of cameras
|
||||
|
||||
// Create the CameraNodes, and add them as children.
|
||||
// Create the Cameras, and add them as children.
|
||||
if(_numCameras > 0)
|
||||
{
|
||||
osg::CameraNode *currCam;
|
||||
osg::Camera *currCam;
|
||||
DistanceAccumulator::DistancePair currPair;
|
||||
|
||||
for(i = 0; i < _numCameras; i++)
|
||||
@ -147,7 +147,7 @@ bool CURRENT_CLASS::insertChild(unsigned int index, osg::Node *child)
|
||||
{
|
||||
if(!Group::insertChild(index, child)) return false; // Insert child
|
||||
|
||||
// Insert child into each CameraNode
|
||||
// Insert child into each Camera
|
||||
unsigned int totalCameras = _cameraList.size();
|
||||
for(unsigned int i = 0; i < totalCameras; i++)
|
||||
{
|
||||
@ -161,7 +161,7 @@ bool CURRENT_CLASS::removeChildren(unsigned int pos, unsigned int numRemove)
|
||||
{
|
||||
if(!Group::removeChildren(pos, numRemove)) return false; // Remove child
|
||||
|
||||
// Remove child from each CameraNode
|
||||
// Remove child from each Camera
|
||||
unsigned int totalCameras = _cameraList.size();
|
||||
for(unsigned int i = 0; i < totalCameras; i++)
|
||||
{
|
||||
@ -174,7 +174,7 @@ bool CURRENT_CLASS::setChild(unsigned int i, osg::Node *node)
|
||||
{
|
||||
if(!Group::setChild(i, node)) return false; // Set child
|
||||
|
||||
// Set child for each CameraNode
|
||||
// Set child for each Camera
|
||||
unsigned int totalCameras = _cameraList.size();
|
||||
for(unsigned int j = 0; j < totalCameras; j++)
|
||||
{
|
||||
@ -183,16 +183,16 @@ bool CURRENT_CLASS::setChild(unsigned int i, osg::Node *node)
|
||||
return true;
|
||||
}
|
||||
|
||||
osg::CameraNode* CURRENT_CLASS::createOrReuseCamera(const osg::Matrix& proj,
|
||||
osg::Camera* CURRENT_CLASS::createOrReuseCamera(const osg::Matrix& proj,
|
||||
double znear, double zfar,
|
||||
const unsigned int &camNum)
|
||||
{
|
||||
if(_cameraList.size() <= camNum) _cameraList.resize(camNum+1);
|
||||
osg::CameraNode *camera = _cameraList[camNum].get();
|
||||
osg::Camera *camera = _cameraList[camNum].get();
|
||||
|
||||
if(!camera) // Create a new CameraNode
|
||||
if(!camera) // Create a new Camera
|
||||
{
|
||||
camera = new osg::CameraNode;
|
||||
camera = new osg::Camera;
|
||||
camera->setCullingActive(false);
|
||||
camera->setRenderOrder(_renderOrder);
|
||||
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
@ -206,7 +206,7 @@ osg::CameraNode* CURRENT_CLASS::createOrReuseCamera(const osg::Matrix& proj,
|
||||
else
|
||||
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Add our children to the new CameraNode's children
|
||||
// Add our children to the new Camera's children
|
||||
unsigned int numChildren = _children.size();
|
||||
for(unsigned int i = 0; i < numChildren; i++)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define _OF_DEPTHPARTITIONNODE_
|
||||
|
||||
#include "DistanceAccumulator.h"
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#define CURRENT_CLASS DepthPartitionNode
|
||||
/**********************************************************
|
||||
@ -28,13 +28,13 @@ class CURRENT_CLASS : public osg::Group
|
||||
inline bool getActive() const { return _active; }
|
||||
|
||||
/** Specify whether the color buffer should be cleared before the first
|
||||
CameraNode draws it's scene. */
|
||||
Camera draws it's scene. */
|
||||
void setClearColorBuffer(bool clear);
|
||||
inline bool getClearColorBuffer() const { return _clearColorBuffer; }
|
||||
|
||||
/** Specify the render order for each CameraNode */
|
||||
void setRenderOrder(osg::CameraNode::RenderOrder order);
|
||||
inline osg::CameraNode::RenderOrder getRenderOrder() const
|
||||
/** Specify the render order for each Camera */
|
||||
void setRenderOrder(osg::Camera::RenderOrder order);
|
||||
inline osg::Camera::RenderOrder getRenderOrder() const
|
||||
{ return _renderOrder; }
|
||||
|
||||
/** Set/get the maximum depth that the scene will be traversed to.
|
||||
@ -48,7 +48,7 @@ class CURRENT_CLASS : public osg::Group
|
||||
/** Override update and cull traversals */
|
||||
virtual void traverse(osg::NodeVisitor &nv);
|
||||
|
||||
/** Catch child management functions so the CameraNodes can be informed
|
||||
/** Catch child management functions so the Cameras can be informed
|
||||
of added or removed children. */
|
||||
virtual bool addChild(osg::Node *child);
|
||||
virtual bool insertChild(unsigned int index, osg::Node *child);
|
||||
@ -56,14 +56,14 @@ class CURRENT_CLASS : public osg::Group
|
||||
virtual bool setChild(unsigned int i, osg::Node *node);
|
||||
|
||||
protected:
|
||||
typedef std::vector< osg::ref_ptr<osg::CameraNode> > CameraList;
|
||||
typedef std::vector< osg::ref_ptr<osg::Camera> > CameraList;
|
||||
|
||||
~CURRENT_CLASS();
|
||||
|
||||
void init();
|
||||
|
||||
// Creates a new CameraNode object with default settings
|
||||
osg::CameraNode* createOrReuseCamera(const osg::Matrix& proj,
|
||||
// Creates a new Camera object with default settings
|
||||
osg::Camera* createOrReuseCamera(const osg::Matrix& proj,
|
||||
double znear, double zfar,
|
||||
const unsigned int &camNum);
|
||||
|
||||
@ -72,13 +72,13 @@ class CURRENT_CLASS : public osg::Group
|
||||
// The NodeVisitor that computes cameras for the scene
|
||||
osg::ref_ptr<DistanceAccumulator> _distAccumulator;
|
||||
|
||||
osg::CameraNode::RenderOrder _renderOrder;
|
||||
osg::Camera::RenderOrder _renderOrder;
|
||||
bool _clearColorBuffer;
|
||||
|
||||
// Cameras that should be used to draw the scene. These cameras
|
||||
// will be reused on every frame in order to save time and memory.
|
||||
CameraList _cameraList;
|
||||
unsigned int _numCameras; // Number of CameraNodes actually being used
|
||||
unsigned int _numCameras; // Number of Cameras actually being used
|
||||
};
|
||||
#undef CURRENT_CLASS
|
||||
|
||||
|
@ -73,7 +73,7 @@ void CURRENT_CLASS::pushDistancePair(double zNear, double zFar)
|
||||
}
|
||||
|
||||
/** Return true if the node should be traversed, and false if the bounding sphere
|
||||
of the node is small enough to be rendered by one CameraNode. If the latter
|
||||
of the node is small enough to be rendered by one Camera. If the latter
|
||||
is true, then store the node's near & far plane distances. */
|
||||
bool CURRENT_CLASS::shouldContinueTraversal(osg::Node &node)
|
||||
{
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <osg/TexEnvCombine>
|
||||
#include <osg/TexEnv>
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/TexGenNode>
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
@ -193,9 +193,9 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
|
||||
UpdateCameraAndTexGenCallback(osg::MatrixTransform* light_transform, osg::CameraNode* cameraNode, osg::TexGenNode* texgenNode):
|
||||
UpdateCameraAndTexGenCallback(osg::MatrixTransform* light_transform, osg::Camera* Camera, osg::TexGenNode* texgenNode):
|
||||
_light_transform(light_transform),
|
||||
_cameraNode(cameraNode),
|
||||
_Camera(Camera),
|
||||
_texgenNode(texgenNode)
|
||||
{
|
||||
}
|
||||
@ -207,14 +207,14 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
|
||||
// now compute the camera's view and projection matrix to point at the shadower (the camera's children)
|
||||
osg::BoundingSphere bs;
|
||||
for(unsigned int i=0; i<_cameraNode->getNumChildren(); ++i)
|
||||
for(unsigned int i=0; i<_Camera->getNumChildren(); ++i)
|
||||
{
|
||||
bs.expandBy(_cameraNode->getChild(i)->getBound());
|
||||
bs.expandBy(_Camera->getChild(i)->getBound());
|
||||
}
|
||||
|
||||
if (!bs.valid())
|
||||
{
|
||||
osg::notify(osg::WARN) << "bb invalid"<<_cameraNode.get()<<std::endl;
|
||||
osg::notify(osg::WARN) << "bb invalid"<<_Camera.get()<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -234,14 +234,14 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
float top = (bs.radius()/centerDistance)*znear;
|
||||
float right = top;
|
||||
|
||||
_cameraNode->setReferenceFrame(osg::CameraNode::ABSOLUTE_RF);
|
||||
_cameraNode->setProjectionMatrixAsFrustum(-right,right,-top,top,znear,zfar);
|
||||
_cameraNode->setViewMatrixAsLookAt(position,bs.center(),osg::Vec3(0.0f,1.0f,0.0f));
|
||||
_Camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
|
||||
_Camera->setProjectionMatrixAsFrustum(-right,right,-top,top,znear,zfar);
|
||||
_Camera->setViewMatrixAsLookAt(position,bs.center(),osg::Vec3(0.0f,1.0f,0.0f));
|
||||
|
||||
// compute the matrix which takes a vertex from local coords into tex coords
|
||||
// will use this later to specify osg::TexGen..
|
||||
osg::Matrix MVPT = _cameraNode->getViewMatrix() *
|
||||
_cameraNode->getProjectionMatrix() *
|
||||
osg::Matrix MVPT = _Camera->getViewMatrix() *
|
||||
_Camera->getProjectionMatrix() *
|
||||
osg::Matrix::translate(1.0,1.0,1.0) *
|
||||
osg::Matrix::scale(0.5f,0.5f,0.5f);
|
||||
|
||||
@ -255,7 +255,7 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
virtual ~UpdateCameraAndTexGenCallback() {}
|
||||
|
||||
osg::ref_ptr<osg::MatrixTransform> _light_transform;
|
||||
osg::ref_ptr<osg::CameraNode> _cameraNode;
|
||||
osg::ref_ptr<osg::Camera> _Camera;
|
||||
osg::ref_ptr<osg::TexGenNode> _texgenNode;
|
||||
|
||||
};
|
||||
@ -307,11 +307,11 @@ osg::Group* createShadowedScene(osg::Node* shadowed,osg::MatrixTransform* light_
|
||||
{
|
||||
|
||||
// create the camera
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
camera->setClearColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
|
||||
camera->setComputeNearFarMode(osg::CameraNode::DO_NOT_COMPUTE_NEAR_FAR);
|
||||
camera->setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);
|
||||
|
||||
// set viewport
|
||||
camera->setViewport(0,0,tex_width,tex_height);
|
||||
@ -337,13 +337,13 @@ osg::Group* createShadowedScene(osg::Node* shadowed,osg::MatrixTransform* light_
|
||||
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
|
||||
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||
|
||||
// attach the texture and use it as the color buffer.
|
||||
camera->attach(osg::CameraNode::DEPTH_BUFFER, texture);
|
||||
camera->attach(osg::Camera::DEPTH_BUFFER, texture);
|
||||
|
||||
// add subgraph to render
|
||||
camera->addChild(shadowed);
|
||||
|
@ -39,7 +39,7 @@ osg::Node* createDistortionSubgraph(osg::Node* subgraph, const osg::Vec4& clearC
|
||||
|
||||
// set up the render to texture camera.
|
||||
{
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
// set clear the color and depth buffer
|
||||
camera->setClearColor(clearColour);
|
||||
@ -54,13 +54,13 @@ osg::Node* createDistortionSubgraph(osg::Node* subgraph, const osg::Vec4& clearC
|
||||
camera->setViewport(0,0,tex_width,tex_height);
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
|
||||
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||
|
||||
// attach the texture and use it as the color buffer.
|
||||
camera->attach(osg::CameraNode::COLOR_BUFFER, texture);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, texture);
|
||||
|
||||
// add subgraph to render
|
||||
camera->addChild(subgraph);
|
||||
@ -145,7 +145,7 @@ osg::Node* createDistortionSubgraph(osg::Node* subgraph, const osg::Vec4& clearC
|
||||
geode->addDrawable(polyGeom);
|
||||
|
||||
// set up the camera to render the textured quad
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
// just inherit the main cameras view
|
||||
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
@ -153,13 +153,13 @@ osg::Node* createDistortionSubgraph(osg::Node* subgraph, const osg::Vec4& clearC
|
||||
camera->setProjectionMatrixAsOrtho2D(0,1280,0,1024);
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
camera->setRenderOrder(osg::CameraNode::NESTED_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::NESTED_RENDER);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
|
||||
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||
|
||||
// attach the texture and use it as the color buffer.
|
||||
camera->attach(osg::CameraNode::COLOR_BUFFER, texture);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, texture);
|
||||
|
||||
// add subgraph to render
|
||||
camera->addChild(geode);
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <osg/Depth>
|
||||
#include <osg/PolygonOffset>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgText/Text>
|
||||
|
||||
@ -69,7 +69,7 @@ osg::Node* createHUD()
|
||||
|
||||
text->setFont(timesFont);
|
||||
text->setPosition(position);
|
||||
text->setText("Then place an osg::CameraNode above the subgraph\n"
|
||||
text->setText("Then place an osg::Camera above the subgraph\n"
|
||||
"to create an orthographic projection.\n");
|
||||
|
||||
position += delta;
|
||||
@ -81,7 +81,7 @@ osg::Node* createHUD()
|
||||
|
||||
text->setFont(timesFont);
|
||||
text->setPosition(position);
|
||||
text->setText("Set the CameraNode's ReferenceFrame to ABSOLUTE_RF to ensure\n"
|
||||
text->setText("Set the Camera's ReferenceFrame to ABSOLUTE_RF to ensure\n"
|
||||
"it remains independent from any external model view matrices.");
|
||||
|
||||
position += delta;
|
||||
@ -93,7 +93,7 @@ osg::Node* createHUD()
|
||||
|
||||
text->setFont(timesFont);
|
||||
text->setPosition(position);
|
||||
text->setText("And set the CameraNode's clear mask to just clear the depth buffer.");
|
||||
text->setText("And set the Camera's clear mask to just clear the depth buffer.");
|
||||
|
||||
position += delta;
|
||||
}
|
||||
@ -104,7 +104,7 @@ osg::Node* createHUD()
|
||||
|
||||
text->setFont(timesFont);
|
||||
text->setPosition(position);
|
||||
text->setText("And finally set the CameraNode's RenderOrder to POST_RENDER\n"
|
||||
text->setText("And finally set the Camera's RenderOrder to POST_RENDER\n"
|
||||
"to make sure its drawn last.");
|
||||
|
||||
position += delta;
|
||||
@ -148,7 +148,7 @@ osg::Node* createHUD()
|
||||
geode->addDrawable(geom);
|
||||
}
|
||||
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
// set the projection matrix
|
||||
camera->setProjectionMatrix(osg::Matrix::ortho2D(0,1280,0,1024));
|
||||
@ -161,7 +161,7 @@ osg::Node* createHUD()
|
||||
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// draw subgraph after main camera view.
|
||||
camera->setRenderOrder(osg::CameraNode::POST_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::POST_RENDER);
|
||||
|
||||
camera->addChild(geode);
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <osg/Projection>
|
||||
#include <osg/PolygonOffset>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/FrontFace>
|
||||
|
||||
#include <osgText/Text>
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
osg::Node* createRearView(osg::Node* subgraph, const osg::Vec4& clearColour)
|
||||
{
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
// set the viewport
|
||||
camera->setViewport(10,10,400,200);
|
||||
@ -38,7 +38,7 @@ osg::Node* createRearView(osg::Node* subgraph, const osg::Vec4& clearColour)
|
||||
// set the view matrix
|
||||
camera->setCullingActive(false);
|
||||
camera->setReferenceFrame(osg::Transform::RELATIVE_RF);
|
||||
camera->setTransformOrder(osg::CameraNode::POST_MULTIPLY);
|
||||
camera->setTransformOrder(osg::Camera::POST_MULTIPLY);
|
||||
|
||||
camera->setProjectionMatrix(osg::Matrixd::scale(-1.0f,1.0f,1.0f));
|
||||
camera->setViewMatrix(osg::Matrixd::rotate(osg::inDegrees(180.0f),0.0f,1.0f,0.0f));
|
||||
@ -48,7 +48,7 @@ osg::Node* createRearView(osg::Node* subgraph, const osg::Vec4& clearColour)
|
||||
camera->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// draw subgraph after main camera view.
|
||||
camera->setRenderOrder(osg::CameraNode::POST_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::POST_RENDER);
|
||||
|
||||
// add the subgraph to draw.
|
||||
camera->addChild(subgraph);
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <osg/Depth>
|
||||
#include <osg/Projection>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <osgText/Text>
|
||||
@ -116,11 +116,11 @@ osg::Node* createHUD(osgText::Text* updateText)
|
||||
// eg to be used as a menuing/help system!
|
||||
// Can pick texts too!
|
||||
|
||||
osg::CameraNode* hudCamera = new osg::CameraNode;
|
||||
osg::Camera* hudCamera = new osg::Camera;
|
||||
hudCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
hudCamera->setProjectionMatrixAsOrtho2D(0,1280,0,1024);
|
||||
hudCamera->setViewMatrix(osg::Matrix::identity());
|
||||
hudCamera->setRenderOrder(osg::CameraNode::POST_RENDER);
|
||||
hudCamera->setRenderOrder(osg::Camera::POST_RENDER);
|
||||
hudCamera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
std::string timesFont("fonts/times.ttf");
|
||||
|
@ -107,14 +107,14 @@ class MyGeometryCallback :
|
||||
|
||||
};
|
||||
|
||||
struct MyCameraPostDrawCallback : public osg::CameraNode::DrawCallback
|
||||
struct MyCameraPostDrawCallback : public osg::Camera::DrawCallback
|
||||
{
|
||||
MyCameraPostDrawCallback(osg::Image* image):
|
||||
_image(image)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void operator () (const osg::CameraNode& /*camera*/) const
|
||||
virtual void operator () (const osg::Camera& /*camera*/) const
|
||||
{
|
||||
if (_image && _image->getPixelFormat()==GL_RGBA && _image->getDataType()==GL_UNSIGNED_BYTE)
|
||||
{
|
||||
@ -177,7 +177,7 @@ struct MyCameraPostDrawCallback : public osg::CameraNode::DrawCallback
|
||||
};
|
||||
|
||||
|
||||
osg::Node* createPreRenderSubGraph(osg::Node* subgraph, unsigned tex_width, unsigned tex_height, osg::CameraNode::RenderTargetImplementation renderImplementation, bool useImage, bool useTextureRectangle, bool useHDR)
|
||||
osg::Node* createPreRenderSubGraph(osg::Node* subgraph, unsigned tex_width, unsigned tex_height, osg::Camera::RenderTargetImplementation renderImplementation, bool useImage, bool useTextureRectangle, bool useHDR)
|
||||
{
|
||||
if (!subgraph) return 0;
|
||||
|
||||
@ -288,7 +288,7 @@ osg::Node* createPreRenderSubGraph(osg::Node* subgraph, unsigned tex_width, unsi
|
||||
|
||||
// then create the camera node to do the render to texture
|
||||
{
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
// set up the background color and clear mask.
|
||||
camera->setClearColor(osg::Vec4(0.1f,0.1f,0.3f,1.0f));
|
||||
@ -321,7 +321,7 @@ osg::Node* createPreRenderSubGraph(osg::Node* subgraph, unsigned tex_width, unsi
|
||||
camera->setViewport(0,0,tex_width,tex_height);
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
camera->setRenderTargetImplementation(renderImplementation);
|
||||
@ -334,7 +334,7 @@ osg::Node* createPreRenderSubGraph(osg::Node* subgraph, unsigned tex_width, unsi
|
||||
image->allocateImage(tex_width, tex_height, 1, GL_RGBA, GL_FLOAT);
|
||||
|
||||
// attach the image so its copied on each frame.
|
||||
camera->attach(osg::CameraNode::COLOR_BUFFER, image);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, image);
|
||||
|
||||
camera->setPostDrawCallback(new MyCameraPostDrawCallback(image));
|
||||
|
||||
@ -351,7 +351,7 @@ osg::Node* createPreRenderSubGraph(osg::Node* subgraph, unsigned tex_width, unsi
|
||||
else
|
||||
{
|
||||
// attach the texture and use it as the color buffer.
|
||||
camera->attach(osg::CameraNode::COLOR_BUFFER, texture);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, texture);
|
||||
}
|
||||
|
||||
|
||||
@ -404,13 +404,13 @@ int main( int argc, char **argv )
|
||||
while (arguments.read("--width", tex_width)) {}
|
||||
while (arguments.read("--height", tex_height)) {}
|
||||
|
||||
osg::CameraNode::RenderTargetImplementation renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT;
|
||||
osg::Camera::RenderTargetImplementation renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT;
|
||||
|
||||
while (arguments.read("--fbo")) { renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT; }
|
||||
while (arguments.read("--pbuffer")) { renderImplementation = osg::CameraNode::PIXEL_BUFFER; }
|
||||
while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::CameraNode::PIXEL_BUFFER_RTT; }
|
||||
while (arguments.read("--fb")) { renderImplementation = osg::CameraNode::FRAME_BUFFER; }
|
||||
while (arguments.read("--window")) { renderImplementation = osg::CameraNode::SEPERATE_WINDOW; }
|
||||
while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; }
|
||||
while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; }
|
||||
while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; }
|
||||
while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; }
|
||||
while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; }
|
||||
|
||||
bool useImage = false;
|
||||
while (arguments.read("--image")) { useImage = true; }
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <osg/Material>
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/TexGenNode>
|
||||
|
||||
using namespace osg;
|
||||
@ -111,11 +111,11 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::vector< osg::ref_ptr<osg::CameraNode> > CameraList;
|
||||
typedef std::vector< osg::ref_ptr<osg::Camera> > CameraList;
|
||||
|
||||
UpdateCameraAndTexGenCallback(osg::NodePath& reflectorNodePath, CameraList& cameraNodes):
|
||||
UpdateCameraAndTexGenCallback(osg::NodePath& reflectorNodePath, CameraList& Cameras):
|
||||
_reflectorNodePath(reflectorNodePath),
|
||||
_cameraNodes(cameraNodes)
|
||||
_Cameras(Cameras)
|
||||
{
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
};
|
||||
|
||||
for(unsigned int i=0;
|
||||
i<6 && i<_cameraNodes.size();
|
||||
i<6 && i<_Cameras.size();
|
||||
++i)
|
||||
{
|
||||
osg::Matrix localOffset;
|
||||
@ -149,9 +149,9 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
|
||||
osg::Matrix viewMatrix = worldToLocal*localOffset;
|
||||
|
||||
_cameraNodes[i]->setReferenceFrame(osg::CameraNode::ABSOLUTE_RF);
|
||||
_cameraNodes[i]->setProjectionMatrixAsFrustum(-1.0,1.0,-1.0,1.0,1.0,10000.0);
|
||||
_cameraNodes[i]->setViewMatrix(viewMatrix);
|
||||
_Cameras[i]->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
|
||||
_Cameras[i]->setProjectionMatrixAsFrustum(-1.0,1.0,-1.0,1.0,1.0,10000.0);
|
||||
_Cameras[i]->setViewMatrix(viewMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
virtual ~UpdateCameraAndTexGenCallback() {}
|
||||
|
||||
osg::NodePath _reflectorNodePath;
|
||||
CameraList _cameraNodes;
|
||||
CameraList _Cameras;
|
||||
};
|
||||
|
||||
class TexMatCullCallback : public osg::NodeCallback
|
||||
@ -191,7 +191,7 @@ class TexMatCullCallback : public osg::NodeCallback
|
||||
};
|
||||
|
||||
|
||||
osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath reflectorNodePath, unsigned int unit, const osg::Vec4& clearColor, unsigned tex_width, unsigned tex_height, osg::CameraNode::RenderTargetImplementation renderImplementation)
|
||||
osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath reflectorNodePath, unsigned int unit, const osg::Vec4& clearColor, unsigned tex_width, unsigned tex_height, osg::Camera::RenderTargetImplementation renderImplementation)
|
||||
{
|
||||
|
||||
osg::Group* group = new osg::Group;
|
||||
@ -207,11 +207,11 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl
|
||||
texture->setFilter(osg::TextureCubeMap::MAG_FILTER,osg::TextureCubeMap::LINEAR);
|
||||
|
||||
// set up the render to texture cameras.
|
||||
UpdateCameraAndTexGenCallback::CameraList cameraNodes;
|
||||
UpdateCameraAndTexGenCallback::CameraList Cameras;
|
||||
for(unsigned int i=0; i<6; ++i)
|
||||
{
|
||||
// create the camera
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
camera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
camera->setClearColor(clearColor);
|
||||
@ -220,20 +220,20 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl
|
||||
camera->setViewport(0,0,tex_width,tex_height);
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
camera->setRenderTargetImplementation(renderImplementation);
|
||||
|
||||
// attach the texture and use it as the color buffer.
|
||||
camera->attach(osg::CameraNode::COLOR_BUFFER, texture, 0, i);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, texture, 0, i);
|
||||
|
||||
// add subgraph to render
|
||||
camera->addChild(reflectedSubgraph);
|
||||
|
||||
group->addChild(camera);
|
||||
|
||||
cameraNodes.push_back(camera);
|
||||
Cameras.push_back(camera);
|
||||
}
|
||||
|
||||
// create the texgen node to project the tex coords onto the subgraph
|
||||
@ -264,7 +264,7 @@ osg::Group* createShadowedScene(osg::Node* reflectedSubgraph, osg::NodePath refl
|
||||
group->addChild(reflectedSubgraph);
|
||||
|
||||
// set an update callback to keep moving the camera and tex gen in the right direction.
|
||||
group->setUpdateCallback(new UpdateCameraAndTexGenCallback(reflectorNodePath, cameraNodes));
|
||||
group->setUpdateCallback(new UpdateCameraAndTexGenCallback(reflectorNodePath, Cameras));
|
||||
|
||||
return group;
|
||||
}
|
||||
@ -307,12 +307,12 @@ int main(int argc, char** argv)
|
||||
while (arguments.read("--width", tex_width)) {}
|
||||
while (arguments.read("--height", tex_height)) {}
|
||||
|
||||
osg::CameraNode::RenderTargetImplementation renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT;
|
||||
osg::Camera::RenderTargetImplementation renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT;
|
||||
|
||||
while (arguments.read("--fbo")) { renderImplementation = osg::CameraNode::FRAME_BUFFER_OBJECT; }
|
||||
while (arguments.read("--pbuffer")) { renderImplementation = osg::CameraNode::PIXEL_BUFFER; }
|
||||
while (arguments.read("--fb")) { renderImplementation = osg::CameraNode::FRAME_BUFFER; }
|
||||
while (arguments.read("--window")) { renderImplementation = osg::CameraNode::SEPERATE_WINDOW; }
|
||||
while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; }
|
||||
while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; }
|
||||
while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; }
|
||||
while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; }
|
||||
|
||||
|
||||
// any option left unread are converted into errors to write out later.
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <osg/Geode>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/ShapeDrawable>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/TexGenNode>
|
||||
#include <osg/Notify>
|
||||
#include <osg/io_utils>
|
||||
@ -17,9 +17,9 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
|
||||
UpdateCameraAndTexGenCallback(const osg::Vec3& position, osg::CameraNode* cameraNode, osg::TexGenNode* texgenNode):
|
||||
UpdateCameraAndTexGenCallback(const osg::Vec3& position, osg::Camera* Camera, osg::TexGenNode* texgenNode):
|
||||
_position(position),
|
||||
_cameraNode(cameraNode),
|
||||
_Camera(Camera),
|
||||
_texgenNode(texgenNode)
|
||||
{
|
||||
}
|
||||
@ -31,14 +31,14 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
|
||||
// now compute the camera's view and projection matrix to point at the shadower (the camera's children)
|
||||
osg::BoundingSphere bs;
|
||||
for(unsigned int i=0; i<_cameraNode->getNumChildren(); ++i)
|
||||
for(unsigned int i=0; i<_Camera->getNumChildren(); ++i)
|
||||
{
|
||||
bs.expandBy(_cameraNode->getChild(i)->getBound());
|
||||
bs.expandBy(_Camera->getChild(i)->getBound());
|
||||
}
|
||||
|
||||
if (!bs.valid())
|
||||
{
|
||||
osg::notify(osg::WARN) << "bb invalid"<<_cameraNode.get()<<std::endl;
|
||||
osg::notify(osg::WARN) << "bb invalid"<<_Camera.get()<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -52,14 +52,14 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
float top = (bs.radius()/centerDistance)*znear;
|
||||
float right = top;
|
||||
|
||||
_cameraNode->setReferenceFrame(osg::CameraNode::ABSOLUTE_RF);
|
||||
_cameraNode->setProjectionMatrixAsFrustum(-right,right,-top,top,znear,zfar);
|
||||
_cameraNode->setViewMatrixAsLookAt(_position,bs.center(),osg::Vec3(0.0f,1.0f,0.0f));
|
||||
_Camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
|
||||
_Camera->setProjectionMatrixAsFrustum(-right,right,-top,top,znear,zfar);
|
||||
_Camera->setViewMatrixAsLookAt(_position,bs.center(),osg::Vec3(0.0f,1.0f,0.0f));
|
||||
|
||||
// compute the matrix which takes a vertex from local coords into tex coords
|
||||
// will use this later to specify osg::TexGen..
|
||||
osg::Matrix MVPT = _cameraNode->getViewMatrix() *
|
||||
_cameraNode->getProjectionMatrix() *
|
||||
osg::Matrix MVPT = _Camera->getViewMatrix() *
|
||||
_Camera->getProjectionMatrix() *
|
||||
osg::Matrix::translate(1.0,1.0,1.0) *
|
||||
osg::Matrix::scale(0.5f,0.5f,0.5f);
|
||||
|
||||
@ -73,7 +73,7 @@ class UpdateCameraAndTexGenCallback : public osg::NodeCallback
|
||||
virtual ~UpdateCameraAndTexGenCallback() {}
|
||||
|
||||
osg::Vec3 _position;
|
||||
osg::ref_ptr<osg::CameraNode> _cameraNode;
|
||||
osg::ref_ptr<osg::Camera> _Camera;
|
||||
osg::ref_ptr<osg::TexGenNode> _texgenNode;
|
||||
|
||||
};
|
||||
@ -120,7 +120,7 @@ osg::Group* createShadowedScene(osg::Node* shadower,osg::Node* shadowed,const os
|
||||
{
|
||||
|
||||
// create the camera
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
camera->setClearColor(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
|
||||
|
||||
@ -128,13 +128,13 @@ osg::Group* createShadowedScene(osg::Node* shadower,osg::Node* shadowed,const os
|
||||
camera->setViewport(0,0,tex_width,tex_height);
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
|
||||
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||
|
||||
// attach the texture and use it as the color buffer.
|
||||
camera->attach(osg::CameraNode::COLOR_BUFFER, texture);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, texture);
|
||||
|
||||
// add subgraph to render
|
||||
camera->addChild(shadower);
|
||||
@ -179,7 +179,7 @@ osg::Group* createShadowedScene(osg::Node* shadower,osg::Node* shadowed,const os
|
||||
geom->getOrCreateStateSet()->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
|
||||
geode->addDrawable(geom);
|
||||
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
// set the projection matrix
|
||||
camera->setProjectionMatrix(osg::Matrix::ortho2D(0,100,0,100));
|
||||
@ -194,7 +194,7 @@ osg::Group* createShadowedScene(osg::Node* shadower,osg::Node* shadowed,const os
|
||||
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// draw subgraph after main camera view.
|
||||
camera->setRenderOrder(osg::CameraNode::POST_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::POST_RENDER);
|
||||
|
||||
camera->addChild(geode);
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <osgProducer/Viewer>
|
||||
|
||||
#include <osg/Geode>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/ShapeDrawable>
|
||||
#include <osg/Sequence>
|
||||
|
||||
@ -540,7 +540,7 @@ int main( int argc, char **argv )
|
||||
|
||||
{
|
||||
// create the hud.
|
||||
osg::CameraNode* camera = new osg::CameraNode;
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
camera->setProjectionMatrixAsOrtho2D(0,1280,0,1024);
|
||||
camera->setViewMatrix(osg::Matrix::identity());
|
||||
|
404
include/osg/Camera
Normal file
404
include/osg/Camera
Normal file
@ -0,0 +1,404 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSG_CAMERA
|
||||
#define OSG_CAMERA 1
|
||||
|
||||
#include <osg/Transform>
|
||||
#include <osg/Viewport>
|
||||
#include <osg/ColorMask>
|
||||
#include <osg/CullSettings>
|
||||
#include <osg/Texture>
|
||||
#include <osg/Image>
|
||||
#include <osg/GraphicsContext>
|
||||
|
||||
#include <OpenThreads/Mutex>
|
||||
|
||||
namespace osg {
|
||||
|
||||
// forward declare View to allow Camera to point back to the View that its within
|
||||
class View;
|
||||
|
||||
/** Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
|
||||
*/
|
||||
class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
{
|
||||
public :
|
||||
|
||||
|
||||
Camera();
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Camera(const Camera&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(osg, Camera);
|
||||
|
||||
/** Set the View that this Camera is part of. */
|
||||
void setView(View* view) { _view = view; }
|
||||
|
||||
/** Get the View that this Camera is part of. */
|
||||
View* getView() { return _view; }
|
||||
|
||||
/** Get the const View that this Camera is part of. */
|
||||
const View* getView() const { return _view; }
|
||||
|
||||
|
||||
/** Sets the clear color. */
|
||||
inline void setClearColor(const Vec4& color) { _clearColor = color; }
|
||||
|
||||
/** Returns the clear color. */
|
||||
inline const Vec4& getClearColor() const { return _clearColor; }
|
||||
|
||||
/** Set the clear mask used in glClear(..).
|
||||
* Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT. */
|
||||
inline void setClearMask(GLbitfield mask) { _clearMask = mask; }
|
||||
|
||||
/** Get the clear mask.*/
|
||||
inline GLbitfield getClearMask() const { return _clearMask; }
|
||||
|
||||
|
||||
/** Set the color mask of the camera to use specified osg::ColorMask. */
|
||||
void setColorMask(osg::ColorMask* colorMask);
|
||||
|
||||
/** Set the color mask of the camera to specified values. */
|
||||
void setColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
|
||||
/** Get the const ColorMask. */
|
||||
const ColorMask* getColorMask() const { return _colorMask.get(); }
|
||||
|
||||
/** Get the ColorMask. */
|
||||
ColorMask* getColorMask() { return _colorMask.get(); }
|
||||
|
||||
|
||||
|
||||
|
||||
/** Set the viewport of the camera to use specified osg::Viewport. */
|
||||
void setViewport(osg::Viewport* viewport);
|
||||
|
||||
/** Set the viewport of the camera to specified dimensions. */
|
||||
void setViewport(int x,int y,int width,int height);
|
||||
|
||||
/** Get the const viewport. */
|
||||
const Viewport* getViewport() const { return _viewport.get(); }
|
||||
|
||||
/** Get the viewport. */
|
||||
Viewport* getViewport() { return _viewport.get(); }
|
||||
|
||||
|
||||
enum TransformOrder
|
||||
{
|
||||
PRE_MULTIPLY,
|
||||
POST_MULTIPLY
|
||||
};
|
||||
|
||||
/** Set the transformation order for world-to-local and local-to-world transformation.*/
|
||||
void setTransformOrder(TransformOrder order) { _transformOrder = order; }
|
||||
|
||||
/** Get the transformation order.*/
|
||||
TransformOrder getTransformOrder() const { return _transformOrder; }
|
||||
|
||||
|
||||
/** Set the projection matrix. Can be thought of as setting the lens of a camera. */
|
||||
inline void setProjectionMatrix(const osg::Matrixf& matrix) { _projectionMatrix.set(matrix); }
|
||||
|
||||
/** Set the projection matrix. Can be thought of as setting the lens of a camera. */
|
||||
inline void setProjectionMatrix(const osg::Matrixd& matrix) { _projectionMatrix.set(matrix); }
|
||||
|
||||
/** Set to an orthographic projection. See OpenGL glOrtho for documentation further details.*/
|
||||
void setProjectionMatrixAsOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details.*/
|
||||
void setProjectionMatrixAsOrtho2D(double left, double right,
|
||||
double bottom, double top);
|
||||
|
||||
/** Set to a perspective projection. See OpenGL glFrustum documentation for further details.*/
|
||||
void setProjectionMatrixAsFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
void setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Get the projection matrix.*/
|
||||
osg::Matrixd& getProjectionMatrix() { return _projectionMatrix; }
|
||||
|
||||
/** Get the const projection matrix.*/
|
||||
const osg::Matrixd& getProjectionMatrix() const { return _projectionMatrix; }
|
||||
|
||||
/** Get the othographic settings of the orthographic projection matrix.
|
||||
* Returns false if matrix is not an orthographic matrix, where parameter values are undefined.*/
|
||||
bool getProjectionMatrixAsOrtho(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
/** Get the frustum setting of a perspective projection matrix.
|
||||
* Returns false if matrix is not a perspective matrix, where parameter values are undefined.*/
|
||||
bool getProjectionMatrixAsFrustum(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
/** Get the frustum setting of a symmetric perspective projection matrix.
|
||||
* Returns false if matrix is not a perspective matrix, where parameter values are undefined.
|
||||
* Note, if matrix is not a symmetric perspective matrix then the shear will be lost.
|
||||
* Asymmetric matrices occur when stereo, power walls, caves and reality center display are used.
|
||||
* In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead.*/
|
||||
bool getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
|
||||
|
||||
/** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
|
||||
inline void setViewMatrix(const osg::Matrixf& matrix) { _viewMatrix.set(matrix); dirtyBound();}
|
||||
|
||||
/** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
|
||||
inline void setViewMatrix(const osg::Matrixd& matrix) { _viewMatrix.set(matrix); dirtyBound();}
|
||||
|
||||
/** Set to the position and orientation of view matrix, using the same convention as gluLookAt. */
|
||||
void setViewMatrixAsLookAt(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up);
|
||||
|
||||
/** Get the view matrix. */
|
||||
osg::Matrixd& getViewMatrix() { return _viewMatrix; }
|
||||
|
||||
/** Get the const view matrix. */
|
||||
const osg::Matrixd& getViewMatrix() const { return _viewMatrix; }
|
||||
|
||||
/** Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. */
|
||||
void getViewMatrixAsLookAt(osg::Vec3& eye,osg::Vec3& center,osg::Vec3& up,float lookDistance=1.0f);
|
||||
|
||||
/** Get the inverse view matrix.*/
|
||||
Matrixd getInverseViewMatrix() const;
|
||||
|
||||
|
||||
enum RenderOrder
|
||||
{
|
||||
PRE_RENDER,
|
||||
NESTED_RENDER,
|
||||
POST_RENDER
|
||||
};
|
||||
|
||||
/** Set the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within.
|
||||
* For rendering to a texture, one typically uses PRE_RENDER.
|
||||
* For Head Up Displays, one would typically use POST_RENDER.*/
|
||||
void setRenderOrder(RenderOrder order, int orderNum = 0) { _renderOrder = order; _renderOrderNum = orderNum; }
|
||||
|
||||
/** Get the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within.*/
|
||||
RenderOrder getRenderOrder() const { return _renderOrder; }
|
||||
|
||||
/** Get the rendering order number of this camera relative to any sibling cameras in this subgraph.*/
|
||||
int getRenderOrderNum() const { return _renderOrderNum; }
|
||||
|
||||
/** Return true if this Camera is set up as a render to texture camera, i.e. it has textures assigned to it.*/
|
||||
bool isRenderToTextureCamera() const;
|
||||
|
||||
enum RenderTargetImplementation
|
||||
{
|
||||
FRAME_BUFFER_OBJECT,
|
||||
PIXEL_BUFFER_RTT,
|
||||
PIXEL_BUFFER,
|
||||
FRAME_BUFFER,
|
||||
SEPERATE_WINDOW
|
||||
};
|
||||
|
||||
/** Set the render target.*/
|
||||
void setRenderTargetImplementation(RenderTargetImplementation impl);
|
||||
|
||||
/** Set the render target and fall-back that's used if the former isn't available.*/
|
||||
void setRenderTargetImplementation(RenderTargetImplementation impl, RenderTargetImplementation fallback);
|
||||
|
||||
/** Get the render target.*/
|
||||
RenderTargetImplementation getRenderTargetImplementation() const { return _renderTargetImplementation; }
|
||||
|
||||
/** Get the render target fallback.*/
|
||||
RenderTargetImplementation getRenderTargetFallback() const { return _renderTargetFallback; }
|
||||
|
||||
|
||||
/** Set the draw buffer used at the start of each frame draw.
|
||||
* Note, a buffer value of GL_NONE is used to sepecify that the rendering back-end should choose the most appropriate buffer.*/
|
||||
void setDrawBuffer(GLenum buffer) { _drawBuffer = buffer; }
|
||||
|
||||
/** Get the draw buffer used at the start of each frame draw. */
|
||||
GLenum getDrawBuffer() const { return _drawBuffer; }
|
||||
|
||||
/** Set the read buffer for any required copy operations to use.
|
||||
* Note, a buffer value of GL_NONE is used to sepecify that the rendering back-end should choose the most appropriate buffer.*/
|
||||
void setReadBuffer(GLenum buffer) { _readBuffer = buffer; }
|
||||
|
||||
/** Get the read buffer for any required copy operations to use. */
|
||||
GLenum getReadBuffer() const { return _readBuffer; }
|
||||
|
||||
enum BufferComponent
|
||||
{
|
||||
DEPTH_BUFFER,
|
||||
STENCIL_BUFFER,
|
||||
COLOR_BUFFER,
|
||||
COLOR_BUFFER0 = COLOR_BUFFER,
|
||||
COLOR_BUFFER1 = COLOR_BUFFER+1,
|
||||
COLOR_BUFFER2 = COLOR_BUFFER+2,
|
||||
COLOR_BUFFER3 = COLOR_BUFFER+3,
|
||||
COLOR_BUFFER4 = COLOR_BUFFER+4,
|
||||
COLOR_BUFFER5 = COLOR_BUFFER+5,
|
||||
COLOR_BUFFER6 = COLOR_BUFFER+6,
|
||||
COLOR_BUFFER7 = COLOR_BUFFER+7
|
||||
};
|
||||
|
||||
void attach(BufferComponent buffer, GLenum internalFormat);
|
||||
|
||||
void attach(BufferComponent buffer, osg::Texture* texture, unsigned int level = 0, unsigned int face=0, bool mipMapGeneration=false);
|
||||
|
||||
void attach(BufferComponent buffer, osg::Image* image);
|
||||
|
||||
void detach(BufferComponent buffer);
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
Attachment():
|
||||
_internalFormat(GL_NONE),
|
||||
_level(0),
|
||||
_face(0),
|
||||
_mipMapGeneration(false) {}
|
||||
|
||||
int width() const
|
||||
{
|
||||
if (_texture.valid()) return _texture->getTextureWidth();
|
||||
if (_image.valid()) return _image->s();
|
||||
return 0;
|
||||
};
|
||||
|
||||
int height() const
|
||||
{
|
||||
if (_texture.valid()) return _texture->getTextureHeight();
|
||||
if (_image.valid()) return _image->t();
|
||||
return 0;
|
||||
};
|
||||
|
||||
int depth() const
|
||||
{
|
||||
if (_texture.valid()) return _texture->getTextureDepth();
|
||||
if (_image.valid()) return _image->r();
|
||||
return 0;
|
||||
};
|
||||
|
||||
GLenum _internalFormat;
|
||||
ref_ptr<Image> _image;
|
||||
ref_ptr<Texture> _texture;
|
||||
unsigned int _level;
|
||||
unsigned int _face;
|
||||
bool _mipMapGeneration;
|
||||
};
|
||||
|
||||
typedef std::map< BufferComponent, Attachment> BufferAttachmentMap;
|
||||
|
||||
/** Get the BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads.*/
|
||||
BufferAttachmentMap& getBufferAttachmentMap() { return _bufferAttachmentMap; }
|
||||
|
||||
/** Get the const BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads.*/
|
||||
const BufferAttachmentMap& getBufferAttachmentMap() const { return _bufferAttachmentMap; }
|
||||
|
||||
|
||||
/** Set the GraphicsContext that provides the mechansim for managing the OpenGL graphics context associated with this camera.*/
|
||||
void setGraphicsContext(GraphicsContext* context) { _graphicsContext = context; }
|
||||
|
||||
/** Get the GraphicsContext.*/
|
||||
GraphicsContext* getGraphicsContext() { return _graphicsContext.get(); }
|
||||
|
||||
/** Get the const GraphicsContext.*/
|
||||
const GraphicsContext* getGraphicsContext() const { return _graphicsContext.get(); }
|
||||
|
||||
|
||||
/** Set the Rendering object that is used to implement rendering of the subgraph.*/
|
||||
void setRenderingCache(unsigned int contextID, osg::Object* rc) { _renderingCache[contextID] = rc; }
|
||||
|
||||
/** Get the Rendering object that is used to implement rendering of the subgraph.*/
|
||||
osg::Object* getRenderingCache(unsigned int contextID) { return _renderingCache[contextID].get(); }
|
||||
|
||||
/** Get the const Rendering object that is used to implement rendering of the subgraph.*/
|
||||
const osg::Object* getRenderingCache(unsigned int contextID) const { return _renderingCache[contextID].get(); }
|
||||
|
||||
|
||||
/** Draw callback for custom operations.*/
|
||||
struct DrawCallback : virtual public Object
|
||||
{
|
||||
DrawCallback() {}
|
||||
|
||||
DrawCallback(const DrawCallback&,const CopyOp&) {}
|
||||
|
||||
META_Object(osg,DrawCallback)
|
||||
|
||||
virtual void operator () (const osg::Camera& /*camera*/) const {}
|
||||
};
|
||||
|
||||
/** Set the post draw callback for custom operations to do done after the drawing of the camera's subgraph has been completed.*/
|
||||
void setPostDrawCallback(DrawCallback* cb) { _postDrawCallback = cb; }
|
||||
|
||||
/** Get the post draw callback.*/
|
||||
DrawCallback* getPostDrawCallback() { return _postDrawCallback.get(); }
|
||||
|
||||
/** Get the const post draw callback.*/
|
||||
const DrawCallback* getPostDrawCallback() const { return _postDrawCallback.get(); }
|
||||
|
||||
OpenThreads::Mutex* getDataChangeMutex() const { return &_dataChangeMutex; }
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
public:
|
||||
|
||||
/** Transform method that must be defined to provide generic interface for scene graph traversals.*/
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const;
|
||||
|
||||
/** Transform method that must be defined to provide generic interface for scene graph traversals.*/
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const;
|
||||
|
||||
protected :
|
||||
|
||||
virtual ~Camera();
|
||||
|
||||
mutable OpenThreads::Mutex _dataChangeMutex;
|
||||
|
||||
|
||||
View* _view;
|
||||
|
||||
Vec4 _clearColor;
|
||||
GLbitfield _clearMask;
|
||||
ref_ptr<ColorMask> _colorMask;
|
||||
ref_ptr<Viewport> _viewport;
|
||||
|
||||
TransformOrder _transformOrder;
|
||||
Matrixd _projectionMatrix;
|
||||
Matrixd _viewMatrix;
|
||||
|
||||
RenderOrder _renderOrder;
|
||||
int _renderOrderNum;
|
||||
|
||||
GLenum _drawBuffer;
|
||||
GLenum _readBuffer;
|
||||
|
||||
RenderTargetImplementation _renderTargetImplementation;
|
||||
RenderTargetImplementation _renderTargetFallback;
|
||||
BufferAttachmentMap _bufferAttachmentMap;
|
||||
|
||||
ref_ptr<GraphicsContext> _graphicsContext;
|
||||
buffered_object< ref_ptr<Object> > _renderingCache;
|
||||
|
||||
ref_ptr<DrawCallback> _postDrawCallback;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -14,390 +14,13 @@
|
||||
#ifndef OSG_CAMERANODE
|
||||
#define OSG_CAMERANODE 1
|
||||
|
||||
#include <osg/Transform>
|
||||
#include <osg/Viewport>
|
||||
#include <osg/ColorMask>
|
||||
#include <osg/CullSettings>
|
||||
#include <osg/Texture>
|
||||
#include <osg/Image>
|
||||
#include <osg/GraphicsContext>
|
||||
|
||||
#include <OpenThreads/Mutex>
|
||||
#include <osg/Camera>
|
||||
|
||||
namespace osg {
|
||||
|
||||
// forward declare View to allow CameraNode to point back to the View that its within
|
||||
class View;
|
||||
|
||||
/** CameraNode - is a subclass of Transform which represents encapsulates the settings of a Camera.
|
||||
*/
|
||||
class OSG_EXPORT CameraNode : public Transform, public CullSettings
|
||||
{
|
||||
public :
|
||||
|
||||
|
||||
CameraNode();
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
CameraNode(const CameraNode&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(osg, CameraNode);
|
||||
|
||||
/** Set the View that this Camera is part of. */
|
||||
void setView(View* view) { _view = view; }
|
||||
|
||||
/** Get the View that this Camera is part of. */
|
||||
View* getView() { return _view; }
|
||||
|
||||
/** Get the const View that this Camera is part of. */
|
||||
const View* getView() const { return _view; }
|
||||
|
||||
|
||||
/** Sets the clear color. */
|
||||
inline void setClearColor(const Vec4& color) { _clearColor = color; }
|
||||
|
||||
/** Returns the clear color. */
|
||||
inline const Vec4& getClearColor() const { return _clearColor; }
|
||||
|
||||
/** Set the clear mask used in glClear(..).
|
||||
* Defaults to GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT. */
|
||||
inline void setClearMask(GLbitfield mask) { _clearMask = mask; }
|
||||
|
||||
/** Get the clear mask.*/
|
||||
inline GLbitfield getClearMask() const { return _clearMask; }
|
||||
|
||||
|
||||
/** Set the color mask of the camera to use specified osg::ColorMask. */
|
||||
void setColorMask(osg::ColorMask* colorMask);
|
||||
|
||||
/** Set the color mask of the camera to specified values. */
|
||||
void setColorMask(bool red, bool green, bool blue, bool alpha);
|
||||
|
||||
/** Get the const ColorMask. */
|
||||
const ColorMask* getColorMask() const { return _colorMask.get(); }
|
||||
|
||||
/** Get the ColorMask. */
|
||||
ColorMask* getColorMask() { return _colorMask.get(); }
|
||||
|
||||
|
||||
|
||||
|
||||
/** Set the viewport of the camera to use specified osg::Viewport. */
|
||||
void setViewport(osg::Viewport* viewport);
|
||||
|
||||
/** Set the viewport of the camera to specified dimensions. */
|
||||
void setViewport(int x,int y,int width,int height);
|
||||
|
||||
/** Get the const viewport. */
|
||||
const Viewport* getViewport() const { return _viewport.get(); }
|
||||
|
||||
/** Get the viewport. */
|
||||
Viewport* getViewport() { return _viewport.get(); }
|
||||
|
||||
|
||||
enum TransformOrder
|
||||
{
|
||||
PRE_MULTIPLY,
|
||||
POST_MULTIPLY
|
||||
};
|
||||
|
||||
/** Set the transformation order for world-to-local and local-to-world transformation.*/
|
||||
void setTransformOrder(TransformOrder order) { _transformOrder = order; }
|
||||
|
||||
/** Get the transformation order.*/
|
||||
TransformOrder getTransformOrder() const { return _transformOrder; }
|
||||
|
||||
|
||||
/** Set the projection matrix. Can be thought of as setting the lens of a camera. */
|
||||
inline void setProjectionMatrix(const osg::Matrixf& matrix) { _projectionMatrix.set(matrix); }
|
||||
|
||||
/** Set the projection matrix. Can be thought of as setting the lens of a camera. */
|
||||
inline void setProjectionMatrix(const osg::Matrixd& matrix) { _projectionMatrix.set(matrix); }
|
||||
|
||||
/** Set to an orthographic projection. See OpenGL glOrtho for documentation further details.*/
|
||||
void setProjectionMatrixAsOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details.*/
|
||||
void setProjectionMatrixAsOrtho2D(double left, double right,
|
||||
double bottom, double top);
|
||||
|
||||
/** Set to a perspective projection. See OpenGL glFrustum documentation for further details.*/
|
||||
void setProjectionMatrixAsFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
void setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Get the projection matrix.*/
|
||||
osg::Matrixd& getProjectionMatrix() { return _projectionMatrix; }
|
||||
|
||||
/** Get the const projection matrix.*/
|
||||
const osg::Matrixd& getProjectionMatrix() const { return _projectionMatrix; }
|
||||
|
||||
/** Get the othographic settings of the orthographic projection matrix.
|
||||
* Returns false if matrix is not an orthographic matrix, where parameter values are undefined.*/
|
||||
bool getProjectionMatrixAsOrtho(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
/** Get the frustum setting of a perspective projection matrix.
|
||||
* Returns false if matrix is not a perspective matrix, where parameter values are undefined.*/
|
||||
bool getProjectionMatrixAsFrustum(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
/** Get the frustum setting of a symmetric perspective projection matrix.
|
||||
* Returns false if matrix is not a perspective matrix, where parameter values are undefined.
|
||||
* Note, if matrix is not a symmetric perspective matrix then the shear will be lost.
|
||||
* Asymmetric matrices occur when stereo, power walls, caves and reality center display are used.
|
||||
* In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead.*/
|
||||
bool getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
|
||||
|
||||
/** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
|
||||
inline void setViewMatrix(const osg::Matrixf& matrix) { _viewMatrix.set(matrix); dirtyBound();}
|
||||
|
||||
/** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
|
||||
inline void setViewMatrix(const osg::Matrixd& matrix) { _viewMatrix.set(matrix); dirtyBound();}
|
||||
|
||||
/** Set to the position and orientation of view matrix, using the same convention as gluLookAt. */
|
||||
void setViewMatrixAsLookAt(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up);
|
||||
|
||||
/** Get the view matrix. */
|
||||
osg::Matrixd& getViewMatrix() { return _viewMatrix; }
|
||||
|
||||
/** Get the const view matrix. */
|
||||
const osg::Matrixd& getViewMatrix() const { return _viewMatrix; }
|
||||
|
||||
/** Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. */
|
||||
void getViewMatrixAsLookAt(osg::Vec3& eye,osg::Vec3& center,osg::Vec3& up,float lookDistance=1.0f);
|
||||
|
||||
/** Get the inverse view matrix.*/
|
||||
Matrixd getInverseViewMatrix() const;
|
||||
|
||||
|
||||
enum RenderOrder
|
||||
{
|
||||
PRE_RENDER,
|
||||
NESTED_RENDER,
|
||||
POST_RENDER
|
||||
};
|
||||
|
||||
/** Set the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within.
|
||||
* For rendering to a texture, one typically uses PRE_RENDER.
|
||||
* For Head Up Displays, one would typically use POST_RENDER.*/
|
||||
void setRenderOrder(RenderOrder order, int orderNum = 0) { _renderOrder = order; _renderOrderNum = orderNum; }
|
||||
|
||||
/** Get the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within.*/
|
||||
RenderOrder getRenderOrder() const { return _renderOrder; }
|
||||
|
||||
/** Get the rendering order number of this camera relative to any sibling cameras in this subgraph.*/
|
||||
int getRenderOrderNum() const { return _renderOrderNum; }
|
||||
|
||||
/** Return true if this Camera is set up as a render to texture camera, i.e. it has textures assigned to it.*/
|
||||
bool isRenderToTextureCamera() const;
|
||||
|
||||
enum RenderTargetImplementation
|
||||
{
|
||||
FRAME_BUFFER_OBJECT,
|
||||
PIXEL_BUFFER_RTT,
|
||||
PIXEL_BUFFER,
|
||||
FRAME_BUFFER,
|
||||
SEPERATE_WINDOW
|
||||
};
|
||||
|
||||
/** Set the render target.*/
|
||||
void setRenderTargetImplementation(RenderTargetImplementation impl);
|
||||
|
||||
/** Set the render target and fall-back that's used if the former isn't available.*/
|
||||
void setRenderTargetImplementation(RenderTargetImplementation impl, RenderTargetImplementation fallback);
|
||||
|
||||
/** Get the render target.*/
|
||||
RenderTargetImplementation getRenderTargetImplementation() const { return _renderTargetImplementation; }
|
||||
|
||||
/** Get the render target fallback.*/
|
||||
RenderTargetImplementation getRenderTargetFallback() const { return _renderTargetFallback; }
|
||||
|
||||
|
||||
/** Set the draw buffer used at the start of each frame draw.
|
||||
* Note, a buffer value of GL_NONE is used to sepecify that the rendering back-end should choose the most appropriate buffer.*/
|
||||
void setDrawBuffer(GLenum buffer) { _drawBuffer = buffer; }
|
||||
|
||||
/** Get the draw buffer used at the start of each frame draw. */
|
||||
GLenum getDrawBuffer() const { return _drawBuffer; }
|
||||
|
||||
/** Set the read buffer for any required copy operations to use.
|
||||
* Note, a buffer value of GL_NONE is used to sepecify that the rendering back-end should choose the most appropriate buffer.*/
|
||||
void setReadBuffer(GLenum buffer) { _readBuffer = buffer; }
|
||||
|
||||
/** Get the read buffer for any required copy operations to use. */
|
||||
GLenum getReadBuffer() const { return _readBuffer; }
|
||||
|
||||
enum BufferComponent
|
||||
{
|
||||
DEPTH_BUFFER,
|
||||
STENCIL_BUFFER,
|
||||
COLOR_BUFFER,
|
||||
COLOR_BUFFER0 = COLOR_BUFFER,
|
||||
COLOR_BUFFER1 = COLOR_BUFFER+1,
|
||||
COLOR_BUFFER2 = COLOR_BUFFER+2,
|
||||
COLOR_BUFFER3 = COLOR_BUFFER+3,
|
||||
COLOR_BUFFER4 = COLOR_BUFFER+4,
|
||||
COLOR_BUFFER5 = COLOR_BUFFER+5,
|
||||
COLOR_BUFFER6 = COLOR_BUFFER+6,
|
||||
COLOR_BUFFER7 = COLOR_BUFFER+7
|
||||
};
|
||||
|
||||
void attach(BufferComponent buffer, GLenum internalFormat);
|
||||
|
||||
void attach(BufferComponent buffer, osg::Texture* texture, unsigned int level = 0, unsigned int face=0, bool mipMapGeneration=false);
|
||||
|
||||
void attach(BufferComponent buffer, osg::Image* image);
|
||||
|
||||
void detach(BufferComponent buffer);
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
Attachment():
|
||||
_internalFormat(GL_NONE),
|
||||
_level(0),
|
||||
_face(0),
|
||||
_mipMapGeneration(false) {}
|
||||
|
||||
int width() const
|
||||
{
|
||||
if (_texture.valid()) return _texture->getTextureWidth();
|
||||
if (_image.valid()) return _image->s();
|
||||
return 0;
|
||||
};
|
||||
|
||||
int height() const
|
||||
{
|
||||
if (_texture.valid()) return _texture->getTextureHeight();
|
||||
if (_image.valid()) return _image->t();
|
||||
return 0;
|
||||
};
|
||||
|
||||
int depth() const
|
||||
{
|
||||
if (_texture.valid()) return _texture->getTextureDepth();
|
||||
if (_image.valid()) return _image->r();
|
||||
return 0;
|
||||
};
|
||||
|
||||
GLenum _internalFormat;
|
||||
ref_ptr<Image> _image;
|
||||
ref_ptr<Texture> _texture;
|
||||
unsigned int _level;
|
||||
unsigned int _face;
|
||||
bool _mipMapGeneration;
|
||||
};
|
||||
|
||||
typedef std::map< BufferComponent, Attachment> BufferAttachmentMap;
|
||||
|
||||
/** Get the BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads.*/
|
||||
BufferAttachmentMap& getBufferAttachmentMap() { return _bufferAttachmentMap; }
|
||||
|
||||
/** Get the const BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads.*/
|
||||
const BufferAttachmentMap& getBufferAttachmentMap() const { return _bufferAttachmentMap; }
|
||||
|
||||
|
||||
/** Set the GraphicsContext that provides the mechansim for managing the OpenGL graphics context associated with this camera.*/
|
||||
void setGraphicsContext(GraphicsContext* context) { _graphicsContext = context; }
|
||||
|
||||
/** Get the GraphicsContext.*/
|
||||
GraphicsContext* getGraphicsContext() { return _graphicsContext.get(); }
|
||||
|
||||
/** Get the const GraphicsContext.*/
|
||||
const GraphicsContext* getGraphicsContext() const { return _graphicsContext.get(); }
|
||||
|
||||
|
||||
/** Set the Rendering object that is used to implement rendering of the subgraph.*/
|
||||
void setRenderingCache(unsigned int contextID, osg::Object* rc) { _renderingCache[contextID] = rc; }
|
||||
|
||||
/** Get the Rendering object that is used to implement rendering of the subgraph.*/
|
||||
osg::Object* getRenderingCache(unsigned int contextID) { return _renderingCache[contextID].get(); }
|
||||
|
||||
/** Get the const Rendering object that is used to implement rendering of the subgraph.*/
|
||||
const osg::Object* getRenderingCache(unsigned int contextID) const { return _renderingCache[contextID].get(); }
|
||||
|
||||
|
||||
/** Draw callback for custom operations.*/
|
||||
struct DrawCallback : virtual public Object
|
||||
{
|
||||
DrawCallback() {}
|
||||
|
||||
DrawCallback(const DrawCallback&,const CopyOp&) {}
|
||||
|
||||
META_Object(osg,DrawCallback)
|
||||
|
||||
virtual void operator () (const osg::CameraNode& /*camera*/) const {}
|
||||
};
|
||||
|
||||
/** Set the post draw callback for custom operations to do done after the drawing of the camera's subgraph has been completed.*/
|
||||
void setPostDrawCallback(DrawCallback* cb) { _postDrawCallback = cb; }
|
||||
|
||||
/** Get the post draw callback.*/
|
||||
DrawCallback* getPostDrawCallback() { return _postDrawCallback.get(); }
|
||||
|
||||
/** Get the const post draw callback.*/
|
||||
const DrawCallback* getPostDrawCallback() const { return _postDrawCallback.get(); }
|
||||
|
||||
OpenThreads::Mutex* getDataChangeMutex() const { return &_dataChangeMutex; }
|
||||
|
||||
/** If State is non-zero, this function releases any associated OpenGL objects for
|
||||
* the specified graphics context. Otherwise, releases OpenGL objexts
|
||||
* for all graphics contexts. */
|
||||
virtual void releaseGLObjects(osg::State* = 0) const;
|
||||
|
||||
public:
|
||||
|
||||
/** Transform method that must be defined to provide generic interface for scene graph traversals.*/
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const;
|
||||
|
||||
/** Transform method that must be defined to provide generic interface for scene graph traversals.*/
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const;
|
||||
|
||||
protected :
|
||||
|
||||
virtual ~CameraNode();
|
||||
|
||||
mutable OpenThreads::Mutex _dataChangeMutex;
|
||||
|
||||
|
||||
View* _view;
|
||||
|
||||
Vec4 _clearColor;
|
||||
GLbitfield _clearMask;
|
||||
ref_ptr<ColorMask> _colorMask;
|
||||
ref_ptr<Viewport> _viewport;
|
||||
|
||||
TransformOrder _transformOrder;
|
||||
Matrixd _projectionMatrix;
|
||||
Matrixd _viewMatrix;
|
||||
|
||||
RenderOrder _renderOrder;
|
||||
int _renderOrderNum;
|
||||
|
||||
GLenum _drawBuffer;
|
||||
GLenum _readBuffer;
|
||||
|
||||
RenderTargetImplementation _renderTargetImplementation;
|
||||
RenderTargetImplementation _renderTargetFallback;
|
||||
BufferAttachmentMap _bufferAttachmentMap;
|
||||
|
||||
ref_ptr<GraphicsContext> _graphicsContext;
|
||||
buffered_object< ref_ptr<Object> > _renderingCache;
|
||||
|
||||
ref_ptr<DrawCallback> _postDrawCallback;
|
||||
};
|
||||
#ifdef USE_DEPRECATED_API
|
||||
typedef osg::Camera CameraNode;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <osg/GL>
|
||||
#include <osg/Texture>
|
||||
#include <osg/buffered_value>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_EXT_framebuffer_object 1
|
||||
@ -261,7 +261,7 @@ namespace osg
|
||||
explicit FrameBufferAttachment(Texture3D* target, int zoffset, int level = 0);
|
||||
explicit FrameBufferAttachment(TextureCubeMap* target, int face, int level = 0);
|
||||
explicit FrameBufferAttachment(TextureRectangle* target);
|
||||
explicit FrameBufferAttachment(CameraNode::Attachment& attachment);
|
||||
explicit FrameBufferAttachment(Camera::Attachment& attachment);
|
||||
|
||||
~FrameBufferAttachment();
|
||||
|
||||
|
@ -38,9 +38,8 @@ class Sequence;
|
||||
class Switch;
|
||||
class TexGenNode;
|
||||
class Transform;
|
||||
class CameraNode;
|
||||
class Camera;
|
||||
class CameraView;
|
||||
class View;
|
||||
|
||||
/** Visitor for type safe operations on osg::Nodes.
|
||||
Based on GOF's Visitor pattern. The NodeVisitor
|
||||
@ -236,8 +235,7 @@ class OSG_EXPORT NodeVisitor : public virtual Referenced
|
||||
virtual void apply(LightSource& node) { apply((Group&)node); }
|
||||
|
||||
virtual void apply(Transform& node) { apply((Group&)node); }
|
||||
virtual void apply(View& node) { apply((Transform&)node); }
|
||||
virtual void apply(CameraNode& node) { apply((Transform&)node); }
|
||||
virtual void apply(Camera& node) { apply((Transform&)node); }
|
||||
virtual void apply(CameraView& node) { apply((Transform&)node); }
|
||||
virtual void apply(MatrixTransform& node) { apply((Transform&)node); }
|
||||
virtual void apply(PositionAttitudeTransform& node) { apply((Transform&)node); }
|
||||
|
@ -28,24 +28,24 @@ namespace osg {
|
||||
/** Compute the matrix which transforms objects in local coords to world coords,
|
||||
* by accumulating the Transform local to world matrices along the specified node path.
|
||||
*/
|
||||
extern OSG_EXPORT Matrix computeLocalToWorld(const NodePath& nodePath, bool ignoreCameraNodes = true);
|
||||
extern OSG_EXPORT Matrix computeLocalToWorld(const NodePath& nodePath, bool ignoreCameras = true);
|
||||
|
||||
/** Compute the matrix which transforms objects in world coords to local coords,
|
||||
* by accumulating the Transform world to local matrices along the specified node path.
|
||||
*/
|
||||
extern OSG_EXPORT Matrix computeWorldToLocal(const NodePath& nodePath, bool ignoreCameraNodes = true);
|
||||
extern OSG_EXPORT Matrix computeWorldToLocal(const NodePath& nodePath, bool ignoreCameras = true);
|
||||
|
||||
/** Compute the matrix which transforms objects in local coords to eye coords,
|
||||
* by accumulating the Transform local to world matrices along the specified node path
|
||||
* and multipling by the supplied initial camera modelview.
|
||||
*/
|
||||
extern OSG_EXPORT Matrix computeLocalToEye(const Matrix& modelview, const NodePath& nodePath, bool ignoreCameraNodes = true);
|
||||
extern OSG_EXPORT Matrix computeLocalToEye(const Matrix& modelview, const NodePath& nodePath, bool ignoreCameras = true);
|
||||
|
||||
/** Compute the matrix which transforms objects in eye coords to local coords,
|
||||
* by accumulating the Transform world to local matrices along the specified node path
|
||||
* and multipling by the inverse of the supplied initialial camera modelview.
|
||||
*/
|
||||
extern OSG_EXPORT Matrix computeEyeToLocal(const Matrix& modelview, const NodePath& nodePath, bool ignoreCameraNodes = true);
|
||||
extern OSG_EXPORT Matrix computeEyeToLocal(const Matrix& modelview, const NodePath& nodePath, bool ignoreCameras = true);
|
||||
|
||||
|
||||
/** A Transform is a group node for which all children are transformed by
|
||||
|
139
include/osg/View
139
include/osg/View
@ -14,112 +14,43 @@
|
||||
#ifndef OSG_VIEW
|
||||
#define OSG_VIEW 1
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <OpenThreads/Mutex>
|
||||
|
||||
namespace osg {
|
||||
|
||||
/** View - is a subclass of Transform which encompasses all the cameras that combine to make up a single view of the scene.
|
||||
/** View - maintains a master camera view and a list of slave cameras that are relative to this master camera.
|
||||
* Note, if no slave cameras are attached to the view then the master camera does both the control and implementation of the rendering of the scene,
|
||||
* but if slave cameras are present then the master controls the view onto the scene, while the slaves implement the rendering of the scene.
|
||||
*/
|
||||
class OSG_EXPORT View : public osg::Transform, public CullSettings
|
||||
class OSG_EXPORT View : public osg::Referenced
|
||||
{
|
||||
public :
|
||||
|
||||
|
||||
View();
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
View(const View&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
/** Set the master camera of the view. */
|
||||
void setCamera(osg::Camera* camera) { _camera = camera; }
|
||||
|
||||
META_Node(osg, View);
|
||||
/** Get the master camera of the view. */
|
||||
osg::Camera* getCamera() { return _camera.get(); }
|
||||
|
||||
/** Get the const master camera of the view. */
|
||||
const osg::Camera* getCamera() const { return _camera.get(); }
|
||||
|
||||
/** Set the projection matrix. Can be thought of as setting the lens of a camera. */
|
||||
inline void setProjectionMatrix(const osg::Matrixf& matrix) { _projectionMatrix.set(matrix); updateCameras(); }
|
||||
|
||||
/** Set the projection matrix. Can be thought of as setting the lens of a camera. */
|
||||
inline void setProjectionMatrix(const osg::Matrixd& matrix) { _projectionMatrix.set(matrix); updateCameras(); }
|
||||
|
||||
/** Set to an orthographic projection. See OpenGL glOrtho for documentation further details.*/
|
||||
void setProjectionMatrixAsOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Set to a 2D orthographic projection. See OpenGL glOrtho2D documentation for further details.*/
|
||||
void setProjectionMatrixAsOrtho2D(double left, double right,
|
||||
double bottom, double top);
|
||||
|
||||
/** Set to a perspective projection. See OpenGL glFrustum documentation for further details.*/
|
||||
void setProjectionMatrixAsFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details.
|
||||
* Aspect ratio is defined as width/height.*/
|
||||
void setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar);
|
||||
|
||||
/** Get the projection matrix.*/
|
||||
osg::Matrixd& getProjectionMatrix() { return _projectionMatrix; }
|
||||
|
||||
/** Get the const projection matrix.*/
|
||||
const osg::Matrixd& getProjectionMatrix() const { return _projectionMatrix; }
|
||||
|
||||
/** Get the othographic settings of the orthographic projection matrix.
|
||||
* Returns false if matrix is not an orthographic matrix, where parameter values are undefined.*/
|
||||
bool getProjectionMatrixAsOrtho(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
/** Get the frustum setting of a perspective projection matrix.
|
||||
* Returns false if matrix is not a perspective matrix, where parameter values are undefined.*/
|
||||
bool getProjectionMatrixAsFrustum(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
/** Get the frustum setting of a symmetric perspective projection matrix.
|
||||
* Returns false if matrix is not a perspective matrix, where parameter values are undefined.
|
||||
* Note, if matrix is not a symmetric perspective matrix then the shear will be lost.
|
||||
* Asymmetric matrices occur when stereo, power walls, caves and reality center display are used.
|
||||
* In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead.*/
|
||||
bool getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
|
||||
double& zNear, double& zFar);
|
||||
|
||||
|
||||
|
||||
/** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
|
||||
inline void setViewMatrix(const osg::Matrixf& matrix) { _viewMatrix.set(matrix); dirtyBound(); updateCameras(); }
|
||||
|
||||
/** Set the view matrix. Can be thought of as setting the position of the world relative to the camera in camera coordinates. */
|
||||
inline void setViewMatrix(const osg::Matrixd& matrix) { _viewMatrix.set(matrix); dirtyBound(); updateCameras(); }
|
||||
|
||||
/** Set to the position and orientation of view matrix, using the same convention as gluLookAt. */
|
||||
void setViewMatrixAsLookAt(const osg::Vec3& eye,const osg::Vec3& center,const osg::Vec3& up);
|
||||
|
||||
/** Get the view matrix. */
|
||||
osg::Matrixd& getViewMatrix() { return _viewMatrix; }
|
||||
|
||||
/** Get the const view matrix. */
|
||||
const osg::Matrixd& getViewMatrix() const { return _viewMatrix; }
|
||||
|
||||
/** Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. */
|
||||
void getViewMatrixAsLookAt(osg::Vec3& eye,osg::Vec3& center,osg::Vec3& up,float lookDistance=1.0f);
|
||||
|
||||
/** Get the inverse view matrix.*/
|
||||
Matrixd getInverseViewMatrix() const;
|
||||
|
||||
|
||||
struct CameraData
|
||||
/** Slave allows one to up a camera that follows the master with a local offset to the project and view matrices.*/
|
||||
struct Slave
|
||||
{
|
||||
CameraData() {}
|
||||
CameraData(osg::CameraNode* camera, const osg::Matrixd& projectionOffset, const osg::Matrixd& viewOffset):
|
||||
Slave() {}
|
||||
Slave(osg::Camera* camera, const osg::Matrixd& projectionOffset, const osg::Matrixd& viewOffset):
|
||||
_camera(camera), _projectionOffset(projectionOffset), _viewOffset(viewOffset) {}
|
||||
|
||||
CameraData(const CameraData& rhs) :
|
||||
Slave(const Slave& rhs) :
|
||||
_camera(rhs._camera), _projectionOffset(rhs._projectionOffset), _viewOffset(rhs._viewOffset) {}
|
||||
|
||||
CameraData& operator = (const CameraData& rhs)
|
||||
Slave& operator = (const Slave& rhs)
|
||||
{
|
||||
_camera = rhs._camera;
|
||||
_projectionOffset = rhs._projectionOffset;
|
||||
@ -127,46 +58,32 @@ class OSG_EXPORT View : public osg::Transform, public CullSettings
|
||||
return *this;
|
||||
}
|
||||
|
||||
osg::ref_ptr<osg::CameraNode> _camera;
|
||||
osg::ref_ptr<osg::Camera> _camera;
|
||||
osg::Matrixd _projectionOffset;
|
||||
osg::Matrixd _viewOffset;
|
||||
};
|
||||
|
||||
bool addCamera(osg::CameraNode* camera) { return addCamera(camera, osg::Matrix::identity(), osg::Matrix::identity()); }
|
||||
bool addSlave(osg::Camera* camera) { return addSlave(camera, osg::Matrix::identity(), osg::Matrix::identity()); }
|
||||
|
||||
bool addCamera(osg::CameraNode* camera, const osg::Matrix& projectionOffset, const osg::Matrix& viewOffse);
|
||||
bool addSlave(osg::Camera* camera, const osg::Matrix& projectionOffset, const osg::Matrix& viewOffse);
|
||||
|
||||
bool removeCamera(unsigned int pos);
|
||||
bool removeSlave(unsigned int pos);
|
||||
|
||||
unsigned int getNumCameras() const { return _cameras.size(); }
|
||||
|
||||
CameraNode* getCamera(unsigned int pos) { return _cameras[pos]._camera.get(); }
|
||||
const CameraNode* getCamera(unsigned int pos) const { return _cameras[pos]._camera.get(); }
|
||||
|
||||
CameraData& getCameraData(unsigned int pos) { return _cameras[pos]; }
|
||||
const CameraData& getCameraData(unsigned int pos) const { return _cameras[pos]; }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/** Transform method that must be defined to provide generic interface for scene graph traversals.*/
|
||||
virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const;
|
||||
|
||||
/** Transform method that must be defined to provide generic interface for scene graph traversals.*/
|
||||
virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const;
|
||||
unsigned int getNumSlaves() const { return _slaves.size(); }
|
||||
|
||||
Slave& getSlave(unsigned int pos) { return _slaves[pos]; }
|
||||
const Slave& getSlave(unsigned int pos) const { return _slaves[pos]; }
|
||||
|
||||
protected :
|
||||
|
||||
virtual ~View();
|
||||
|
||||
void updateCameras();
|
||||
void updateSlaves();
|
||||
|
||||
Matrixd _projectionMatrix;
|
||||
Matrixd _viewMatrix;
|
||||
osg::ref_ptr<osg::Camera> _camera;
|
||||
|
||||
typedef std::vector<CameraData> CameraList;
|
||||
CameraList _cameras;
|
||||
typedef std::vector<Slave> Slaves;
|
||||
Slaves _slaves;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef OSGSHADOW_PARALLELSPLITSHADOWMAP
|
||||
#define OSGSHADOW_PARALLELSPLITSHADOWMAP 1
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgShadow/ShadowTechnique>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef OSGSHADOW_SHADOWEDTEXTURE
|
||||
#define OSGSHADOW_SHADOWEDTEXTURE 1
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgShadow/ShadowTechnique>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define OSGSHADOW_SHADOWEDTECHNIQUE 1
|
||||
|
||||
#include <osg/buffered_value>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Texture2D>
|
||||
#include <osg/TexGenNode>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef OSGSHADOW_SHADOWEDTEXTURE
|
||||
#define OSGSHADOW_SHADOWEDTEXTURE 1
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgShadow/ShadowTechnique>
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#ifndef OSGSHADOW_SHADOWVOLUME
|
||||
#define OSGSHADOW_SHADOWVOLUME 1
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgShadow/ShadowTechnique>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define OSGSHADOW_SHADOWEDSCENE 1
|
||||
|
||||
#include <osg/buffered_value>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Texture2D>
|
||||
#include <osg/TexGenNode>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <osg/AlphaFunc>
|
||||
#include <osg/TexEnv>
|
||||
#include <osg/Texture2D>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgSim/Export>
|
||||
|
||||
@ -152,13 +152,13 @@ class OSGSIM_EXPORT ImpostorSprite : public osg::Drawable
|
||||
virtual osg::BoundingBox computeBound() const;
|
||||
|
||||
/** Set the camera node to use for pre rendering the impostor sprite's texture.*/
|
||||
void setCameraNode(osg::CameraNode* camera) { _camera = camera; }
|
||||
void setCamera(osg::Camera* camera) { _camera = camera; }
|
||||
|
||||
/** Get the camera node to use for pre rendering the impostor sprite's texture.*/
|
||||
osg::CameraNode* getCameraNode() { return _camera.get(); }
|
||||
osg::Camera* getCamera() { return _camera.get(); }
|
||||
|
||||
/** Get the const camera node to use for pre rendering the impostor sprite's texture.*/
|
||||
const osg::CameraNode* getCameraNode() const { return _camera.get(); }
|
||||
const osg::Camera* getCamera() const { return _camera.get(); }
|
||||
|
||||
protected:
|
||||
|
||||
@ -172,7 +172,7 @@ class OSGSIM_EXPORT ImpostorSprite : public osg::Drawable
|
||||
friend class osgSim::ImpostorSpriteManager;
|
||||
|
||||
// camera node for doing the pre rendering.
|
||||
osg::ref_ptr<osg::CameraNode> _camera;
|
||||
osg::ref_ptr<osg::Camera> _camera;
|
||||
|
||||
// support for a double linked list managed by the
|
||||
// ImposotorSpriteManager.
|
||||
|
@ -15,7 +15,7 @@
|
||||
#define OSGSIM_OVERLAYNODE 1
|
||||
|
||||
#include <osg/buffered_value>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Texture2D>
|
||||
#include <osg/TexGenNode>
|
||||
|
||||
@ -82,10 +82,10 @@ class OSGSIM_EXPORT OverlayNode : public osg::Group
|
||||
|
||||
|
||||
/** Get the camera used to implement the render to texture of the overlay subgraph.*/
|
||||
osg::CameraNode* getCamera() { return _camera.get(); }
|
||||
osg::Camera* getCamera() { return _camera.get(); }
|
||||
|
||||
/** Get the const camera used to implement the render to texture of the overlay subgraph.*/
|
||||
const osg::CameraNode* getCamera() const { return _camera.get(); }
|
||||
const osg::Camera* getCamera() const { return _camera.get(); }
|
||||
|
||||
protected :
|
||||
|
||||
@ -99,7 +99,7 @@ class OSGSIM_EXPORT OverlayNode : public osg::Group
|
||||
|
||||
mutable TextureObjectValidList _textureObjectValidList;
|
||||
|
||||
osg::ref_ptr<osg::CameraNode> _camera;
|
||||
osg::ref_ptr<osg::Camera> _camera;
|
||||
|
||||
// overlay subgraph is render to a texture
|
||||
osg::ref_ptr<osg::Node> _overlaySubgraph;
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <osg/StateSet>
|
||||
#include <osg/State>
|
||||
#include <osg/ClearNode>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osg/CullStack>
|
||||
@ -76,7 +76,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
|
||||
virtual void apply(osg::Switch& node);
|
||||
virtual void apply(osg::LOD& node);
|
||||
virtual void apply(osg::ClearNode& node);
|
||||
virtual void apply(osg::CameraNode& node);
|
||||
virtual void apply(osg::Camera& node);
|
||||
virtual void apply(osg::OccluderNode& node);
|
||||
|
||||
void setClearNode(const osg::ClearNode* earthSky) { _clearNode = earthSky; }
|
||||
|
@ -213,7 +213,7 @@ class OSGUTIL_EXPORT PickVisitor : public osgUtil::IntersectVisitor
|
||||
|
||||
void apply(osg::Projection& projection);
|
||||
|
||||
void apply(osg::CameraNode& camera);
|
||||
void apply(osg::Camera& camera);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -323,7 +323,7 @@ class OSGUTIL_EXPORT IntersectionVisitor : public osg::NodeVisitor
|
||||
virtual void apply(osg::PagedLOD& lod);
|
||||
virtual void apply(osg::Transform& transform);
|
||||
virtual void apply(osg::Projection& projection);
|
||||
virtual void apply(osg::CameraNode& camera);
|
||||
virtual void apply(osg::Camera& camera);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <osg/Viewport>
|
||||
#include <osg/Texture>
|
||||
#include <osg/FrameBufferObject>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgUtil/RenderBin>
|
||||
#include <osgUtil/PositionalStateContainer>
|
||||
@ -119,9 +119,9 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
/** Get the clear color.*/
|
||||
int getClearStencil() const { return _clearStencil; }
|
||||
|
||||
void setCameraNode(osg::CameraNode* camera) { if (_camera!=camera) { _camera = camera; _cameraRequiresSetUp = true; } }
|
||||
osg::CameraNode* getCameraNode() { return _camera; }
|
||||
const osg::CameraNode* getCameraNode() const { return _camera; }
|
||||
void setCamera(osg::Camera* camera) { if (_camera!=camera) { _camera = camera; _cameraRequiresSetUp = true; } }
|
||||
osg::Camera* getCamera() { return _camera; }
|
||||
const osg::Camera* getCamera() const { return _camera; }
|
||||
|
||||
void setCameraRequiresSetUp(bool flag) { _cameraRequiresSetUp = flag; }
|
||||
bool getCameraRequiresSetUp() const { return _cameraRequiresSetUp; }
|
||||
@ -210,7 +210,7 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
GLenum _imageReadPixelDataType;
|
||||
};
|
||||
|
||||
void attach(osg::CameraNode::BufferComponent buffer, osg::Image* image);
|
||||
void attach(osg::Camera::BufferComponent buffer, osg::Image* image);
|
||||
|
||||
protected:
|
||||
|
||||
@ -236,7 +236,7 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
int _clearStencil;
|
||||
|
||||
bool _cameraRequiresSetUp;
|
||||
osg::CameraNode* _camera;
|
||||
osg::Camera* _camera;
|
||||
|
||||
osg::ref_ptr<osg::Texture> _texture;
|
||||
unsigned int _level;
|
||||
@ -246,7 +246,7 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
GLenum _imageReadPixelFormat;
|
||||
GLenum _imageReadPixelDataType;
|
||||
|
||||
std::map< osg::CameraNode::BufferComponent, Attachment> _bufferAttachmentMap;
|
||||
std::map< osg::Camera::BufferComponent, Attachment> _bufferAttachmentMap;
|
||||
|
||||
osg::ref_ptr<osg::FrameBufferObject> _fbo;
|
||||
osg::ref_ptr<osg::GraphicsContext> _graphicsContext;
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include <osg/DisplaySettings>
|
||||
#include <osg/CollectOccludersVisitor>
|
||||
#include <osg/CullSettings>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osgUtil/CullVisitor>
|
||||
|
||||
@ -56,13 +56,13 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced, public osg::CullSetting
|
||||
void setDefaults(unsigned int options = STANDARD_SETTINGS);
|
||||
|
||||
/** Set the camera used to represent the camera view of this SceneView.*/
|
||||
void setCamera(osg::CameraNode* camera);
|
||||
void setCamera(osg::Camera* camera);
|
||||
|
||||
/** Get the camera used to represent the camera view of this SceneView.*/
|
||||
osg::CameraNode* getCamera() { return _camera.get(); }
|
||||
osg::Camera* getCamera() { return _camera.get(); }
|
||||
|
||||
/** Get the const camera used to represent the camera view of this SceneView.*/
|
||||
const osg::CameraNode* getCamera() const { return _camera.get(); }
|
||||
const osg::Camera* getCamera() const { return _camera.get(); }
|
||||
|
||||
/** Set the data to view. The data will typically be
|
||||
* an osg::Scene but can be any osg::Node type.
|
||||
@ -500,7 +500,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced, public osg::CullSetting
|
||||
|
||||
osg::ref_ptr<osg::FrameStamp> _frameStamp;
|
||||
|
||||
osg::ref_ptr<osg::CameraNode> _camera;
|
||||
osg::ref_ptr<osg::Camera> _camera;
|
||||
|
||||
osg::ref_ptr<osg::StateSet> _globalStateSet;
|
||||
osg::ref_ptr<osg::Light> _light;
|
||||
|
68
include/osgViewer/CompositeViewer
Normal file
68
include/osgViewer/CompositeViewer
Normal file
@ -0,0 +1,68 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGVIEWER_CompositeViewer
|
||||
#define OSGVIEWER_CompositeViewer 1
|
||||
|
||||
#include <osgViewer/GraphicsWindow>
|
||||
#include <osgViewer/View>
|
||||
|
||||
namespace osgViewer {
|
||||
|
||||
// WARNING ** Under development do not use, yet :-)
|
||||
|
||||
/** CompsiteViewer holds a or more views to a one more scenes.*/
|
||||
class OSGVIEWER_EXPORT CompositeViewer : public osg::Referenced
|
||||
{
|
||||
public:
|
||||
|
||||
CompositeViewer();
|
||||
virtual ~CompositeViewer();
|
||||
|
||||
void addView(osgViewer* view);
|
||||
osgViewer* getView(unsigned i) { return _views[i].get(); }
|
||||
const osgViewer* getView(unsigned i) const { return _views[i].get(); }
|
||||
void getNumViews() const { return _views.size(); }
|
||||
|
||||
/** Render a complete new frame.
|
||||
* Calls frameAdvance(), frameEventTraversal(), frameUpateTraversal(), frameCullTraversal() and frameDrawTraversal().
|
||||
* Note, no internal makeCurrent() is issued before, or swap buffers called after frame(), these operations are the responsibility of the calling code.*/
|
||||
virtual void frame();
|
||||
|
||||
virtual void frameAdvance();
|
||||
virtual void frameEventTraversal();
|
||||
virtual void frameUpdateTraversal();
|
||||
virtual void frameCullTraversal();
|
||||
virtual void frameDrawTraversal();
|
||||
|
||||
/** Release all OpenGL objects associated with this viewer's scenegraph. Note, does not deleted the actual OpenGL objects, it just releases them to the pending GL object delete lists which will need flushing once a valid graphics context is obtained.*/
|
||||
virtual void releaseAllGLObjects();
|
||||
|
||||
/** Clean up all OpenGL objects associated with this viewer's scenegraph. Note, must only be called from the graphics context associated with this viewer.*/
|
||||
virtual void cleanup();
|
||||
|
||||
public:
|
||||
|
||||
void init();
|
||||
|
||||
protected:
|
||||
|
||||
typedef std::vector< osg::ref_ptr<osg:Viewer:View> > Views;
|
||||
Views _views;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
88
include/osgViewer/GraphicsWindowProxy
Normal file
88
include/osgViewer/GraphicsWindowProxy
Normal file
@ -0,0 +1,88 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGVIEWER_GRAPHICWINDOW
|
||||
#define OSGVIEWER_GRAPHICWINDOW 1
|
||||
|
||||
#include <osg/GraphicsContext>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <osgGA/EventQueue>
|
||||
|
||||
#include <osgViewer/Export>
|
||||
|
||||
namespace osgViewer {
|
||||
|
||||
/** GraphicsWindowProxy acts as an adpater GraphicsWindow which allows the implementation of the GraphicsWindow to be decoupled */
|
||||
class OSGVIEWER_EXPORT GraphicsWindowProxy : public osgViewer::GraphicsWindow
|
||||
{
|
||||
public:
|
||||
|
||||
GraphicsWindowProxy();
|
||||
|
||||
void setGraphicsWindowImplentation(osgViewer::GraphicsWindow* gw) { _gw = gw; }
|
||||
|
||||
osgViewer::GraphicsWindow* getGraphicsWindowImplentation() { return _gw.get(); }
|
||||
|
||||
const osgViewer::GraphicsWindow* getGraphicsWindowImplentation() const { return _gw.get(); }
|
||||
|
||||
/** Realise the GraphicsContext implementation,
|
||||
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
|
||||
virtual bool realizeImplementation() { if (_gw.valid()) return _gw->realizeImplementation(); else osg::notify(osg::NOTICE)<<"GraphicsWindow::realizeImplementation() not implemented."<<std::endl; return false; }
|
||||
|
||||
/** Return true if the graphics context has been realised, and is ready to use, implementation.
|
||||
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
|
||||
virtual bool isRealizedImplementation() const { if (_gw.valid()) return gw->isRealizedImplementation(); else osg::notify(osg::NOTICE)<<"GraphicsWindow::isRealizedImplementation() not implemented."<<std::endl; return false; }
|
||||
|
||||
/** Close the graphics context implementation.
|
||||
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
|
||||
virtual void closeImplementation() { if (_gw.valid()) _gw->closeImplementation(); else osg::notify(osg::NOTICE)<<"GraphicsWindow::closeImplementation() not implemented."<<std::endl; }
|
||||
|
||||
/** Make this graphics context current implementation.
|
||||
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
|
||||
virtual void makeCurrentImplementation() { if (_gw.valid()) _gw->makeCurrentImplementation(); else osg::notify(osg::NOTICE)<<"GraphicsWindow::makeCurrentImplementation() not implemented."<<std::endl; }
|
||||
|
||||
/** Make this graphics context current with specified read context implementation.
|
||||
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
|
||||
virtual void makeContextCurrentImplementation(GraphicsContext* readContext) { if (_gw.valid()) _gw->makeContextCurrentImplementation(readContext); else osg::notify(osg::NOTICE)<<"GraphicsWindow::makeContextCurrentImplementation(..) not implemented."<<std::endl; }
|
||||
|
||||
/** Pure virtual, Bind the graphics context to associated texture implementation.
|
||||
* Pure virtual - must be implemented by concrate implementations of GraphicsContext. */
|
||||
virtual void bindPBufferToTextureImplementation(GLenum buffer) { if (_gw.valid()) _gw->bindPBufferToTextureImplementation(buffer) else osg::notify(osg::NOTICE)<<"GraphicsWindow::void bindPBufferToTextureImplementation(..) not implemented."<<std::endl; }
|
||||
|
||||
/** Swap the front and back buffers implementation.
|
||||
* Pure virtual - must be implemented by Concrate implementations of GraphicsContext. */
|
||||
virtual void swapBuffersImplementation() { if (_gw.valid()) _gw->swapBuffersImplementation() else osg::notify(osg::NOTICE)<<"GraphicsWindow:: swapBuffersImplementation() not implemented."<<std::endl; }
|
||||
|
||||
public:
|
||||
|
||||
// Override from GUIActionAdapter
|
||||
virtual void requestRedraw() { if (_gw.valid()) _gw->requestRedraw(); }
|
||||
|
||||
// Override from GUIActionAdapter
|
||||
virtual void requestContinuousUpdate(bool needed=true) { if (_gw.valid()) _gw->tequestContinuousUpdate(needed); }
|
||||
|
||||
// Override from GUIActionAdapter
|
||||
virtual void requestWarpPointer(float x,float y) { if (_gw.valid()) _gw->requestWarpPointer(x,y); }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
osg::ref_ptr<osgViewer::GraphicsWindow> _gw;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
87
include/osgViewer/Scene
Normal file
87
include/osgViewer/Scene
Normal file
@ -0,0 +1,87 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGVIEWER_SCENE
|
||||
#define OSGVIEWER_SCENE 1
|
||||
|
||||
#include <osgUtil/UpdateVisitor>
|
||||
#include <osgGA/GUIEventHandler>
|
||||
#include <osgGA/EventVisitor>
|
||||
#include <osgDB/DatabasePager>
|
||||
|
||||
#include <osgViewer/Export>
|
||||
|
||||
#include <list>
|
||||
|
||||
namespace osgViewer{
|
||||
|
||||
// WARNING ** Under development do not use, yet :-)
|
||||
|
||||
/** Scene holds the highe level reference to a single scene graph.*/
|
||||
class OSGVIEWER_EXPORT Scene : public virtual osg::Referenced
|
||||
{
|
||||
public:
|
||||
|
||||
Scene();
|
||||
virtual ~Scene();
|
||||
|
||||
void setSceneData(osg::Node* node);
|
||||
osg::Node* getSceneData();
|
||||
const osg::Node* getSceneData() const;
|
||||
|
||||
|
||||
void setEventQueue(osgGA::EventQueue* eventQueue) { _eventQueue = eventQueue; }
|
||||
osgGA::EventQueue* getEventQueue() { return _eventQueue.get(); }
|
||||
const osgGA::EventQueue* getEventQueue() const { return _eventQueue.get(); }
|
||||
|
||||
typedef std::list< osg::ref_ptr<osgGA::GUIEventHandler> > EventHandlers;
|
||||
|
||||
void addEventHandler(osgGA::GUIEventHandler* eventHandler);
|
||||
EventHandlers& getEventHandlers() { return _eventHandlers; }
|
||||
const EventHandlers& getEventHandlers() const { return _eventHandlers; }
|
||||
|
||||
void setDatabasePager(osgDB::DatabasePager* dp);
|
||||
osgDB::DatabasePager* getDatabasePager() { return _databasePager.get(); }
|
||||
const osgDB::DatabasePager* getDatabasePager() const { return _databasePager.get(); }
|
||||
|
||||
virtual void frameAdvance();
|
||||
virtual void frameEventTraversal();
|
||||
virtual void frameUpdateTraversal();
|
||||
|
||||
public:
|
||||
|
||||
void init();
|
||||
|
||||
protected:
|
||||
|
||||
bool _firstFrame;
|
||||
osg::Timer_t _startTick;
|
||||
osg::ref_ptr<osg::FrameStamp> _frameStamp;
|
||||
|
||||
osg::ref_ptr<osg::Node> _sceneData;
|
||||
|
||||
osg::ref_ptr<osgUtil::UpdateVisitor> _updateVisitor;
|
||||
|
||||
osg::ref_ptr<osgGA::EventQueue> _eventQueue;
|
||||
osg::ref_ptr<osgGA::EventVisitor> _eventVisitor;
|
||||
|
||||
osg::ref_ptr<osgDB::DatabasePager> _databasePager;
|
||||
|
||||
EventHandlers _eventHandlers;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -42,8 +42,8 @@ class OSGVIEWER_EXPORT SimpleViewer : public virtual osgViewer::GraphicsWindow
|
||||
const osgDB::DatabasePager* getDatabasePager() const { return _databasePager.get(); }
|
||||
|
||||
|
||||
osg::CameraNode* getCamera();
|
||||
const osg::CameraNode* getCamera() const;
|
||||
osg::Camera* getCamera();
|
||||
const osg::Camera* getCamera() const;
|
||||
|
||||
void setCameraManipulator(osgGA::MatrixManipulator* manipulator);
|
||||
osgGA::MatrixManipulator* getCameraManipulator() { return _cameraManipulator.get(); }
|
||||
|
58
include/osgViewer/View
Normal file
58
include/osgViewer/View
Normal file
@ -0,0 +1,58 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGVIEWER_VIEW
|
||||
#define OSGVIEWER_VIEW 1
|
||||
|
||||
#include <osg/View>
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgViewer/Scene>
|
||||
|
||||
/** View holds a single view on a scene, this view may be composed of one or more slave cameras.*/
|
||||
class OSGVIEWER_EXPORT View : public virtual osg::View, public osgViewer::Scene
|
||||
{
|
||||
public:
|
||||
|
||||
View();
|
||||
virtual ~View();
|
||||
|
||||
void setSceneData(osg::Node* node);
|
||||
osg::Node* getSceneData();
|
||||
const osg::Node* getSceneData() const;
|
||||
|
||||
void setCameraManipulator(osgGA::MatrixManipulator* manipulator);
|
||||
osgGA::MatrixManipulator* getCameraManipulator() { return _cameraManipulator.get(); }
|
||||
const osgGA::MatrixManipulator* getCameraManipulator() const { return _cameraManipulator.get(); }
|
||||
|
||||
typedef std::list< osg::ref_ptr<osgGA::GUIEventHandler> > EventHandlers;
|
||||
|
||||
void addEventHandler(osgGA::GUIEventHandler* eventHandler);
|
||||
EventHandlers& getEventHandlers() { return _eventHandlers; }
|
||||
const EventHandlers& getEventHandlers() const { return _eventHandlers; }
|
||||
|
||||
public:
|
||||
|
||||
void init();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
osg::ref_ptr<osgViewer::Scene> _scene;
|
||||
|
||||
osg::ref_ptr<osgUtil::SceneView> _sceneView;
|
||||
osg::ref_ptr<osgGA::MatrixManipulator> _cameraManipulator;
|
||||
EventHandlers _eventHandlers;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
61
include/osgViewer/Viewer
Normal file
61
include/osgViewer/Viewer
Normal file
@ -0,0 +1,61 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGVIEWER_Viewer
|
||||
#define OSGVIEWER_Viewer 1
|
||||
|
||||
#include <osgViewer/GraphicsWindow>
|
||||
#include <osgViewer/View>
|
||||
|
||||
namespace osgViewer{
|
||||
|
||||
// WARNING ** Under development do not use, yet :-)
|
||||
|
||||
/** Viewer holds a single view on to a single scene..*/
|
||||
class OSGVIEWER_EXPORT Viewer : public osgViewer::View
|
||||
{
|
||||
public:
|
||||
|
||||
Viewer();
|
||||
virtual ~Viewer();
|
||||
|
||||
/** Render a complete new frame.
|
||||
* Calls frameAdvance(), frameEventTraversal(), frameUpateTraversal(), frameCullTraversal() and frameDrawTraversal().
|
||||
* Note, no internal makeCurrent() is issued before, or swap buffers called after frame(), these operations are the responsibility of the calling code.*/
|
||||
virtual void frame();
|
||||
|
||||
virtual void frameAdvance();
|
||||
virtual void frameEventTraversal();
|
||||
virtual void frameUpdateTraversal();
|
||||
virtual void frameCullTraversal();
|
||||
virtual void frameDrawTraversal();
|
||||
|
||||
/** Release all OpenGL objects associated with this viewer's scenegraph. Note, does not deleted the actual OpenGL objects, it just releases them to the pending GL object delete lists which will need flushing once a valid graphics context is obtained.*/
|
||||
virtual void releaseAllGLObjects();
|
||||
|
||||
/** Clean up all OpenGL objects associated with this viewer's scenegraph. Note, must only be called from the graphics context associated with this viewer.*/
|
||||
virtual void cleanup();
|
||||
|
||||
public:
|
||||
|
||||
void init();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -13,7 +13,7 @@
|
||||
#include <osg/AnimationPath>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/CameraView>
|
||||
#include <osg/io_utils>
|
||||
|
||||
@ -156,7 +156,7 @@ class AnimationPathCallbackVisitor : public NodeVisitor
|
||||
_pivotPoint(pivotPoint),
|
||||
_useInverseMatrix(useInverseMatrix) {}
|
||||
|
||||
virtual void apply(CameraNode& camera)
|
||||
virtual void apply(Camera& camera)
|
||||
{
|
||||
Matrix matrix;
|
||||
if (_useInverseMatrix)
|
||||
|
@ -10,12 +10,12 @@
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Notify>
|
||||
|
||||
using namespace osg;
|
||||
|
||||
CameraNode::CameraNode():
|
||||
Camera::Camera():
|
||||
_view(0),
|
||||
_clearColor(osg::Vec4(0.0f,0.0f,0.0f,1.0f)),
|
||||
_clearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT),
|
||||
@ -30,7 +30,7 @@ CameraNode::CameraNode():
|
||||
setStateSet(new StateSet);
|
||||
}
|
||||
|
||||
CameraNode::CameraNode(const CameraNode& camera,const CopyOp& copyop):
|
||||
Camera::Camera(const Camera& camera,const CopyOp& copyop):
|
||||
Transform(camera,copyop),
|
||||
CullSettings(camera),
|
||||
_view(camera._view),
|
||||
@ -53,23 +53,23 @@ CameraNode::CameraNode(const CameraNode& camera,const CopyOp& copyop):
|
||||
}
|
||||
|
||||
|
||||
CameraNode::~CameraNode()
|
||||
Camera::~Camera()
|
||||
{
|
||||
}
|
||||
|
||||
bool CameraNode::isRenderToTextureCamera() const
|
||||
bool Camera::isRenderToTextureCamera() const
|
||||
{
|
||||
return (!_bufferAttachmentMap.empty());
|
||||
}
|
||||
|
||||
void CameraNode::setRenderTargetImplementation(RenderTargetImplementation impl)
|
||||
void Camera::setRenderTargetImplementation(RenderTargetImplementation impl)
|
||||
{
|
||||
_renderTargetImplementation = impl;
|
||||
if (impl<FRAME_BUFFER) _renderTargetFallback = (RenderTargetImplementation)(impl+1);
|
||||
else _renderTargetFallback = impl;
|
||||
}
|
||||
|
||||
void CameraNode::setRenderTargetImplementation(RenderTargetImplementation impl, RenderTargetImplementation fallback)
|
||||
void Camera::setRenderTargetImplementation(RenderTargetImplementation impl, RenderTargetImplementation fallback)
|
||||
{
|
||||
if (impl<fallback || (impl==FRAME_BUFFER && fallback==FRAME_BUFFER))
|
||||
{
|
||||
@ -78,12 +78,12 @@ void CameraNode::setRenderTargetImplementation(RenderTargetImplementation impl,
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Warning: CameraNode::setRenderTargetImplementation(impl,fallback) must have a lower rated fallback than the main target implementation."<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"Warning: Camera::setRenderTargetImplementation(impl,fallback) must have a lower rated fallback than the main target implementation."<<std::endl;
|
||||
setRenderTargetImplementation(impl);
|
||||
}
|
||||
}
|
||||
|
||||
void CameraNode::setColorMask(osg::ColorMask* colorMask)
|
||||
void Camera::setColorMask(osg::ColorMask* colorMask)
|
||||
{
|
||||
if (_colorMask == colorMask) return;
|
||||
|
||||
@ -101,13 +101,13 @@ void CameraNode::setColorMask(osg::ColorMask* colorMask)
|
||||
}
|
||||
}
|
||||
|
||||
void CameraNode::setColorMask(bool red, bool green, bool blue, bool alpha)
|
||||
void Camera::setColorMask(bool red, bool green, bool blue, bool alpha)
|
||||
{
|
||||
if (!_colorMask) setColorMask(new osg::ColorMask);
|
||||
if (_colorMask.valid()) _colorMask->setMask(red,green,blue,alpha);
|
||||
}
|
||||
|
||||
void CameraNode::setViewport(osg::Viewport* viewport)
|
||||
void Camera::setViewport(osg::Viewport* viewport)
|
||||
{
|
||||
if (_viewport == viewport) return;
|
||||
|
||||
@ -125,19 +125,19 @@ void CameraNode::setViewport(osg::Viewport* viewport)
|
||||
}
|
||||
}
|
||||
|
||||
void CameraNode::setViewport(int x,int y,int width,int height)
|
||||
void Camera::setViewport(int x,int y,int width,int height)
|
||||
{
|
||||
if (!_viewport) setViewport(new osg::Viewport);
|
||||
if (_viewport.valid()) _viewport->setViewport(x,y,width,height);
|
||||
}
|
||||
|
||||
Matrixd CameraNode::getInverseViewMatrix() const
|
||||
Matrixd Camera::getInverseViewMatrix() const
|
||||
{
|
||||
Matrixd inverse;
|
||||
inverse.invert(_viewMatrix);
|
||||
return inverse;
|
||||
}
|
||||
void CameraNode::setProjectionMatrixAsOrtho(double left, double right,
|
||||
void Camera::setProjectionMatrixAsOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
@ -146,14 +146,14 @@ void CameraNode::setProjectionMatrixAsOrtho(double left, double right,
|
||||
zNear, zFar));
|
||||
}
|
||||
|
||||
void CameraNode::setProjectionMatrixAsOrtho2D(double left, double right,
|
||||
void Camera::setProjectionMatrixAsOrtho2D(double left, double right,
|
||||
double bottom, double top)
|
||||
{
|
||||
setProjectionMatrix(osg::Matrixd::ortho2D(left, right,
|
||||
bottom, top));
|
||||
}
|
||||
|
||||
void CameraNode::setProjectionMatrixAsFrustum(double left, double right,
|
||||
void Camera::setProjectionMatrixAsFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
@ -162,14 +162,14 @@ void CameraNode::setProjectionMatrixAsFrustum(double left, double right,
|
||||
zNear, zFar));
|
||||
}
|
||||
|
||||
void CameraNode::setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
|
||||
void Camera::setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
setProjectionMatrix(osg::Matrixd::perspective(fovy,aspectRatio,
|
||||
zNear, zFar));
|
||||
}
|
||||
|
||||
bool CameraNode::getProjectionMatrixAsOrtho(double& left, double& right,
|
||||
bool Camera::getProjectionMatrixAsOrtho(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar)
|
||||
{
|
||||
@ -178,7 +178,7 @@ bool CameraNode::getProjectionMatrixAsOrtho(double& left, double& right,
|
||||
zNear, zFar);
|
||||
}
|
||||
|
||||
bool CameraNode::getProjectionMatrixAsFrustum(double& left, double& right,
|
||||
bool Camera::getProjectionMatrixAsFrustum(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar)
|
||||
{
|
||||
@ -187,29 +187,29 @@ bool CameraNode::getProjectionMatrixAsFrustum(double& left, double& right,
|
||||
zNear, zFar);
|
||||
}
|
||||
|
||||
bool CameraNode::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
|
||||
bool Camera::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
|
||||
double& zNear, double& zFar)
|
||||
{
|
||||
return _projectionMatrix.getPerspective(fovy, aspectRatio, zNear, zFar);
|
||||
}
|
||||
|
||||
void CameraNode::setViewMatrixAsLookAt(const Vec3& eye,const Vec3& center,const Vec3& up)
|
||||
void Camera::setViewMatrixAsLookAt(const Vec3& eye,const Vec3& center,const Vec3& up)
|
||||
{
|
||||
setViewMatrix(osg::Matrixd::lookAt(eye,center,up));
|
||||
}
|
||||
|
||||
void CameraNode::getViewMatrixAsLookAt(Vec3& eye,Vec3& center,Vec3& up,float lookDistance)
|
||||
void Camera::getViewMatrixAsLookAt(Vec3& eye,Vec3& center,Vec3& up,float lookDistance)
|
||||
{
|
||||
_viewMatrix.getLookAt(eye,center,up,lookDistance);
|
||||
}
|
||||
|
||||
|
||||
void CameraNode::attach(BufferComponent buffer, GLenum internalFormat)
|
||||
void Camera::attach(BufferComponent buffer, GLenum internalFormat)
|
||||
{
|
||||
_bufferAttachmentMap[buffer]._internalFormat = internalFormat;
|
||||
}
|
||||
|
||||
void CameraNode::attach(BufferComponent buffer, osg::Texture* texture, unsigned int level, unsigned int face, bool mipMapGeneration)
|
||||
void Camera::attach(BufferComponent buffer, osg::Texture* texture, unsigned int level, unsigned int face, bool mipMapGeneration)
|
||||
{
|
||||
_bufferAttachmentMap[buffer]._texture = texture;
|
||||
_bufferAttachmentMap[buffer]._level = level;
|
||||
@ -217,26 +217,26 @@ void CameraNode::attach(BufferComponent buffer, osg::Texture* texture, unsigned
|
||||
_bufferAttachmentMap[buffer]._mipMapGeneration = mipMapGeneration;
|
||||
}
|
||||
|
||||
void CameraNode::attach(BufferComponent buffer, osg::Image* image)
|
||||
void Camera::attach(BufferComponent buffer, osg::Image* image)
|
||||
{
|
||||
_bufferAttachmentMap[buffer]._image = image;
|
||||
}
|
||||
|
||||
void CameraNode::detach(BufferComponent buffer)
|
||||
void Camera::detach(BufferComponent buffer)
|
||||
{
|
||||
_bufferAttachmentMap.erase(buffer);
|
||||
}
|
||||
|
||||
void CameraNode::releaseGLObjects(osg::State* state) const
|
||||
void Camera::releaseGLObjects(osg::State* state) const
|
||||
{
|
||||
if (state) const_cast<CameraNode*>(this)->_renderingCache[state->getContextID()] = 0;
|
||||
else const_cast<CameraNode*>(this)->_renderingCache.setAllElementsTo(0);
|
||||
if (state) const_cast<Camera*>(this)->_renderingCache[state->getContextID()] = 0;
|
||||
else const_cast<Camera*>(this)->_renderingCache.setAllElementsTo(0);
|
||||
|
||||
Transform::releaseGLObjects(state);
|
||||
}
|
||||
|
||||
|
||||
bool CameraNode::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
bool Camera::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
if (_referenceFrame==RELATIVE_RF)
|
||||
{
|
||||
@ -256,7 +256,7 @@ bool CameraNode::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CameraNode::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
bool Camera::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
const Matrixd& inverse = getInverseViewMatrix();
|
||||
|
@ -282,7 +282,7 @@ FrameBufferAttachment::FrameBufferAttachment(TextureRectangle* target)
|
||||
_ximpl->textureTarget = target;
|
||||
}
|
||||
|
||||
FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment& attachment)
|
||||
FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment& attachment)
|
||||
{
|
||||
osg::Texture* texture = attachment._texture.get();
|
||||
|
||||
@ -344,12 +344,12 @@ FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment& attachment)
|
||||
}
|
||||
else
|
||||
{
|
||||
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment&) passed an empty osg::Image, image must be allocated first."<<std::endl;
|
||||
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment&) passed an empty osg::Image, image must be allocated first."<<std::endl;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(CameraNode::Attachment&) passed an unrecognised Texture type."<<std::endl;
|
||||
osg::notify(osg::WARN)<<"Error: FrameBufferAttachment::FrameBufferAttachment(Camera::Attachment&) passed an unrecognised Texture type."<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ CXXFILES =\
|
||||
BoundingBox.cpp\
|
||||
BoundingSphere.cpp\
|
||||
BufferObject.cpp\
|
||||
CameraNode.cpp\
|
||||
Camera.cpp\
|
||||
CameraView.cpp\
|
||||
ClearNode.cpp\
|
||||
ClipNode.cpp\
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <osg/NodeVisitor>
|
||||
#include <osg/Notify>
|
||||
#include <osg/OccluderNode>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Transform>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
#include <osg/CameraView>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Notify>
|
||||
|
||||
using namespace osg;
|
||||
@ -28,7 +28,7 @@ class ApplyMatrixVisitor : public NodeVisitor
|
||||
ApplyMatrixVisitor(const osg::Matrix& matrix):
|
||||
_matrix(matrix) {}
|
||||
|
||||
virtual void apply(CameraNode& camera)
|
||||
virtual void apply(Camera& camera)
|
||||
{
|
||||
camera.setViewMatrix(_matrix);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
#include <osg/Transform>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
|
||||
#include <osg/Notify>
|
||||
|
||||
@ -30,13 +30,13 @@ class TransformVisitor : public NodeVisitor
|
||||
|
||||
CoordMode _coordMode;
|
||||
Matrix& _matrix;
|
||||
bool _ignoreCameraNodes;
|
||||
bool _ignoreCameras;
|
||||
|
||||
TransformVisitor(Matrix& matrix,CoordMode coordMode, bool ignoreCameraNodes):
|
||||
TransformVisitor(Matrix& matrix,CoordMode coordMode, bool ignoreCameras):
|
||||
NodeVisitor(),
|
||||
_coordMode(coordMode),
|
||||
_matrix(matrix),
|
||||
_ignoreCameraNodes(ignoreCameraNodes)
|
||||
_ignoreCameras(ignoreCameras)
|
||||
{}
|
||||
|
||||
virtual void apply(Transform& transform)
|
||||
@ -56,9 +56,9 @@ class TransformVisitor : public NodeVisitor
|
||||
if (nodePath.empty()) return;
|
||||
|
||||
unsigned int i = 0;
|
||||
if (_ignoreCameraNodes)
|
||||
if (_ignoreCameras)
|
||||
{
|
||||
// we need to found out the last absolute CameraNode in NodePath and
|
||||
// we need to found out the last absolute Camera in NodePath and
|
||||
// set the i index to after it so the final accumulation set ignores it.
|
||||
i = nodePath.size();
|
||||
NodePath::const_reverse_iterator ritr;
|
||||
@ -66,7 +66,7 @@ class TransformVisitor : public NodeVisitor
|
||||
ritr != nodePath.rend();
|
||||
++ritr, --i)
|
||||
{
|
||||
const osg::CameraNode* camera = dynamic_cast<const osg::CameraNode*>(*ritr);
|
||||
const osg::Camera* camera = dynamic_cast<const osg::Camera*>(*ritr);
|
||||
if (camera &&
|
||||
(camera->getReferenceFrame()==osg::Transform::ABSOLUTE_RF || camera->getParents().empty()))
|
||||
{
|
||||
@ -86,35 +86,35 @@ class TransformVisitor : public NodeVisitor
|
||||
|
||||
};
|
||||
|
||||
Matrix osg::computeLocalToWorld(const NodePath& nodePath, bool ignoreCameraNodes)
|
||||
Matrix osg::computeLocalToWorld(const NodePath& nodePath, bool ignoreCameras)
|
||||
{
|
||||
Matrix matrix;
|
||||
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameraNodes);
|
||||
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameras);
|
||||
tv.accumulate(nodePath);
|
||||
return matrix;
|
||||
}
|
||||
|
||||
Matrix osg::computeWorldToLocal(const NodePath& nodePath, bool ignoreCameraNodes)
|
||||
Matrix osg::computeWorldToLocal(const NodePath& nodePath, bool ignoreCameras)
|
||||
{
|
||||
osg::Matrix matrix;
|
||||
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameraNodes);
|
||||
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameras);
|
||||
tv.accumulate(nodePath);
|
||||
return matrix;
|
||||
}
|
||||
|
||||
Matrix osg::computeLocalToEye(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameraNodes)
|
||||
Matrix osg::computeLocalToEye(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameras)
|
||||
{
|
||||
Matrix matrix(modelview);
|
||||
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameraNodes);
|
||||
TransformVisitor tv(matrix,TransformVisitor::LOCAL_TO_WORLD,ignoreCameras);
|
||||
tv.accumulate(nodePath);
|
||||
return matrix;
|
||||
}
|
||||
|
||||
Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameraNodes)
|
||||
Matrix osg::computeEyeToLocal(const Matrix& modelview,const NodePath& nodePath, bool ignoreCameras)
|
||||
{
|
||||
Matrix matrix;
|
||||
matrix.invert(modelview);
|
||||
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameraNodes);
|
||||
TransformVisitor tv(matrix,TransformVisitor::WORLD_TO_LOCAL,ignoreCameras);
|
||||
tv.accumulate(nodePath);
|
||||
return matrix;
|
||||
}
|
||||
|
190
src/osg/View.cpp
190
src/osg/View.cpp
@ -6,7 +6,7 @@
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* but WITHOUT ANY WARRA;NTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
@ -15,203 +15,69 @@
|
||||
|
||||
using namespace osg;
|
||||
|
||||
// use this cull callback to allow the camera to traverse the View's children without
|
||||
// actuall having them assigned as children to the camea itself. This make the camera a
|
||||
// decorator without ever directly being assigned to it.
|
||||
class ViewCameraTraverseNodeCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
|
||||
ViewCameraTraverseNodeCallback(osg::View* view):_view(view) {}
|
||||
|
||||
virtual void operator()(osg::Node*, osg::NodeVisitor* nv)
|
||||
{
|
||||
_view->Group::traverse(*nv);
|
||||
}
|
||||
|
||||
osg::View* _view;
|
||||
};
|
||||
|
||||
|
||||
View::View()
|
||||
{
|
||||
setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
}
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
View::View(const View& view,const CopyOp& copyop):
|
||||
Transform(view,copyop),
|
||||
CullSettings(view),
|
||||
_projectionMatrix(view._projectionMatrix),
|
||||
_viewMatrix(view._viewMatrix)
|
||||
{
|
||||
// need to clone the cameras.
|
||||
for(unsigned int i=0; i<view.getNumCameras(); ++i)
|
||||
{
|
||||
const CameraData& cd = view.getCameraData(i);
|
||||
addCamera(dynamic_cast<osg::CameraNode*>(cd._camera->clone(copyop)), cd._projectionOffset, cd._viewOffset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
View::~View()
|
||||
{
|
||||
// detatch the cameras from this View to prevent dangling pointers
|
||||
for(CameraList::iterator itr = _cameras.begin();
|
||||
itr != _cameras.end();
|
||||
for(Slaves::iterator itr = _slaves.begin();
|
||||
itr != _slaves.end();
|
||||
++itr)
|
||||
{
|
||||
CameraData& cd = *itr;
|
||||
Slave& cd = *itr;
|
||||
cd._camera->setView(0);
|
||||
cd._camera->setCullCallback(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Matrixd View::getInverseViewMatrix() const
|
||||
void View::updateSlaves()
|
||||
{
|
||||
Matrixd inverse;
|
||||
inverse.invert(_viewMatrix);
|
||||
return inverse;
|
||||
}
|
||||
|
||||
void View::setProjectionMatrixAsOrtho(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
setProjectionMatrix(osg::Matrixd::ortho(left, right,
|
||||
bottom, top,
|
||||
zNear, zFar));
|
||||
}
|
||||
|
||||
void View::setProjectionMatrixAsOrtho2D(double left, double right,
|
||||
double bottom, double top)
|
||||
{
|
||||
setProjectionMatrix(osg::Matrixd::ortho2D(left, right,
|
||||
bottom, top));
|
||||
}
|
||||
|
||||
void View::setProjectionMatrixAsFrustum(double left, double right,
|
||||
double bottom, double top,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
setProjectionMatrix(osg::Matrixd::frustum(left, right,
|
||||
bottom, top,
|
||||
zNear, zFar));
|
||||
}
|
||||
|
||||
void View::setProjectionMatrixAsPerspective(double fovy,double aspectRatio,
|
||||
double zNear, double zFar)
|
||||
{
|
||||
setProjectionMatrix(osg::Matrixd::perspective(fovy,aspectRatio,
|
||||
zNear, zFar));
|
||||
}
|
||||
|
||||
bool View::getProjectionMatrixAsOrtho(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar)
|
||||
{
|
||||
return _projectionMatrix.getOrtho(left, right,
|
||||
bottom, top,
|
||||
zNear, zFar);
|
||||
}
|
||||
|
||||
bool View::getProjectionMatrixAsFrustum(double& left, double& right,
|
||||
double& bottom, double& top,
|
||||
double& zNear, double& zFar)
|
||||
{
|
||||
return _projectionMatrix.getFrustum(left, right,
|
||||
bottom, top,
|
||||
zNear, zFar);
|
||||
}
|
||||
|
||||
bool View::getProjectionMatrixAsPerspective(double& fovy,double& aspectRatio,
|
||||
double& zNear, double& zFar)
|
||||
{
|
||||
return _projectionMatrix.getPerspective(fovy, aspectRatio, zNear, zFar);
|
||||
}
|
||||
|
||||
void View::setViewMatrixAsLookAt(const Vec3& eye,const Vec3& center,const Vec3& up)
|
||||
{
|
||||
setViewMatrix(osg::Matrixd::lookAt(eye,center,up));
|
||||
}
|
||||
|
||||
void View::getViewMatrixAsLookAt(Vec3& eye,Vec3& center,Vec3& up,float lookDistance)
|
||||
{
|
||||
_viewMatrix.getLookAt(eye,center,up,lookDistance);
|
||||
}
|
||||
|
||||
|
||||
bool View::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
if (_referenceFrame==RELATIVE_RF)
|
||||
{
|
||||
matrix.preMult(_viewMatrix);
|
||||
}
|
||||
else // absolute
|
||||
{
|
||||
matrix = _viewMatrix;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool View::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const
|
||||
{
|
||||
const Matrixd& inverse = getInverseViewMatrix();
|
||||
|
||||
if (_referenceFrame==RELATIVE_RF)
|
||||
{
|
||||
// note doing inverse so pre becomes post.
|
||||
matrix.postMult(inverse);
|
||||
}
|
||||
else // absolute
|
||||
{
|
||||
matrix = inverse;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void View::updateCameras()
|
||||
{
|
||||
for(CameraList::iterator itr = _cameras.begin();
|
||||
itr != _cameras.end();
|
||||
if (!_camera) return;
|
||||
|
||||
for(Slaves::iterator itr = _slaves.begin();
|
||||
itr != _slaves.end();
|
||||
++itr)
|
||||
{
|
||||
CameraData& cd = *itr;
|
||||
cd._camera->setProjectionMatrix(cd._projectionOffset * _projectionMatrix);
|
||||
cd._camera->setViewMatrix(cd._viewOffset * _viewMatrix);
|
||||
cd._camera->inheritCullSettings(*this);
|
||||
Slave& cd = *itr;
|
||||
cd._camera->setProjectionMatrix(cd._projectionOffset * _camera->getProjectionMatrix());
|
||||
cd._camera->setViewMatrix(cd._viewOffset * _camera->getViewMatrix());
|
||||
cd._camera->inheritCullSettings(*_camera);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool View::addCamera(osg::CameraNode* camera, const osg::Matrix& projectionOffset, const osg::Matrix& viewOffset)
|
||||
bool View::addSlave(osg::Camera* camera, const osg::Matrix& projectionOffset, const osg::Matrix& viewOffset)
|
||||
{
|
||||
if (!camera) return false;
|
||||
|
||||
ViewCameraTraverseNodeCallback* cb = new ViewCameraTraverseNodeCallback(this);
|
||||
camera->setCullCallback(cb);
|
||||
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
camera->setProjectionMatrix(projectionOffset * _projectionMatrix);
|
||||
camera->setViewMatrix(viewOffset * _viewMatrix);
|
||||
camera->inheritCullSettings(*this);
|
||||
|
||||
_cameras.push_back(CameraData(camera, projectionOffset, viewOffset));
|
||||
|
||||
if (_camera.valid())
|
||||
{
|
||||
camera->setProjectionMatrix(projectionOffset * _camera->getProjectionMatrix());
|
||||
camera->setViewMatrix(viewOffset * _camera->getViewMatrix());
|
||||
camera->inheritCullSettings(*_camera);
|
||||
}
|
||||
|
||||
_slaves.push_back(Slave(camera, projectionOffset, viewOffset));
|
||||
|
||||
// osg::notify(osg::NOTICE)<<"Added camera"<<std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool View::removeCamera(unsigned int pos)
|
||||
bool View::removeSlave(unsigned int pos)
|
||||
{
|
||||
if (pos >= _cameras.size()) return false;
|
||||
if (pos >= _slaves.size()) return false;
|
||||
|
||||
_cameras[pos]._camera->setView(0);
|
||||
_cameras[pos]._camera->setCullCallback(0);
|
||||
_slaves[pos]._camera->setView(0);
|
||||
_slaves[pos]._camera->setCullCallback(0);
|
||||
|
||||
_cameras.erase(_cameras.begin()+pos);
|
||||
_slaves.erase(_slaves.begin()+pos);
|
||||
|
||||
osg::notify(osg::NOTICE)<<"Removed camera"<<std::endl;
|
||||
|
||||
|
@ -287,11 +287,9 @@ ConvertFromInventor::postShape(void* data, SoCallbackAction* action,
|
||||
textureMat.set((float *) action->getTextureMatrix().getValue());
|
||||
|
||||
// Transform texture coordinates if texture matrix is not an identity mat
|
||||
osg::Matrix identityMat;
|
||||
identityMat.makeIdentity();
|
||||
osg::Vec2Array* texCoords
|
||||
= new osg::Vec2Array(thisPtr->textureCoords.size());
|
||||
if (textureMat == identityMat)
|
||||
if (textureMat.isIdentity())
|
||||
{
|
||||
// Set the texture coordinates
|
||||
for (unsigned int i = 0; i < thisPtr->textureCoords.size(); i++)
|
||||
|
@ -148,7 +148,7 @@ void daeWriter::apply( osg::LightSource &node )
|
||||
}
|
||||
|
||||
//CAMERA
|
||||
void daeWriter::apply( osg::CameraNode &node )
|
||||
void daeWriter::apply( osg::Camera &node )
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
debugPrint( node );
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Group>
|
||||
#include <osg/LightSource>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Material>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
@ -88,7 +88,7 @@ public:
|
||||
virtual void apply( osg::Geode &node );
|
||||
virtual void apply( osg::Group &node );
|
||||
virtual void apply( osg::LightSource &node );
|
||||
virtual void apply( osg::CameraNode &node );
|
||||
virtual void apply( osg::Camera &node );
|
||||
virtual void apply( osg::MatrixTransform &node );
|
||||
virtual void apply( osg::PositionAttitudeTransform &node );
|
||||
virtual void apply( osg::Switch &node );
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**********************************************************************
|
||||
*
|
||||
* FILE: CameraNode.cpp
|
||||
* FILE: Camera.cpp
|
||||
*
|
||||
* DESCRIPTION: Read/Write osg::CameraNode in binary format to disk.
|
||||
* DESCRIPTION: Read/Write osg::Camera in binary format to disk.
|
||||
*
|
||||
* CREATED BY: Auto generated by iveGenerated
|
||||
* and later modified by Rune Schmidt Jensen.
|
||||
@ -13,15 +13,15 @@
|
||||
**********************************************************************/
|
||||
|
||||
#include "Exception.h"
|
||||
#include "CameraNode.h"
|
||||
#include "Camera.h"
|
||||
#include "Transform.h"
|
||||
#include "Image.h"
|
||||
|
||||
using namespace ive;
|
||||
|
||||
void CameraNode::write(DataOutputStream* out){
|
||||
// Write CameraNode's identification.
|
||||
out->writeInt(IVECAMERANODE);
|
||||
void Camera::write(DataOutputStream* out){
|
||||
// Write Camera's identification.
|
||||
out->writeInt(IVECAMERA);
|
||||
|
||||
// If the osg class is inherited by any other class we should also write this to file.
|
||||
osg::Transform* transform = dynamic_cast<osg::Transform*>(this);
|
||||
@ -29,7 +29,7 @@ void CameraNode::write(DataOutputStream* out){
|
||||
((ive::Transform*)(transform))->write(out);
|
||||
}
|
||||
else
|
||||
throw Exception("CameraNode::write(): Could not cast this osg::CameraNode to an osg::Group.");
|
||||
throw Exception("Camera::write(): Could not cast this osg::Camera to an osg::Group.");
|
||||
|
||||
|
||||
out->writeVec4(getClearColor());
|
||||
@ -49,7 +49,7 @@ void CameraNode::write(DataOutputStream* out){
|
||||
|
||||
out->writeInt(getTransformOrder());
|
||||
|
||||
// Write CameraNode's properties.
|
||||
// Write Camera's properties.
|
||||
out->writeMatrixd(getProjectionMatrix());
|
||||
out->writeMatrixd(getViewMatrix());
|
||||
|
||||
@ -88,13 +88,13 @@ void CameraNode::write(DataOutputStream* out){
|
||||
|
||||
}
|
||||
|
||||
void CameraNode::read(DataInputStream* in)
|
||||
void Camera::read(DataInputStream* in)
|
||||
{
|
||||
// Read CameraNode's identification.
|
||||
// Read Camera's identification.
|
||||
int id = in->peekInt();
|
||||
if(id == IVECAMERANODE)
|
||||
if(id == IVECAMERA)
|
||||
{
|
||||
// Code to read CameraNode's properties.
|
||||
// Code to read Camera's properties.
|
||||
id = in->readInt();
|
||||
// If the osg class is inherited by any other class we should also read this from file.
|
||||
osg::Transform* transform = dynamic_cast<osg::Transform*>(this);
|
||||
@ -103,7 +103,7 @@ void CameraNode::read(DataInputStream* in)
|
||||
((ive::Transform*)(transform))->read(in);
|
||||
}
|
||||
else
|
||||
throw Exception("CameraNode::read(): Could not cast this osg::CameraNode to an osg::Group.");
|
||||
throw Exception("Camera::read(): Could not cast this osg::Camera to an osg::Group.");
|
||||
|
||||
setClearColor(in->readVec4());
|
||||
setClearMask(in->readUInt());
|
||||
@ -166,6 +166,6 @@ void CameraNode::read(DataInputStream* in)
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("CameraNode::read(): Expected CameraNode identification");
|
||||
throw Exception("Camera::read(): Expected Camera identification");
|
||||
}
|
||||
}
|
@ -50,7 +50,7 @@
|
||||
|
||||
#include "Group.h"
|
||||
#include "MatrixTransform.h"
|
||||
#include "CameraNode.h"
|
||||
#include "Camera.h"
|
||||
#include "CameraView.h"
|
||||
#include "Geode.h"
|
||||
#include "LightSource.h"
|
||||
@ -1207,9 +1207,9 @@ osg::Node* DataInputStream::readNode()
|
||||
node = new osg::MatrixTransform();
|
||||
((ive::MatrixTransform*)(node))->read(this);
|
||||
}
|
||||
else if(nodeTypeID== IVECAMERANODE){
|
||||
node = new osg::CameraNode();
|
||||
((ive::CameraNode*)(node))->read(this);
|
||||
else if(nodeTypeID== IVECAMERA){
|
||||
node = new osg::Camera();
|
||||
((ive::Camera*)(node))->read(this);
|
||||
}
|
||||
else if(nodeTypeID== IVECAMERAVIEW){
|
||||
node = new osg::CameraView();
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
#include "Group.h"
|
||||
#include "MatrixTransform.h"
|
||||
#include "CameraNode.h"
|
||||
#include "Camera.h"
|
||||
#include "CameraView.h"
|
||||
#include "Geode.h"
|
||||
#include "LightSource.h"
|
||||
@ -927,8 +927,8 @@ void DataOutputStream::writeNode(const osg::Node* node)
|
||||
if(dynamic_cast<const osg::MatrixTransform*>(node)){
|
||||
((ive::MatrixTransform*)(node))->write(this);
|
||||
}
|
||||
else if(dynamic_cast<const osg::CameraNode*>(node)){
|
||||
((ive::CameraNode*)(node))->write(this);
|
||||
else if(dynamic_cast<const osg::Camera*>(node)){
|
||||
((ive::Camera*)(node))->write(this);
|
||||
}
|
||||
else if(dynamic_cast<const osg::CameraView*>(node)){
|
||||
((ive::CameraView*)(node))->write(this);
|
||||
|
@ -14,7 +14,7 @@ CXXFILES =\
|
||||
ClipNode.cpp\
|
||||
ClipPlane.cpp\
|
||||
ClusterCullingCallback.cpp\
|
||||
CameraNode.cpp\
|
||||
Camera.cpp\
|
||||
CameraView.cpp\
|
||||
ConeSector.cpp\
|
||||
ConvexPlanarOccluder.cpp\
|
||||
|
@ -34,7 +34,7 @@ namespace ive {
|
||||
#define IVETEXGENNODE 0x00000025
|
||||
#define IVECLIPNODE 0x00000026
|
||||
#define IVEPROXYNODE 0x00000027
|
||||
#define IVECAMERANODE 0x00000028
|
||||
#define IVECAMERA 0x00000028
|
||||
#define IVECAMERAVIEW 0x00000029
|
||||
#define IVEAUTOTRANSFORM 0x00000030
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/io_utils>
|
||||
#include <osg/Notify>
|
||||
|
||||
@ -12,29 +12,40 @@ using namespace osg;
|
||||
using namespace osgDB;
|
||||
|
||||
// forward declare functions to use later.
|
||||
bool CameraNode_readLocalData(Object& obj, Input& fr);
|
||||
bool CameraNode_writeLocalData(const Object& obj, Output& fw);
|
||||
bool Camera_readLocalData(Object& obj, Input& fr);
|
||||
bool Camera_writeLocalData(const Object& obj, Output& fw);
|
||||
|
||||
bool CameraNode_matchBufferComponentStr(const char* str,CameraNode::BufferComponent& buffer);
|
||||
const char* CameraNode_getBufferComponentStr(CameraNode::BufferComponent buffer);
|
||||
bool Camera_matchBufferComponentStr(const char* str,Camera::BufferComponent& buffer);
|
||||
const char* Camera_getBufferComponentStr(Camera::BufferComponent buffer);
|
||||
|
||||
|
||||
// register the read and write functions with the osgDB::Registry.
|
||||
RegisterDotOsgWrapperProxy g_CameraProxy
|
||||
(
|
||||
new osg::Camera,
|
||||
"Camera",
|
||||
"Object Node Transform Camera Group",
|
||||
&Camera_readLocalData,
|
||||
&Camera_writeLocalData,
|
||||
DotOsgWrapper::READ_AND_WRITE
|
||||
);
|
||||
|
||||
// register the read and write functions with the osgDB::Registry.
|
||||
RegisterDotOsgWrapperProxy g_CameraNodeProxy
|
||||
(
|
||||
new osg::CameraNode,
|
||||
new osg::Camera,
|
||||
"CameraNode",
|
||||
"Object Node Transform CameraNode Group",
|
||||
&CameraNode_readLocalData,
|
||||
&CameraNode_writeLocalData,
|
||||
&Camera_readLocalData,
|
||||
&Camera_writeLocalData,
|
||||
DotOsgWrapper::READ_AND_WRITE
|
||||
);
|
||||
|
||||
bool CameraNode_readLocalData(Object& obj, Input& fr)
|
||||
bool Camera_readLocalData(Object& obj, Input& fr)
|
||||
{
|
||||
bool iteratorAdvanced = false;
|
||||
|
||||
CameraNode& camera = static_cast<CameraNode&>(obj);
|
||||
Camera& camera = static_cast<Camera&>(obj);
|
||||
|
||||
if (fr.matchSequence("clearColor %f %f %f %f"))
|
||||
{
|
||||
@ -71,11 +82,11 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
if (fr.matchSequence("transformOrder %w"))
|
||||
{
|
||||
if (fr[1].matchWord("PRE_MULTIPLY")) camera.setTransformOrder(osg::CameraNode::PRE_MULTIPLY);
|
||||
else if (fr[1].matchWord("POST_MULTIPLY")) camera.setTransformOrder(osg::CameraNode::POST_MULTIPLY);
|
||||
if (fr[1].matchWord("PRE_MULTIPLY")) camera.setTransformOrder(osg::Camera::PRE_MULTIPLY);
|
||||
else if (fr[1].matchWord("POST_MULTIPLY")) camera.setTransformOrder(osg::Camera::POST_MULTIPLY);
|
||||
// the following are for backwards compatibility.
|
||||
else if (fr[1].matchWord("PRE_MULTIPLE")) camera.setTransformOrder(osg::CameraNode::PRE_MULTIPLY);
|
||||
else if (fr[1].matchWord("POST_MULTIPLE")) camera.setTransformOrder(osg::CameraNode::POST_MULTIPLY);
|
||||
else if (fr[1].matchWord("PRE_MULTIPLE")) camera.setTransformOrder(osg::Camera::PRE_MULTIPLY);
|
||||
else if (fr[1].matchWord("POST_MULTIPLE")) camera.setTransformOrder(osg::Camera::POST_MULTIPLY);
|
||||
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
@ -96,9 +107,9 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
if (fr.matchSequence("renderOrder %w"))
|
||||
{
|
||||
if (fr[1].matchWord("PRE_RENDER")) camera.setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
else if (fr[1].matchWord("NESTED_RENDER")) camera.setRenderOrder(osg::CameraNode::NESTED_RENDER);
|
||||
else if (fr[1].matchWord("POST_RENDER")) camera.setRenderOrder(osg::CameraNode::POST_RENDER);
|
||||
if (fr[1].matchWord("PRE_RENDER")) camera.setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
else if (fr[1].matchWord("NESTED_RENDER")) camera.setRenderOrder(osg::Camera::NESTED_RENDER);
|
||||
else if (fr[1].matchWord("POST_RENDER")) camera.setRenderOrder(osg::Camera::POST_RENDER);
|
||||
|
||||
fr += 2;
|
||||
iteratorAdvanced = true;
|
||||
@ -106,13 +117,13 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
if (fr.matchSequence("renderTargetImplementation %w"))
|
||||
{
|
||||
osg::CameraNode::RenderTargetImplementation implementation = osg::CameraNode::FRAME_BUFFER;
|
||||
osg::Camera::RenderTargetImplementation implementation = osg::Camera::FRAME_BUFFER;
|
||||
|
||||
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) implementation = osg::CameraNode::FRAME_BUFFER_OBJECT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) implementation = osg::CameraNode::PIXEL_BUFFER_RTT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER")) implementation = osg::CameraNode::PIXEL_BUFFER;
|
||||
else if (fr[1].matchWord("FRAME_BUFFER")) implementation = osg::CameraNode::FRAME_BUFFER;
|
||||
else if (fr[1].matchWord("SEPERATE_WINDOW")) implementation = osg::CameraNode::SEPERATE_WINDOW;
|
||||
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) implementation = osg::Camera::FRAME_BUFFER_OBJECT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) implementation = osg::Camera::PIXEL_BUFFER_RTT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER")) implementation = osg::Camera::PIXEL_BUFFER;
|
||||
else if (fr[1].matchWord("FRAME_BUFFER")) implementation = osg::Camera::FRAME_BUFFER;
|
||||
else if (fr[1].matchWord("SEPERATE_WINDOW")) implementation = osg::Camera::SEPERATE_WINDOW;
|
||||
|
||||
camera.setRenderTargetImplementation(implementation);
|
||||
|
||||
@ -122,13 +133,13 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
if (fr.matchSequence("renderTargetImplementation %w"))
|
||||
{
|
||||
osg::CameraNode::RenderTargetImplementation fallback = camera.getRenderTargetFallback();
|
||||
osg::Camera::RenderTargetImplementation fallback = camera.getRenderTargetFallback();
|
||||
|
||||
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) fallback = osg::CameraNode::FRAME_BUFFER_OBJECT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) fallback = osg::CameraNode::PIXEL_BUFFER_RTT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER")) fallback = osg::CameraNode::PIXEL_BUFFER;
|
||||
else if (fr[1].matchWord("FRAME_BUFFER")) fallback = osg::CameraNode::FRAME_BUFFER;
|
||||
else if (fr[1].matchWord("SEPERATE_WINDOW")) fallback = osg::CameraNode::SEPERATE_WINDOW;
|
||||
if (fr[1].matchWord("FRAME_BUFFER_OBJECT")) fallback = osg::Camera::FRAME_BUFFER_OBJECT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER_RTT")) fallback = osg::Camera::PIXEL_BUFFER_RTT;
|
||||
else if (fr[1].matchWord("PIXEL_BUFFER")) fallback = osg::Camera::PIXEL_BUFFER;
|
||||
else if (fr[1].matchWord("FRAME_BUFFER")) fallback = osg::Camera::FRAME_BUFFER;
|
||||
else if (fr[1].matchWord("SEPERATE_WINDOW")) fallback = osg::Camera::SEPERATE_WINDOW;
|
||||
|
||||
camera.setRenderTargetImplementation(camera.getRenderTargetImplementation(), fallback);
|
||||
|
||||
@ -141,12 +152,12 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
|
||||
{
|
||||
int entry = fr[1].getNoNestedBrackets();
|
||||
|
||||
CameraNode::BufferComponent buffer;
|
||||
CameraNode_matchBufferComponentStr(fr[1].getStr(),buffer);
|
||||
Camera::BufferComponent buffer;
|
||||
Camera_matchBufferComponentStr(fr[1].getStr(),buffer);
|
||||
|
||||
fr += 3;
|
||||
|
||||
CameraNode::Attachment& attachment = camera.getBufferAttachmentMap()[buffer];
|
||||
Camera::Attachment& attachment = camera.getBufferAttachmentMap()[buffer];
|
||||
|
||||
// read attachment data.
|
||||
while (!fr.eof() && fr[0].getNoNestedBrackets()>entry)
|
||||
@ -218,9 +229,9 @@ bool CameraNode_readLocalData(Object& obj, Input& fr)
|
||||
}
|
||||
|
||||
|
||||
bool CameraNode_writeLocalData(const Object& obj, Output& fw)
|
||||
bool Camera_writeLocalData(const Object& obj, Output& fw)
|
||||
{
|
||||
const CameraNode& camera = static_cast<const CameraNode&>(obj);
|
||||
const Camera& camera = static_cast<const Camera&>(obj);
|
||||
|
||||
fw.indent()<<"clearColor "<<camera.getClearColor()<<std::endl;
|
||||
fw.indent()<<"clearMask 0x"<<std::hex<<camera.getClearMask()<<std::endl;
|
||||
@ -238,8 +249,8 @@ bool CameraNode_writeLocalData(const Object& obj, Output& fw)
|
||||
fw.indent()<<"transformOrder ";
|
||||
switch(camera.getTransformOrder())
|
||||
{
|
||||
case(osg::CameraNode::PRE_MULTIPLY): fw <<"PRE_MULTIPLY"<<std::endl; break;
|
||||
case(osg::CameraNode::POST_MULTIPLY): fw <<"POST_MULTIPLY"<<std::endl; break;
|
||||
case(osg::Camera::PRE_MULTIPLY): fw <<"PRE_MULTIPLY"<<std::endl; break;
|
||||
case(osg::Camera::POST_MULTIPLY): fw <<"POST_MULTIPLY"<<std::endl; break;
|
||||
}
|
||||
|
||||
writeMatrix(camera.getProjectionMatrix(),fw,"ProjectionMatrix");
|
||||
@ -248,43 +259,43 @@ bool CameraNode_writeLocalData(const Object& obj, Output& fw)
|
||||
fw.indent()<<"renderOrder ";
|
||||
switch(camera.getRenderOrder())
|
||||
{
|
||||
case(osg::CameraNode::PRE_RENDER): fw <<"PRE_RENDER"<<std::endl; break;
|
||||
case(osg::CameraNode::NESTED_RENDER): fw <<"NESTED_RENDER"<<std::endl; break;
|
||||
case(osg::CameraNode::POST_RENDER): fw <<"POST_RENDER"<<std::endl; break;
|
||||
case(osg::Camera::PRE_RENDER): fw <<"PRE_RENDER"<<std::endl; break;
|
||||
case(osg::Camera::NESTED_RENDER): fw <<"NESTED_RENDER"<<std::endl; break;
|
||||
case(osg::Camera::POST_RENDER): fw <<"POST_RENDER"<<std::endl; break;
|
||||
}
|
||||
|
||||
fw.indent()<<"renderTargetImplementation ";
|
||||
switch(camera.getRenderTargetImplementation())
|
||||
{
|
||||
case(osg::CameraNode::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
|
||||
case(osg::CameraNode::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
|
||||
case(osg::CameraNode::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
|
||||
case(osg::CameraNode::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
|
||||
case(osg::CameraNode::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
|
||||
case(osg::Camera::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
|
||||
case(osg::Camera::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
|
||||
case(osg::Camera::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
|
||||
case(osg::Camera::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
|
||||
case(osg::Camera::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
|
||||
}
|
||||
|
||||
fw.indent()<<"renderTargetFallback ";
|
||||
switch(camera.getRenderTargetFallback())
|
||||
{
|
||||
case(osg::CameraNode::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
|
||||
case(osg::CameraNode::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
|
||||
case(osg::CameraNode::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
|
||||
case(osg::CameraNode::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
|
||||
case(osg::CameraNode::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
|
||||
case(osg::Camera::FRAME_BUFFER_OBJECT): fw <<"FRAME_BUFFER_OBJECT"<<std::endl; break;
|
||||
case(osg::Camera::PIXEL_BUFFER_RTT): fw <<"PIXEL_BUFFER_RTT"<<std::endl; break;
|
||||
case(osg::Camera::PIXEL_BUFFER): fw <<"PIXEL_BUFFER"<<std::endl; break;
|
||||
case(osg::Camera::FRAME_BUFFER): fw <<"FRAME_BUFFER"<<std::endl; break;
|
||||
case(osg::Camera::SEPERATE_WINDOW): fw <<"SEPERATE_WINDOW"<<std::endl; break;
|
||||
}
|
||||
|
||||
fw.indent()<<"drawBuffer "<<std::hex<<camera.getDrawBuffer()<<std::endl;
|
||||
fw.indent()<<"readBuffer "<<std::hex<<camera.getReadBuffer()<<std::endl;
|
||||
|
||||
const osg::CameraNode::BufferAttachmentMap& bam = camera.getBufferAttachmentMap();
|
||||
const osg::Camera::BufferAttachmentMap& bam = camera.getBufferAttachmentMap();
|
||||
if (!bam.empty())
|
||||
{
|
||||
for(osg::CameraNode::BufferAttachmentMap::const_iterator itr=bam.begin();
|
||||
for(osg::Camera::BufferAttachmentMap::const_iterator itr=bam.begin();
|
||||
itr!=bam.end();
|
||||
++itr)
|
||||
{
|
||||
const osg::CameraNode::Attachment& attachment = itr->second;
|
||||
fw.indent()<<"bufferComponent "<<CameraNode_getBufferComponentStr(itr->first)<<" {"<<std::endl;
|
||||
const osg::Camera::Attachment& attachment = itr->second;
|
||||
fw.indent()<<"bufferComponent "<<Camera_getBufferComponentStr(itr->first)<<" {"<<std::endl;
|
||||
fw.moveIn();
|
||||
|
||||
fw.indent()<<"internalFormat "<<attachment._internalFormat<<std::endl;
|
||||
@ -304,73 +315,37 @@ bool CameraNode_writeLocalData(const Object& obj, Output& fw)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CameraNode_matchBufferComponentStr(const char* str,CameraNode::BufferComponent& buffer)
|
||||
bool Camera_matchBufferComponentStr(const char* str,Camera::BufferComponent& buffer)
|
||||
{
|
||||
if (strcmp(str,"DEPTH_BUFFER")==0) buffer = osg::CameraNode::DEPTH_BUFFER;
|
||||
else if (strcmp(str,"STENCIL_BUFFER")==0) buffer = osg::CameraNode::STENCIL_BUFFER;
|
||||
else if (strcmp(str,"COLOR_BUFFER")==0) buffer = osg::CameraNode::COLOR_BUFFER;
|
||||
else if (strcmp(str,"COLOR_BUFFER0")==0) buffer = osg::CameraNode::COLOR_BUFFER0;
|
||||
else if (strcmp(str,"COLOR_BUFFER1")==0) buffer = osg::CameraNode::COLOR_BUFFER1;
|
||||
else if (strcmp(str,"COLOR_BUFFER2")==0) buffer = osg::CameraNode::COLOR_BUFFER2;
|
||||
else if (strcmp(str,"COLOR_BUFFER3")==0) buffer = osg::CameraNode::COLOR_BUFFER3;
|
||||
else if (strcmp(str,"COLOR_BUFFER4")==0) buffer = osg::CameraNode::COLOR_BUFFER4;
|
||||
else if (strcmp(str,"COLOR_BUFFER5")==0) buffer = osg::CameraNode::COLOR_BUFFER5;
|
||||
else if (strcmp(str,"COLOR_BUFFER6")==0) buffer = osg::CameraNode::COLOR_BUFFER6;
|
||||
else if (strcmp(str,"COLOR_BUFFER7")==0) buffer = osg::CameraNode::COLOR_BUFFER7;
|
||||
if (strcmp(str,"DEPTH_BUFFER")==0) buffer = osg::Camera::DEPTH_BUFFER;
|
||||
else if (strcmp(str,"STENCIL_BUFFER")==0) buffer = osg::Camera::STENCIL_BUFFER;
|
||||
else if (strcmp(str,"COLOR_BUFFER")==0) buffer = osg::Camera::COLOR_BUFFER;
|
||||
else if (strcmp(str,"COLOR_BUFFER0")==0) buffer = osg::Camera::COLOR_BUFFER0;
|
||||
else if (strcmp(str,"COLOR_BUFFER1")==0) buffer = osg::Camera::COLOR_BUFFER1;
|
||||
else if (strcmp(str,"COLOR_BUFFER2")==0) buffer = osg::Camera::COLOR_BUFFER2;
|
||||
else if (strcmp(str,"COLOR_BUFFER3")==0) buffer = osg::Camera::COLOR_BUFFER3;
|
||||
else if (strcmp(str,"COLOR_BUFFER4")==0) buffer = osg::Camera::COLOR_BUFFER4;
|
||||
else if (strcmp(str,"COLOR_BUFFER5")==0) buffer = osg::Camera::COLOR_BUFFER5;
|
||||
else if (strcmp(str,"COLOR_BUFFER6")==0) buffer = osg::Camera::COLOR_BUFFER6;
|
||||
else if (strcmp(str,"COLOR_BUFFER7")==0) buffer = osg::Camera::COLOR_BUFFER7;
|
||||
else return false;
|
||||
return true;
|
||||
}
|
||||
const char* CameraNode_getBufferComponentStr(CameraNode::BufferComponent buffer)
|
||||
const char* Camera_getBufferComponentStr(Camera::BufferComponent buffer)
|
||||
{
|
||||
switch(buffer)
|
||||
{
|
||||
case (osg::CameraNode::DEPTH_BUFFER) : return "DEPTH_BUFFER";
|
||||
case (osg::CameraNode::STENCIL_BUFFER) : return "STENCIL_BUFFER";
|
||||
case (osg::CameraNode::COLOR_BUFFER) : return "COLOR_BUFFER";
|
||||
case (osg::CameraNode::COLOR_BUFFER1) : return "COLOR_BUFFER1";
|
||||
case (osg::CameraNode::COLOR_BUFFER2) : return "COLOR_BUFFER2";
|
||||
case (osg::CameraNode::COLOR_BUFFER3) : return "COLOR_BUFFER3";
|
||||
case (osg::CameraNode::COLOR_BUFFER4) : return "COLOR_BUFFER4";
|
||||
case (osg::CameraNode::COLOR_BUFFER5) : return "COLOR_BUFFER5";
|
||||
case (osg::CameraNode::COLOR_BUFFER6) : return "COLOR_BUFFER6";
|
||||
case (osg::CameraNode::COLOR_BUFFER7) : return "COLOR_BUFFER7";
|
||||
case (osg::Camera::DEPTH_BUFFER) : return "DEPTH_BUFFER";
|
||||
case (osg::Camera::STENCIL_BUFFER) : return "STENCIL_BUFFER";
|
||||
case (osg::Camera::COLOR_BUFFER) : return "COLOR_BUFFER";
|
||||
case (osg::Camera::COLOR_BUFFER1) : return "COLOR_BUFFER1";
|
||||
case (osg::Camera::COLOR_BUFFER2) : return "COLOR_BUFFER2";
|
||||
case (osg::Camera::COLOR_BUFFER3) : return "COLOR_BUFFER3";
|
||||
case (osg::Camera::COLOR_BUFFER4) : return "COLOR_BUFFER4";
|
||||
case (osg::Camera::COLOR_BUFFER5) : return "COLOR_BUFFER5";
|
||||
case (osg::Camera::COLOR_BUFFER6) : return "COLOR_BUFFER6";
|
||||
case (osg::Camera::COLOR_BUFFER7) : return "COLOR_BUFFER7";
|
||||
default : return "UnknownBufferComponent";
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
bool CameraNode_matchBufferComponentStr(const char* str,CameraNode::BufferComponent buffer)
|
||||
{
|
||||
if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else if (strcmp(str,"")==0) mode = osg::CameraNode::;
|
||||
else return false;
|
||||
return true;
|
||||
}
|
||||
const char* CameraNode_getBufferComponentStr(CameraNode::BufferComponent buffer)
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
case (osg::CameraNode::) : return "";
|
||||
default : return "UnknownBufferComponent";
|
||||
}
|
||||
}
|
||||
*/
|
@ -7,7 +7,7 @@ CXXFILES =\
|
||||
AutoTransform.cpp\
|
||||
Billboard.cpp\
|
||||
BlendFunc.cpp\
|
||||
CameraNode.cpp\
|
||||
Camera.cpp\
|
||||
CameraView.cpp\
|
||||
ClearNode.cpp\
|
||||
ClipNode.cpp\
|
||||
|
@ -29,7 +29,6 @@
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif
|
||||
|
||||
using namespace Producer;
|
||||
using namespace osgProducer;
|
||||
|
||||
static osg::ApplicationUsageProxy OsgCameraGroup_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE, "OSG_PROCESSOR_AFFINITY <mode>", "ON | OFF - Where supported, switch on or off the processor affinity." );
|
||||
@ -554,8 +553,8 @@ bool OsgCameraGroup::realize()
|
||||
sv->setDefaults(_realizeSceneViewOptions);
|
||||
|
||||
// note, should really compute the projection and view offsets...
|
||||
// but not critical as Producer controls the CameraNode matrices via SceneView.
|
||||
_view->addCamera(sv->getCamera());
|
||||
// but not critical as Producer controls the osg::Camera matrices via SceneView.
|
||||
_view->addSlave(sv->getCamera());
|
||||
sv->setView(_view.get());
|
||||
|
||||
if (_renderSurfaceStateMap.count(rs)==0)
|
||||
@ -693,7 +692,7 @@ bool OsgCameraGroup::realize()
|
||||
// disable multi-threading of cameras.
|
||||
if (_threadModel == Producer::CameraGroup::ThreadPerCamera)
|
||||
{
|
||||
std::set<RenderSurface*> renderSurfaceSet;
|
||||
std::set<Producer::RenderSurface*> renderSurfaceSet;
|
||||
for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ )
|
||||
{
|
||||
Producer::Camera *cam = _cfg->getCamera(i);
|
||||
@ -707,7 +706,7 @@ bool OsgCameraGroup::realize()
|
||||
osg::notify(osg::INFO)<<" threading problems when camera's share a RenderSurface."<<std::endl;
|
||||
_threadModel = Producer::CameraGroup::SingleThreaded;
|
||||
}
|
||||
else if (renderSurfaceSet.size()>1 && RenderSurface::allGLContextsAreShared())
|
||||
else if (renderSurfaceSet.size()>1 && Producer::RenderSurface::allGLContextsAreShared())
|
||||
{
|
||||
// we have multiple RenderSurface, but with share contexts, which is dangerous for multi-threaded usage,
|
||||
// so need to disable multi-threading to prevent problems.
|
||||
@ -811,16 +810,21 @@ void OsgCameraGroup::frame()
|
||||
double left, right, bottom, top, nearClip, farClip;
|
||||
getLensParams(left, right, bottom, top, nearClip, farClip);
|
||||
|
||||
if (getLensProjectionType()==Camera::Lens::Perspective)
|
||||
if (!_view->getCamera())
|
||||
{
|
||||
_view->setProjectionMatrixAsFrustum(left, right, bottom, top, nearClip, farClip);
|
||||
_view->setCamera(new osg::Camera);
|
||||
}
|
||||
|
||||
if (getLensProjectionType()==Producer::Camera::Lens::Perspective)
|
||||
{
|
||||
_view->getCamera()->setProjectionMatrixAsFrustum(left, right, bottom, top, nearClip, farClip);
|
||||
}
|
||||
else
|
||||
{
|
||||
_view->setProjectionMatrixAsOrtho(left, right, bottom, top, nearClip, farClip);
|
||||
_view->getCamera()->setProjectionMatrixAsOrtho(left, right, bottom, top, nearClip, farClip);
|
||||
}
|
||||
|
||||
_view->setViewMatrix(getViewMatrix());
|
||||
_view->getCamera()->setViewMatrix(getViewMatrix());
|
||||
}
|
||||
|
||||
// the settings in sync.
|
||||
|
@ -21,10 +21,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace Producer;
|
||||
using namespace osgProducer;
|
||||
using namespace osg;
|
||||
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define SINGLE_THREAD_KEYBOARDMOUSE
|
||||
@ -60,7 +57,7 @@ public:
|
||||
traverse(node);
|
||||
}
|
||||
|
||||
NodePath _pathToCoordinateSystemNode;
|
||||
osg::NodePath _pathToCoordinateSystemNode;
|
||||
};
|
||||
|
||||
|
||||
|
@ -387,11 +387,11 @@ ImpostorSprite* Impostor::createImpostorSprite(osgUtil::CullVisitor* cv)
|
||||
Vec3 center_world = bs.center()*matrix;
|
||||
|
||||
|
||||
osg::CameraNode* camera = impostorSprite->getCameraNode();
|
||||
osg::Camera* camera = impostorSprite->getCamera();
|
||||
if (!camera)
|
||||
{
|
||||
camera = new osg::CameraNode;
|
||||
impostorSprite->setCameraNode(camera);
|
||||
camera = new osg::Camera;
|
||||
impostorSprite->setCamera(camera);
|
||||
}
|
||||
|
||||
camera->setCullCallback(new ImpostorTraverseNodeCallback(this));
|
||||
@ -456,13 +456,13 @@ ImpostorSprite* Impostor::createImpostorSprite(osgUtil::CullVisitor* cv)
|
||||
camera->setViewport(0,0,new_s,new_t);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT, osg::CameraNode::FRAME_BUFFER);
|
||||
camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT, osg::Camera::FRAME_BUFFER);
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
// attach the texture and use it as the color buffer.
|
||||
camera->attach(osg::CameraNode::COLOR_BUFFER, texture);
|
||||
camera->attach(osg::Camera::COLOR_BUFFER, texture);
|
||||
|
||||
// do the cull traversal on the subgraph
|
||||
camera->accept(*cv);
|
||||
|
@ -68,7 +68,7 @@ void OverlayNode::init()
|
||||
if (!_camera)
|
||||
{
|
||||
// create the camera
|
||||
_camera = new osg::CameraNode;
|
||||
_camera = new osg::Camera;
|
||||
|
||||
_camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,0.0f));
|
||||
|
||||
@ -76,13 +76,13 @@ void OverlayNode::init()
|
||||
_camera->setViewport(0,0,tex_width,tex_height);
|
||||
|
||||
// set the camera to render before the main camera.
|
||||
_camera->setRenderOrder(osg::CameraNode::PRE_RENDER);
|
||||
_camera->setRenderOrder(osg::Camera::PRE_RENDER);
|
||||
|
||||
// tell the camera to use OpenGL frame buffer object where supported.
|
||||
_camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);
|
||||
_camera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||
|
||||
// attach the texture and use it as the color buffer.
|
||||
_camera->attach(osg::CameraNode::COLOR_BUFFER, _texture.get());
|
||||
_camera->attach(osg::Camera::COLOR_BUFFER, _texture.get());
|
||||
}
|
||||
|
||||
if (!_texgenNode) _texgenNode = new osg::TexGenNode;
|
||||
@ -122,7 +122,7 @@ void OverlayNode::traverse(osg::NodeVisitor& nv)
|
||||
csn = dynamic_cast<osg::CoordinateSystemNode*>(*itr);
|
||||
}
|
||||
|
||||
_camera->setReferenceFrame(osg::CameraNode::ABSOLUTE_RF);
|
||||
_camera->setReferenceFrame(osg::Camera::ABSOLUTE_RF);
|
||||
|
||||
if (csn)
|
||||
{
|
||||
|
@ -401,11 +401,11 @@ void FadeText::drawImplementation(osg::RenderInfo& renderInfo) const
|
||||
osg::Matrix lmv = atc._matrix;
|
||||
lmv.postMult(state.getModelViewMatrix());
|
||||
|
||||
if (renderInfo.getView())
|
||||
if (renderInfo.getView() && renderInfo.getView()->getCamera())
|
||||
{
|
||||
// move from camera into the view space.
|
||||
lmv.postMult(state.getInitialInverseViewMatrix());
|
||||
lmv.postMult(renderInfo.getView()->getViewMatrix());
|
||||
lmv.postMult(renderInfo.getView()->getCamera()->getViewMatrix());
|
||||
}
|
||||
|
||||
FadeTextData ftd(const_cast<osgText::FadeText*>(this));
|
||||
|
@ -1065,7 +1065,7 @@ void CullVisitor::apply(osg::ClearNode& node)
|
||||
|
||||
}
|
||||
|
||||
void CullVisitor::apply(osg::CameraNode& camera)
|
||||
void CullVisitor::apply(osg::Camera& camera)
|
||||
{
|
||||
// push the node's state.
|
||||
StateSet* node_state = camera.getStateSet();
|
||||
@ -1074,7 +1074,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
|
||||
// Save current cull settings
|
||||
CullSettings saved_cull_settings(*this);
|
||||
|
||||
// activate all active cull settings from this CameraNode
|
||||
// activate all active cull settings from this Camera
|
||||
inheritCullSettings(camera);
|
||||
|
||||
RefMatrix& originalModelView = getModelViewMatrix();
|
||||
@ -1084,7 +1084,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
|
||||
pushProjectionMatrix(createOrReuseMatrix(camera.getProjectionMatrix()));
|
||||
pushModelViewMatrix(createOrReuseMatrix(camera.getViewMatrix()));
|
||||
}
|
||||
else if (camera.getTransformOrder()==osg::CameraNode::POST_MULTIPLY)
|
||||
else if (camera.getTransformOrder()==osg::Camera::POST_MULTIPLY)
|
||||
{
|
||||
pushProjectionMatrix(createOrReuseMatrix(getProjectionMatrix()*camera.getProjectionMatrix()));
|
||||
pushModelViewMatrix(createOrReuseMatrix(getModelViewMatrix()*camera.getViewMatrix()));
|
||||
@ -1096,7 +1096,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
|
||||
}
|
||||
|
||||
|
||||
if (camera.getRenderOrder()==osg::CameraNode::NESTED_RENDER)
|
||||
if (camera.getRenderOrder()==osg::Camera::NESTED_RENDER)
|
||||
{
|
||||
handle_cull_callbacks_and_traverse(camera);
|
||||
}
|
||||
@ -1117,7 +1117,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*(camera.getDataChangeMutex()));
|
||||
|
||||
rtts = new osgUtil::RenderStage;
|
||||
rtts->setCameraNode(&camera);
|
||||
rtts->setCamera(&camera);
|
||||
|
||||
if (camera.getDrawBuffer() != GL_NONE)
|
||||
{
|
||||
@ -1203,7 +1203,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
|
||||
// dependancy list.
|
||||
switch(camera.getRenderOrder())
|
||||
{
|
||||
case osg::CameraNode::PRE_RENDER:
|
||||
case osg::Camera::PRE_RENDER:
|
||||
getCurrentRenderBin()->getStage()->addPreRenderStage(rtts.get(),camera.getRenderOrderNum());
|
||||
break;
|
||||
default:
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include <osg/TriangleFunctor>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Projection>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/io_utils>
|
||||
|
||||
#include <float.h>
|
||||
@ -800,11 +800,11 @@ void PickVisitor::apply(osg::Projection& projection)
|
||||
_mx, _my );
|
||||
}
|
||||
|
||||
void PickVisitor::apply(osg::CameraNode& camera)
|
||||
void PickVisitor::apply(osg::Camera& camera)
|
||||
{
|
||||
if (!camera.isRenderToTextureCamera())
|
||||
{
|
||||
if (camera.getReferenceFrame()==osg::CameraNode::ABSOLUTE_RF)
|
||||
if (camera.getReferenceFrame()==osg::Camera::ABSOLUTE_RF)
|
||||
{
|
||||
runNestedPickVisitor( camera,
|
||||
camera.getViewport() ? camera.getViewport() : _lastViewport.get(),
|
||||
@ -812,7 +812,7 @@ void PickVisitor::apply(osg::CameraNode& camera)
|
||||
camera.getViewMatrix(),
|
||||
_mx, _my );
|
||||
}
|
||||
else if (camera.getTransformOrder()==osg::CameraNode::POST_MULTIPLY)
|
||||
else if (camera.getTransformOrder()==osg::Camera::POST_MULTIPLY)
|
||||
{
|
||||
runNestedPickVisitor( camera,
|
||||
camera.getViewport() ? camera.getViewport() : _lastViewport.get(),
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <osg/PagedLOD>
|
||||
#include <osg/Transform>
|
||||
#include <osg/Projection>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Geode>
|
||||
#include <osg/Billboard>
|
||||
#include <osg/Geometry>
|
||||
@ -915,14 +915,14 @@ void IntersectionVisitor::apply(osg::Projection& projection)
|
||||
}
|
||||
|
||||
|
||||
void IntersectionVisitor::apply(osg::CameraNode& camera)
|
||||
void IntersectionVisitor::apply(osg::Camera& camera)
|
||||
{
|
||||
// osg::notify(osg::NOTICE)<<"apply(CameraNode&)"<<std::endl;
|
||||
// osg::notify(osg::NOTICE)<<"apply(Camera&)"<<std::endl;
|
||||
|
||||
// note, commenting out right now because default CameraNode setup is with the culling active. Should this be changed?
|
||||
// note, commenting out right now because default Camera setup is with the culling active. Should this be changed?
|
||||
// if (!enter(camera)) return;
|
||||
|
||||
// osg::notify(osg::NOTICE)<<"inside apply(CameraNode&)"<<std::endl;
|
||||
// osg::notify(osg::NOTICE)<<"inside apply(Camera&)"<<std::endl;
|
||||
|
||||
if (camera.getViewport()) pushWindowMatrix( camera.getViewport() );
|
||||
pushProjectionMatrix( new osg::RefMatrix(camera.getProjectionMatrix()) );
|
||||
|
@ -218,16 +218,16 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
|
||||
osg::State& state = *renderInfo.getState();
|
||||
|
||||
osg::CameraNode::RenderTargetImplementation renderTargetImplemntation = _camera->getRenderTargetImplementation();
|
||||
osg::CameraNode::RenderTargetImplementation renderTargetFallback = _camera->getRenderTargetFallback();
|
||||
osg::Camera::RenderTargetImplementation renderTargetImplemntation = _camera->getRenderTargetImplementation();
|
||||
osg::Camera::RenderTargetImplementation renderTargetFallback = _camera->getRenderTargetFallback();
|
||||
|
||||
osg::CameraNode::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
|
||||
osg::Camera::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
|
||||
|
||||
// compute the required dimensions
|
||||
int width = _viewport->x() + _viewport->width();
|
||||
int height = _viewport->y() + _viewport->height();
|
||||
int depth = 1;
|
||||
osg::CameraNode::BufferAttachmentMap::iterator itr;
|
||||
osg::Camera::BufferAttachmentMap::iterator itr;
|
||||
for(itr = bufferAttachements.begin();
|
||||
itr != bufferAttachements.end();
|
||||
++itr)
|
||||
@ -315,14 +315,14 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
}
|
||||
}
|
||||
|
||||
if (renderTargetImplemntation==osg::CameraNode::FRAME_BUFFER_OBJECT)
|
||||
if (renderTargetImplemntation==osg::Camera::FRAME_BUFFER_OBJECT)
|
||||
{
|
||||
osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(state.getContextID(),true);
|
||||
bool fbo_supported = fbo_ext && fbo_ext->isSupported();
|
||||
|
||||
if (fbo_supported && !_fbo)
|
||||
{
|
||||
osg::notify(osg::INFO)<<"Setting up osg::CameraNode::FRAME_BUFFER_OBJECT"<<std::endl;
|
||||
osg::notify(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER_OBJECT"<<std::endl;
|
||||
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(*(_camera->getDataChangeMutex()));
|
||||
|
||||
@ -331,23 +331,23 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
bool colorAttached = false;
|
||||
bool depthAttached = false;
|
||||
bool stencilAttached = false;
|
||||
for(osg::CameraNode::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
|
||||
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
|
||||
itr != bufferAttachements.end();
|
||||
++itr)
|
||||
{
|
||||
|
||||
osg::CameraNode::BufferComponent buffer = itr->first;
|
||||
osg::CameraNode::Attachment& attachment = itr->second;
|
||||
osg::Camera::BufferComponent buffer = itr->first;
|
||||
osg::Camera::Attachment& attachment = itr->second;
|
||||
|
||||
switch(buffer)
|
||||
{
|
||||
case(osg::CameraNode::DEPTH_BUFFER):
|
||||
case(osg::Camera::DEPTH_BUFFER):
|
||||
{
|
||||
fbo->setAttachment(GL_DEPTH_ATTACHMENT_EXT, osg::FrameBufferAttachment(attachment));
|
||||
depthAttached = true;
|
||||
break;
|
||||
}
|
||||
case(osg::CameraNode::STENCIL_BUFFER):
|
||||
case(osg::Camera::STENCIL_BUFFER):
|
||||
{
|
||||
fbo->setAttachment(GL_STENCIL_ATTACHMENT_EXT, osg::FrameBufferAttachment(attachment));
|
||||
stencilAttached = true;
|
||||
@ -355,7 +355,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
}
|
||||
default:
|
||||
{
|
||||
fbo->setAttachment(GL_COLOR_ATTACHMENT0_EXT+(buffer-osg::CameraNode::COLOR_BUFFER0), osg::FrameBufferAttachment(attachment));
|
||||
fbo->setAttachment(GL_COLOR_ATTACHMENT0_EXT+(buffer-osg::Camera::COLOR_BUFFER0), osg::FrameBufferAttachment(attachment));
|
||||
colorAttached = true;
|
||||
break;
|
||||
}
|
||||
@ -409,26 +409,26 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
if (renderTargetImplemntation<renderTargetFallback)
|
||||
renderTargetImplemntation = renderTargetFallback;
|
||||
else
|
||||
renderTargetImplemntation = osg::CameraNode::PIXEL_BUFFER_RTT;
|
||||
renderTargetImplemntation = osg::Camera::PIXEL_BUFFER_RTT;
|
||||
}
|
||||
}
|
||||
|
||||
// check whether PBuffer-RTT is supported or not
|
||||
if (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT &&
|
||||
if (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT &&
|
||||
!osg::isGLExtensionSupported(state.getContextID(), "WGL_ARB_render_texture"))
|
||||
{
|
||||
if (renderTargetImplemntation<renderTargetFallback)
|
||||
renderTargetImplemntation = renderTargetFallback;
|
||||
else
|
||||
renderTargetImplemntation = osg::CameraNode::PIXEL_BUFFER;
|
||||
renderTargetImplemntation = osg::Camera::PIXEL_BUFFER;
|
||||
}
|
||||
|
||||
// if any of the renderTargetImplementations require a seperate graphics context such as with pbuffer try in turn to
|
||||
// set up, but if each level fails then resort to the next level down.
|
||||
while (!getGraphicsContext() &&
|
||||
(renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT ||
|
||||
renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER ||
|
||||
renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW) )
|
||||
(renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT ||
|
||||
renderTargetImplemntation==osg::Camera::PIXEL_BUFFER ||
|
||||
renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW) )
|
||||
{
|
||||
osg::ref_ptr<osg::GraphicsContext> context = getGraphicsContext();
|
||||
if (!context)
|
||||
@ -442,9 +442,9 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
|
||||
// osg::notify(osg::NOTICE)<<"traits = "<<traits->_width<<" "<<traits->_height<<std::endl;
|
||||
|
||||
traits->_pbuffer = (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER || renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT);
|
||||
traits->_windowDecoration = (renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW);
|
||||
traits->_doubleBuffer = (renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW);
|
||||
traits->_pbuffer = (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER || renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT);
|
||||
traits->_windowDecoration = (renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW);
|
||||
traits->_doubleBuffer = (renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW);
|
||||
|
||||
osg::Texture* pBufferTexture = 0;
|
||||
GLenum bufferFormat = GL_NONE;
|
||||
@ -454,28 +454,28 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
bool colorAttached = false;
|
||||
bool depthAttached = false;
|
||||
bool stencilAttached = false;
|
||||
for(osg::CameraNode::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
|
||||
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
|
||||
itr != bufferAttachements.end();
|
||||
++itr)
|
||||
{
|
||||
|
||||
osg::CameraNode::BufferComponent buffer = itr->first;
|
||||
osg::CameraNode::Attachment& attachment = itr->second;
|
||||
osg::Camera::BufferComponent buffer = itr->first;
|
||||
osg::Camera::Attachment& attachment = itr->second;
|
||||
switch(buffer)
|
||||
{
|
||||
case(osg::CameraNode::DEPTH_BUFFER):
|
||||
case(osg::Camera::DEPTH_BUFFER):
|
||||
{
|
||||
traits->_depth = 24;
|
||||
depthAttached = true;
|
||||
break;
|
||||
}
|
||||
case(osg::CameraNode::STENCIL_BUFFER):
|
||||
case(osg::Camera::STENCIL_BUFFER):
|
||||
{
|
||||
traits->_stencil = 8;
|
||||
stencilAttached = true;
|
||||
break;
|
||||
}
|
||||
case(osg::CameraNode::COLOR_BUFFER):
|
||||
case(osg::Camera::COLOR_BUFFER):
|
||||
{
|
||||
if (attachment._internalFormat!=GL_NONE)
|
||||
{
|
||||
@ -501,7 +501,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
level = attachment._level;
|
||||
face = attachment._face;
|
||||
|
||||
if (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT)
|
||||
if (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT)
|
||||
{
|
||||
traits->_target = bufferFormat;
|
||||
traits->_level = level;
|
||||
@ -512,7 +512,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
}
|
||||
default:
|
||||
{
|
||||
if (renderTargetImplemntation==osg::CameraNode::SEPERATE_WINDOW)
|
||||
if (renderTargetImplemntation==osg::Camera::SEPERATE_WINDOW)
|
||||
osg::notify(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Window ";
|
||||
else
|
||||
osg::notify(osg::NOTICE)<<"Warning: RenderStage::runCameraSetUp(State&) Pbuffer ";
|
||||
@ -570,7 +570,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
setDrawBuffer(GL_FRONT);
|
||||
setReadBuffer(GL_FRONT);
|
||||
|
||||
if (pBufferTexture && renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT)
|
||||
if (pBufferTexture && renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT)
|
||||
{
|
||||
osg::notify(osg::INFO)<<"RenderStage::runCameraSetUp(State&) Assign graphis context to Texture"<<std::endl;
|
||||
pBufferTexture->setReadPBuffer(context.get());
|
||||
@ -585,17 +585,17 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
{
|
||||
osg::notify(osg::INFO)<<"Failed to aquire Graphics Context"<<std::endl;
|
||||
|
||||
if (renderTargetImplemntation==osg::CameraNode::PIXEL_BUFFER_RTT)
|
||||
if (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT)
|
||||
{
|
||||
// fallback to using standard PBuffer, this will allow this while loop to continue
|
||||
if (renderTargetImplemntation<renderTargetFallback)
|
||||
renderTargetImplemntation = renderTargetFallback;
|
||||
else
|
||||
renderTargetImplemntation = osg::CameraNode::PIXEL_BUFFER;
|
||||
renderTargetImplemntation = osg::Camera::PIXEL_BUFFER;
|
||||
}
|
||||
else
|
||||
{
|
||||
renderTargetImplemntation = osg::CameraNode::FRAME_BUFFER;
|
||||
renderTargetImplemntation = osg::Camera::FRAME_BUFFER;
|
||||
}
|
||||
}
|
||||
|
||||
@ -603,11 +603,11 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
|
||||
}
|
||||
|
||||
// finally if all else has failed, then the frame buffer fallback will come in to play.
|
||||
if (renderTargetImplemntation==osg::CameraNode::FRAME_BUFFER)
|
||||
if (renderTargetImplemntation==osg::Camera::FRAME_BUFFER)
|
||||
{
|
||||
osg::notify(osg::INFO)<<"Setting up osg::CameraNode::FRAME_BUFFER"<<std::endl;
|
||||
osg::notify(osg::INFO)<<"Setting up osg::Camera::FRAME_BUFFER"<<std::endl;
|
||||
|
||||
for(osg::CameraNode::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
|
||||
for(osg::Camera::BufferAttachmentMap::iterator itr = bufferAttachements.begin();
|
||||
itr != bufferAttachements.end();
|
||||
++itr)
|
||||
{
|
||||
@ -734,7 +734,7 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
|
||||
{
|
||||
copyTexture(renderInfo);
|
||||
}
|
||||
std::map< osg::CameraNode::BufferComponent, Attachment>::const_iterator itr;
|
||||
std::map< osg::Camera::BufferComponent, Attachment>::const_iterator itr;
|
||||
for(itr = _bufferAttachmentMap.begin(); itr != _bufferAttachmentMap.end(); ++itr){
|
||||
if (itr->second._image.valid())
|
||||
{
|
||||
@ -771,8 +771,8 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
|
||||
if (fbo_supported && _camera)
|
||||
{
|
||||
// now generate mipmaps if they are required.
|
||||
const osg::CameraNode::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
|
||||
for(osg::CameraNode::BufferAttachmentMap::const_iterator itr = bufferAttachements.begin();
|
||||
const osg::Camera::BufferAttachmentMap& bufferAttachements = _camera->getBufferAttachmentMap();
|
||||
for(osg::Camera::BufferAttachmentMap::const_iterator itr = bufferAttachements.begin();
|
||||
itr != bufferAttachements.end();
|
||||
++itr)
|
||||
{
|
||||
@ -1014,7 +1014,7 @@ bool RenderStage::getStats(Statistics& stats) const
|
||||
return statsCollected;
|
||||
}
|
||||
|
||||
void RenderStage::attach(osg::CameraNode::BufferComponent buffer, osg::Image* image)
|
||||
void RenderStage::attach(osg::Camera::BufferComponent buffer, osg::Image* image)
|
||||
{
|
||||
_bufferAttachmentMap[buffer]._image = image;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ SceneView::SceneView(DisplaySettings* ds)
|
||||
|
||||
_prioritizeTextures = false;
|
||||
|
||||
_camera = new CameraNode;
|
||||
_camera = new Camera;
|
||||
_camera->setViewport(new Viewport);
|
||||
_camera->setClearColor(osg::Vec4(0.2f, 0.2f, 0.4f, 1.0f));
|
||||
|
||||
@ -210,7 +210,7 @@ void SceneView::setDefaults(unsigned int options)
|
||||
_camera->setClearColor(osg::Vec4(0.2f, 0.2f, 0.4f, 1.0f));
|
||||
}
|
||||
|
||||
void SceneView::setCamera(osg::CameraNode* camera)
|
||||
void SceneView::setCamera(osg::Camera* camera)
|
||||
{
|
||||
if (camera)
|
||||
{
|
||||
|
24
src/osgViewer/CompositeViewer.cpp
Normal file
24
src/osgViewer/CompositeViewer.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgViewer/CompositeViewer>
|
||||
|
||||
using namespace osgViewer;
|
||||
|
||||
CompositeViewer::CompositeViewer():
|
||||
{
|
||||
}
|
||||
|
||||
CompositeViewer::~CompositeViewer()
|
||||
{
|
||||
}
|
@ -4,6 +4,8 @@ include $(TOPDIR)/Make/makedefs
|
||||
|
||||
CXXFILES = \
|
||||
SimpleViewer.cpp\
|
||||
Scene.cpp\
|
||||
View.cpp\
|
||||
Version.cpp\
|
||||
|
||||
DEF += -DOSGVIEWER_LIBRARY
|
||||
|
122
src/osgViewer/Scene.cpp
Normal file
122
src/osgViewer/Scene.cpp
Normal file
@ -0,0 +1,122 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgViewer/Scene>
|
||||
|
||||
using namespace osgViewer;
|
||||
|
||||
Scene::Scene():
|
||||
_firstFrame(true)
|
||||
{
|
||||
_startTick = osg::Timer::instance()->tick();
|
||||
_frameStamp = new osg::FrameStamp;
|
||||
_frameStamp->setFrameNumber(0);
|
||||
_frameStamp->setReferenceTime(0);
|
||||
|
||||
_updateVisitor = new osgUtil::UpdateVisitor;
|
||||
|
||||
_eventQueue->setStartTick(_startTick);
|
||||
|
||||
_eventVisitor = new osgGA::EventVisitor;
|
||||
|
||||
setDatabasePager(new osgDB::DatabasePager);
|
||||
}
|
||||
|
||||
Scene::~Scene()
|
||||
{
|
||||
}
|
||||
|
||||
void Scene::setSceneData(osg::Node* node)
|
||||
{
|
||||
_sceneData = node;
|
||||
|
||||
if (_databasePager.valid())
|
||||
{
|
||||
// register any PagedLOD that need to be tracked in the scene graph
|
||||
_databasePager->registerPagedLODs(node);
|
||||
}
|
||||
}
|
||||
|
||||
osg::Node* Scene::getSceneData()
|
||||
{
|
||||
return _sceneData.get();
|
||||
}
|
||||
|
||||
const osg::Node* Scene::getSceneData() const
|
||||
{
|
||||
return _sceneData.get();
|
||||
}
|
||||
|
||||
void Scene::setDatabasePager(osgDB::DatabasePager* dp)
|
||||
{
|
||||
_databasePager = dp;
|
||||
}
|
||||
|
||||
void Scene::frameAdvance()
|
||||
{
|
||||
osg::Timer_t currentTick = osg::Timer::instance()->tick();
|
||||
_frameStamp->setReferenceTime(osg::Timer::instance()->delta_s(_startTick,currentTick));
|
||||
_frameStamp->setFrameNumber(_frameStamp->getFrameNumber()+1);
|
||||
}
|
||||
|
||||
void Scene::frameEventTraversal()
|
||||
{
|
||||
_eventQueue->frame( _frameStamp->getReferenceTime() );
|
||||
|
||||
osgGA::EventQueue::Events events;
|
||||
_eventQueue->takeEvents(events);
|
||||
|
||||
if (_eventVisitor.valid())
|
||||
{
|
||||
_eventVisitor->setTraversalNumber(_frameStamp->getFrameNumber());
|
||||
}
|
||||
|
||||
for(osgGA::EventQueue::Events::iterator itr = events.begin();
|
||||
itr != events.end();
|
||||
++itr)
|
||||
{
|
||||
osgGA::GUIEventAdapter* event = itr->get();
|
||||
|
||||
bool handled = false;
|
||||
|
||||
if (_eventVisitor.valid() && getSceneData())
|
||||
{
|
||||
_eventVisitor->reset();
|
||||
_eventVisitor->addEvent( event );
|
||||
|
||||
getSceneData()->accept(*_eventVisitor);
|
||||
|
||||
if (_eventVisitor->getEventHandled()) handled = true;
|
||||
}
|
||||
|
||||
for(EventHandlers::iterator hitr = _eventHandlers.begin();
|
||||
hitr != _eventHandlers.end() && !handled;
|
||||
++hitr)
|
||||
{
|
||||
// handled = (*hitr)->handle( *event, *this, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Scene::frameUpdateTraversal()
|
||||
{
|
||||
if (_databasePager.valid())
|
||||
{
|
||||
// tell the DatabasePager the frame number of that the scene graph is being actively used to render a frame
|
||||
_databasePager->signalBeginFrame(_frameStamp.get());
|
||||
|
||||
// syncronize changes required by the DatabasePager thread to the scene graph
|
||||
_databasePager->updateSceneGraph(_frameStamp->getReferenceTime());
|
||||
}
|
||||
}
|
||||
|
@ -69,12 +69,12 @@ const osg::Node* SimpleViewer::getSceneData() const
|
||||
return _sceneView->getSceneData();
|
||||
}
|
||||
|
||||
osg::CameraNode* SimpleViewer::getCamera()
|
||||
osg::Camera* SimpleViewer::getCamera()
|
||||
{
|
||||
return _sceneView->getCamera();
|
||||
}
|
||||
|
||||
const osg::CameraNode* SimpleViewer::getCamera() const
|
||||
const osg::Camera* SimpleViewer::getCamera() const
|
||||
{
|
||||
return _sceneView->getCamera();
|
||||
}
|
||||
|
24
src/osgViewer/View.cpp
Normal file
24
src/osgViewer/View.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgViewer/View>
|
||||
|
||||
using namespace osgViewer;
|
||||
|
||||
View::View()
|
||||
{
|
||||
}
|
||||
|
||||
View::~View()
|
||||
{
|
||||
}
|
24
src/osgViewer/Viewer.cpp
Normal file
24
src/osgViewer/Viewer.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgViewer/Viewer>
|
||||
|
||||
using namespace osgViewer;
|
||||
|
||||
Viewer::Viewer():
|
||||
{
|
||||
}
|
||||
|
||||
Viewer::~Viewer()
|
||||
{
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/ColorMask>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/GraphicsContext>
|
||||
@ -35,49 +35,49 @@
|
||||
#undef OUT
|
||||
#endif
|
||||
|
||||
TYPE_NAME_ALIAS(std::map< osg::CameraNode::BufferComponent COMMA osg::CameraNode::Attachment >, osg::CameraNode::BufferAttachmentMap);
|
||||
TYPE_NAME_ALIAS(std::map< osg::Camera::BufferComponent COMMA osg::Camera::Attachment >, osg::Camera::BufferAttachmentMap);
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osg::CameraNode::TransformOrder)
|
||||
I_EnumLabel(osg::CameraNode::PRE_MULTIPLY);
|
||||
I_EnumLabel(osg::CameraNode::POST_MULTIPLY);
|
||||
BEGIN_ENUM_REFLECTOR(osg::Camera::TransformOrder)
|
||||
I_EnumLabel(osg::Camera::PRE_MULTIPLY);
|
||||
I_EnumLabel(osg::Camera::POST_MULTIPLY);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osg::CameraNode::RenderOrder)
|
||||
I_EnumLabel(osg::CameraNode::PRE_RENDER);
|
||||
I_EnumLabel(osg::CameraNode::NESTED_RENDER);
|
||||
I_EnumLabel(osg::CameraNode::POST_RENDER);
|
||||
BEGIN_ENUM_REFLECTOR(osg::Camera::RenderOrder)
|
||||
I_EnumLabel(osg::Camera::PRE_RENDER);
|
||||
I_EnumLabel(osg::Camera::NESTED_RENDER);
|
||||
I_EnumLabel(osg::Camera::POST_RENDER);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osg::CameraNode::RenderTargetImplementation)
|
||||
I_EnumLabel(osg::CameraNode::FRAME_BUFFER_OBJECT);
|
||||
I_EnumLabel(osg::CameraNode::PIXEL_BUFFER_RTT);
|
||||
I_EnumLabel(osg::CameraNode::PIXEL_BUFFER);
|
||||
I_EnumLabel(osg::CameraNode::FRAME_BUFFER);
|
||||
I_EnumLabel(osg::CameraNode::SEPERATE_WINDOW);
|
||||
BEGIN_ENUM_REFLECTOR(osg::Camera::RenderTargetImplementation)
|
||||
I_EnumLabel(osg::Camera::FRAME_BUFFER_OBJECT);
|
||||
I_EnumLabel(osg::Camera::PIXEL_BUFFER_RTT);
|
||||
I_EnumLabel(osg::Camera::PIXEL_BUFFER);
|
||||
I_EnumLabel(osg::Camera::FRAME_BUFFER);
|
||||
I_EnumLabel(osg::Camera::SEPERATE_WINDOW);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ENUM_REFLECTOR(osg::CameraNode::BufferComponent)
|
||||
I_EnumLabel(osg::CameraNode::DEPTH_BUFFER);
|
||||
I_EnumLabel(osg::CameraNode::STENCIL_BUFFER);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER0);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER1);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER2);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER3);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER4);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER5);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER6);
|
||||
I_EnumLabel(osg::CameraNode::COLOR_BUFFER7);
|
||||
BEGIN_ENUM_REFLECTOR(osg::Camera::BufferComponent)
|
||||
I_EnumLabel(osg::Camera::DEPTH_BUFFER);
|
||||
I_EnumLabel(osg::Camera::STENCIL_BUFFER);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER0);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER1);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER2);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER3);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER4);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER5);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER6);
|
||||
I_EnumLabel(osg::Camera::COLOR_BUFFER7);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
BEGIN_OBJECT_REFLECTOR(osg::Camera)
|
||||
I_BaseType(osg::Transform);
|
||||
I_BaseType(osg::CullSettings);
|
||||
I_Constructor0(____CameraNode,
|
||||
I_Constructor0(____Camera,
|
||||
"",
|
||||
"");
|
||||
I_ConstructorWithDefaults2(IN, const osg::CameraNode &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____CameraNode__C5_CameraNode_R1__C5_CopyOp_R1,
|
||||
I_ConstructorWithDefaults2(IN, const osg::Camera &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____Camera__C5_Camera_R1__C5_CopyOp_R1,
|
||||
"Copy constructor using CopyOp to manage deep vs shallow copy. ",
|
||||
"");
|
||||
I_Method0(osg::Object *, cloneType,
|
||||
@ -164,11 +164,11 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
__Viewport_P1__getViewport,
|
||||
"Get the viewport. ",
|
||||
"");
|
||||
I_Method1(void, setTransformOrder, IN, osg::CameraNode::TransformOrder, order,
|
||||
I_Method1(void, setTransformOrder, IN, osg::Camera::TransformOrder, order,
|
||||
__void__setTransformOrder__TransformOrder,
|
||||
"Set the transformation order for world-to-local and local-to-world transformation. ",
|
||||
"");
|
||||
I_Method0(osg::CameraNode::TransformOrder, getTransformOrder,
|
||||
I_Method0(osg::Camera::TransformOrder, getTransformOrder,
|
||||
__TransformOrder__getTransformOrder,
|
||||
"Get the transformation order. ",
|
||||
"");
|
||||
@ -244,11 +244,11 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
__Matrixd__getInverseViewMatrix,
|
||||
"Get the inverse view matrix. ",
|
||||
"");
|
||||
I_MethodWithDefaults2(void, setRenderOrder, IN, osg::CameraNode::RenderOrder, order, , IN, int, orderNum, 0,
|
||||
I_MethodWithDefaults2(void, setRenderOrder, IN, osg::Camera::RenderOrder, order, , IN, int, orderNum, 0,
|
||||
__void__setRenderOrder__RenderOrder__int,
|
||||
"Set the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within. ",
|
||||
"For rendering to a texture, one typically uses PRE_RENDER. For Head Up Displays, one would typically use POST_RENDER. ");
|
||||
I_Method0(osg::CameraNode::RenderOrder, getRenderOrder,
|
||||
I_Method0(osg::Camera::RenderOrder, getRenderOrder,
|
||||
__RenderOrder__getRenderOrder,
|
||||
"Get the rendering order of this camera's subgraph relative to any camera that this subgraph is nested within. ",
|
||||
"");
|
||||
@ -260,19 +260,19 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
__bool__isRenderToTextureCamera,
|
||||
"Return true if this Camera is set up as a render to texture camera, i.e. ",
|
||||
"it has textures assigned to it. ");
|
||||
I_Method1(void, setRenderTargetImplementation, IN, osg::CameraNode::RenderTargetImplementation, impl,
|
||||
I_Method1(void, setRenderTargetImplementation, IN, osg::Camera::RenderTargetImplementation, impl,
|
||||
__void__setRenderTargetImplementation__RenderTargetImplementation,
|
||||
"Set the render target. ",
|
||||
"");
|
||||
I_Method2(void, setRenderTargetImplementation, IN, osg::CameraNode::RenderTargetImplementation, impl, IN, osg::CameraNode::RenderTargetImplementation, fallback,
|
||||
I_Method2(void, setRenderTargetImplementation, IN, osg::Camera::RenderTargetImplementation, impl, IN, osg::Camera::RenderTargetImplementation, fallback,
|
||||
__void__setRenderTargetImplementation__RenderTargetImplementation__RenderTargetImplementation,
|
||||
"Set the render target and fall-back that's used if the former isn't available. ",
|
||||
"");
|
||||
I_Method0(osg::CameraNode::RenderTargetImplementation, getRenderTargetImplementation,
|
||||
I_Method0(osg::Camera::RenderTargetImplementation, getRenderTargetImplementation,
|
||||
__RenderTargetImplementation__getRenderTargetImplementation,
|
||||
"Get the render target. ",
|
||||
"");
|
||||
I_Method0(osg::CameraNode::RenderTargetImplementation, getRenderTargetFallback,
|
||||
I_Method0(osg::Camera::RenderTargetImplementation, getRenderTargetFallback,
|
||||
__RenderTargetImplementation__getRenderTargetFallback,
|
||||
"Get the render target fallback. ",
|
||||
"");
|
||||
@ -292,27 +292,27 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
__GLenum__getReadBuffer,
|
||||
"Get the read buffer for any required copy operations to use. ",
|
||||
"");
|
||||
I_Method2(void, attach, IN, osg::CameraNode::BufferComponent, buffer, IN, GLenum, internalFormat,
|
||||
I_Method2(void, attach, IN, osg::Camera::BufferComponent, buffer, IN, GLenum, internalFormat,
|
||||
__void__attach__BufferComponent__GLenum,
|
||||
"",
|
||||
"");
|
||||
I_MethodWithDefaults5(void, attach, IN, osg::CameraNode::BufferComponent, buffer, , IN, osg::Texture *, texture, , IN, unsigned int, level, 0, IN, unsigned int, face, 0, IN, bool, mipMapGeneration, false,
|
||||
I_MethodWithDefaults5(void, attach, IN, osg::Camera::BufferComponent, buffer, , IN, osg::Texture *, texture, , IN, unsigned int, level, 0, IN, unsigned int, face, 0, IN, bool, mipMapGeneration, false,
|
||||
__void__attach__BufferComponent__osg_Texture_P1__unsigned_int__unsigned_int__bool,
|
||||
"",
|
||||
"");
|
||||
I_Method2(void, attach, IN, osg::CameraNode::BufferComponent, buffer, IN, osg::Image *, image,
|
||||
I_Method2(void, attach, IN, osg::Camera::BufferComponent, buffer, IN, osg::Image *, image,
|
||||
__void__attach__BufferComponent__osg_Image_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, detach, IN, osg::CameraNode::BufferComponent, buffer,
|
||||
I_Method1(void, detach, IN, osg::Camera::BufferComponent, buffer,
|
||||
__void__detach__BufferComponent,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osg::CameraNode::BufferAttachmentMap &, getBufferAttachmentMap,
|
||||
I_Method0(osg::Camera::BufferAttachmentMap &, getBufferAttachmentMap,
|
||||
__BufferAttachmentMap_R1__getBufferAttachmentMap,
|
||||
"Get the BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads. ",
|
||||
"");
|
||||
I_Method0(const osg::CameraNode::BufferAttachmentMap &, getBufferAttachmentMap,
|
||||
I_Method0(const osg::Camera::BufferAttachmentMap &, getBufferAttachmentMap,
|
||||
__C5_BufferAttachmentMap_R1__getBufferAttachmentMap,
|
||||
"Get the const BufferAttachmentMap, used to configure frame buffer objects, pbuffers and texture reads. ",
|
||||
"");
|
||||
@ -340,15 +340,15 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
__C5_osg_Object_P1__getRenderingCache__unsigned_int,
|
||||
"Get the const Rendering object that is used to implement rendering of the subgraph. ",
|
||||
"");
|
||||
I_Method1(void, setPostDrawCallback, IN, osg::CameraNode::DrawCallback *, cb,
|
||||
I_Method1(void, setPostDrawCallback, IN, osg::Camera::DrawCallback *, cb,
|
||||
__void__setPostDrawCallback__DrawCallback_P1,
|
||||
"Set the post draw callback for custom operations to do done after the drawing of the camera's subgraph has been completed. ",
|
||||
"");
|
||||
I_Method0(osg::CameraNode::DrawCallback *, getPostDrawCallback,
|
||||
I_Method0(osg::Camera::DrawCallback *, getPostDrawCallback,
|
||||
__DrawCallback_P1__getPostDrawCallback,
|
||||
"Get the post draw callback. ",
|
||||
"");
|
||||
I_Method0(const osg::CameraNode::DrawCallback *, getPostDrawCallback,
|
||||
I_Method0(const osg::Camera::DrawCallback *, getPostDrawCallback,
|
||||
__C5_DrawCallback_P1__getPostDrawCallback,
|
||||
"Get the const post draw callback. ",
|
||||
"");
|
||||
@ -368,7 +368,7 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
__bool__computeWorldToLocalMatrix__Matrix_R1__NodeVisitor_P1,
|
||||
"Transform method that must be defined to provide generic interface for scene graph traversals. ",
|
||||
"");
|
||||
I_SimpleProperty(osg::CameraNode::BufferAttachmentMap &, BufferAttachmentMap,
|
||||
I_SimpleProperty(osg::Camera::BufferAttachmentMap &, BufferAttachmentMap,
|
||||
__BufferAttachmentMap_R1__getBufferAttachmentMap,
|
||||
0);
|
||||
I_SimpleProperty(const osg::Vec4 &, ClearColor,
|
||||
@ -392,7 +392,7 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
I_SimpleProperty(osg::Matrixd, InverseViewMatrix,
|
||||
__Matrixd__getInverseViewMatrix,
|
||||
0);
|
||||
I_SimpleProperty(osg::CameraNode::DrawCallback *, PostDrawCallback,
|
||||
I_SimpleProperty(osg::Camera::DrawCallback *, PostDrawCallback,
|
||||
__DrawCallback_P1__getPostDrawCallback,
|
||||
__void__setPostDrawCallback__DrawCallback_P1);
|
||||
I_SimpleProperty(const osg::Matrixd &, ProjectionMatrix,
|
||||
@ -401,23 +401,23 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
I_SimpleProperty(GLenum, ReadBuffer,
|
||||
__GLenum__getReadBuffer,
|
||||
__void__setReadBuffer__GLenum);
|
||||
I_SimpleProperty(osg::CameraNode::RenderOrder, RenderOrder,
|
||||
I_SimpleProperty(osg::Camera::RenderOrder, RenderOrder,
|
||||
__RenderOrder__getRenderOrder,
|
||||
0);
|
||||
I_SimpleProperty(int, RenderOrderNum,
|
||||
__int__getRenderOrderNum,
|
||||
0);
|
||||
I_SimpleProperty(osg::CameraNode::RenderTargetImplementation, RenderTargetFallback,
|
||||
I_SimpleProperty(osg::Camera::RenderTargetImplementation, RenderTargetFallback,
|
||||
__RenderTargetImplementation__getRenderTargetFallback,
|
||||
0);
|
||||
I_SimpleProperty(osg::CameraNode::RenderTargetImplementation, RenderTargetImplementation,
|
||||
I_SimpleProperty(osg::Camera::RenderTargetImplementation, RenderTargetImplementation,
|
||||
__RenderTargetImplementation__getRenderTargetImplementation,
|
||||
__void__setRenderTargetImplementation__RenderTargetImplementation);
|
||||
I_IndexedProperty(osg::Object *, RenderingCache,
|
||||
__osg_Object_P1__getRenderingCache__unsigned_int,
|
||||
__void__setRenderingCache__unsigned_int__osg_Object_P1,
|
||||
0);
|
||||
I_SimpleProperty(osg::CameraNode::TransformOrder, TransformOrder,
|
||||
I_SimpleProperty(osg::Camera::TransformOrder, TransformOrder,
|
||||
__TransformOrder__getTransformOrder,
|
||||
__void__setTransformOrder__TransformOrder);
|
||||
I_SimpleProperty(osg::View *, View,
|
||||
@ -431,7 +431,7 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode)
|
||||
__void__setViewport__osg_Viewport_P1);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::CameraNode::Attachment)
|
||||
BEGIN_VALUE_REFLECTOR(osg::Camera::Attachment)
|
||||
I_Constructor0(____Attachment,
|
||||
"",
|
||||
"");
|
||||
@ -455,12 +455,12 @@ BEGIN_VALUE_REFLECTOR(osg::CameraNode::Attachment)
|
||||
I_PublicMemberProperty(bool, _mipMapGeneration);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::CameraNode::DrawCallback)
|
||||
BEGIN_OBJECT_REFLECTOR(osg::Camera::DrawCallback)
|
||||
I_VirtualBaseType(osg::Object);
|
||||
I_Constructor0(____DrawCallback,
|
||||
"",
|
||||
"");
|
||||
I_Constructor2(IN, const osg::CameraNode::DrawCallback &, x, IN, const osg::CopyOp &, x,
|
||||
I_Constructor2(IN, const osg::Camera::DrawCallback &, x, IN, const osg::CopyOp &, x,
|
||||
____DrawCallback__C5_DrawCallback_R1__C5_CopyOp_R1,
|
||||
"",
|
||||
"");
|
||||
@ -486,5 +486,5 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode::DrawCallback)
|
||||
"Must be defined by derived classes. ");
|
||||
END_REFLECTOR
|
||||
|
||||
STD_MAP_REFLECTOR(std::map< osg::CameraNode::BufferComponent COMMA osg::CameraNode::Attachment >);
|
||||
STD_MAP_REFLECTOR(std::map< osg::Camera::BufferComponent COMMA osg::Camera::Attachment >);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/FrameBufferObject>
|
||||
#include <osg/Object>
|
||||
@ -113,8 +113,8 @@ BEGIN_VALUE_REFLECTOR(osg::FrameBufferAttachment)
|
||||
____FrameBufferAttachment__TextureRectangle_P1,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, osg::CameraNode::Attachment &, attachment,
|
||||
____FrameBufferAttachment__CameraNode_Attachment_R1,
|
||||
I_Constructor1(IN, osg::Camera::Attachment &, attachment,
|
||||
____FrameBufferAttachment__Camera_Attachment_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method2(void, createRequiredTexturesAndApplyGenerateMipMap, IN, osg::State &, state, IN, const osg::FBOExtensions *, ext,
|
||||
|
@ -15,7 +15,7 @@ CXXFILES =\
|
||||
BoundingBox.cpp\
|
||||
BoundingSphere.cpp\
|
||||
BufferObject.cpp\
|
||||
CameraNode.cpp\
|
||||
Camera.cpp\
|
||||
CameraView.cpp\
|
||||
ClampColor.cpp\
|
||||
ClearNode.cpp\
|
||||
|
@ -102,6 +102,10 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixd)
|
||||
__void__makeIdentity,
|
||||
"",
|
||||
"");
|
||||
I_Method0(bool, isIdentity,
|
||||
__bool__isIdentity,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, makeScale, IN, const osg::Vec3f &, x,
|
||||
__void__makeScale__C5_Vec3f_R1,
|
||||
"",
|
||||
@ -246,14 +250,6 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixd)
|
||||
__Vec4d__postMult__C5_Vec4d_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, set, IN, const osg::Quat &, q,
|
||||
__void__set__C5_Quat_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, get, IN, osg::Quat &, q,
|
||||
__void__get__Quat_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setRotate, IN, const osg::Quat &, q,
|
||||
__void__setRotate__C5_Quat_R1,
|
||||
"",
|
||||
|
@ -98,6 +98,10 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixf)
|
||||
__C5_value_type_P1__ptr,
|
||||
"",
|
||||
"");
|
||||
I_Method0(bool, isIdentity,
|
||||
__bool__isIdentity,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, makeIdentity,
|
||||
__void__makeIdentity,
|
||||
"",
|
||||
@ -246,14 +250,6 @@ BEGIN_VALUE_REFLECTOR(osg::Matrixf)
|
||||
__Vec4d__postMult__C5_Vec4d_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, set, IN, const osg::Quat &, q,
|
||||
__void__set__C5_Quat_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, get, IN, osg::Quat &, q,
|
||||
__void__get__Quat_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setRotate, IN, const osg::Quat &, q,
|
||||
__void__setRotate__C5_Quat_R1,
|
||||
"",
|
||||
|
@ -82,7 +82,7 @@ BEGIN_OBJECT_REFLECTOR(osg::observer_ptr< osg::Node >)
|
||||
____observer_ptr__C5_observer_ptr_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, objectDeleted, IN, void *, ptr,
|
||||
I_Method1(void, objectDeleted, IN, void *, x,
|
||||
__void__objectDeleted__void_P1,
|
||||
"",
|
||||
"");
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Billboard>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/CameraView>
|
||||
#include <osg/ClearNode>
|
||||
#include <osg/ClipNode>
|
||||
@ -35,7 +35,6 @@
|
||||
#include <osg/TexGenNode>
|
||||
#include <osg/Transform>
|
||||
#include <osg/Vec3>
|
||||
#include <osg/View>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
#ifdef IN
|
||||
@ -221,12 +220,8 @@ BEGIN_OBJECT_REFLECTOR(osg::NodeVisitor)
|
||||
__void__apply__Transform_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::View &, node,
|
||||
__void__apply__View_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::CameraNode &, node,
|
||||
__void__apply__CameraNode_R1,
|
||||
I_Method1(void, apply, IN, osg::Camera &, node,
|
||||
__void__apply__Camera_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::CameraView &, node,
|
||||
|
@ -121,6 +121,10 @@ BEGIN_VALUE_REFLECTOR(osg::Plane)
|
||||
__float__distance__C5_osg_Vec3_R1,
|
||||
"calculate the distance between a point and the plane. ",
|
||||
"");
|
||||
I_Method1(float, dotProductNormal, IN, const osg::Vec3 &, v,
|
||||
__float__dotProductNormal__C5_osg_Vec3_R1,
|
||||
"calculate the dot product of the plane normal and a point. ",
|
||||
"");
|
||||
I_Method1(int, intersect, IN, const std::vector< osg::Vec3 > &, vertices,
|
||||
__int__intersect__C5_std_vectorT1_Vec3__R1,
|
||||
"intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane. ",
|
||||
|
@ -10,14 +10,9 @@
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Matrix>
|
||||
#include <osg/Matrixd>
|
||||
#include <osg/Matrixf>
|
||||
#include <osg/NodeVisitor>
|
||||
#include <osg/Object>
|
||||
#include <osg/Vec3>
|
||||
#include <osg/View>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
@ -29,182 +24,71 @@
|
||||
#endif
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::View)
|
||||
I_BaseType(osg::Transform);
|
||||
I_BaseType(osg::CullSettings);
|
||||
I_BaseType(osg::Referenced);
|
||||
I_Constructor0(____View,
|
||||
"",
|
||||
"");
|
||||
I_ConstructorWithDefaults2(IN, const osg::View &, x, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____View__C5_View_R1__C5_CopyOp_R1,
|
||||
"Copy constructor using CopyOp to manage deep vs shallow copy. ",
|
||||
"");
|
||||
I_Method0(osg::Object *, cloneType,
|
||||
__osg_Object_P1__cloneType,
|
||||
"clone an object of the same type as the node. ",
|
||||
I_Method1(void, setCamera, IN, osg::Camera *, camera,
|
||||
__void__setCamera__osg_Camera_P1,
|
||||
"Set the master camera of the view. ",
|
||||
"");
|
||||
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
|
||||
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
|
||||
"return a clone of a node, with Object* return type. ",
|
||||
I_Method0(osg::Camera *, getCamera,
|
||||
__osg_Camera_P1__getCamera,
|
||||
"Get the master camera of the view. ",
|
||||
"");
|
||||
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
|
||||
__bool__isSameKindAs__C5_osg_Object_P1,
|
||||
"return true if this and obj are of the same kind of object. ",
|
||||
I_Method0(const osg::Camera *, getCamera,
|
||||
__C5_osg_Camera_P1__getCamera,
|
||||
"Get the const master camera of the view. ",
|
||||
"");
|
||||
I_Method0(const char *, className,
|
||||
__C5_char_P1__className,
|
||||
"return the name of the node's class type. ",
|
||||
"");
|
||||
I_Method0(const char *, libraryName,
|
||||
__C5_char_P1__libraryName,
|
||||
"return the name of the node's library. ",
|
||||
"");
|
||||
I_Method1(void, accept, IN, osg::NodeVisitor &, nv,
|
||||
__void__accept__osg_NodeVisitor_R1,
|
||||
"Visitor Pattern : calls the apply method of a NodeVisitor with this node's type. ",
|
||||
"");
|
||||
I_Method1(void, setProjectionMatrix, IN, const osg::Matrixf &, matrix,
|
||||
__void__setProjectionMatrix__C5_osg_Matrixf_R1,
|
||||
"Set the projection matrix. ",
|
||||
"Can be thought of as setting the lens of a camera. ");
|
||||
I_Method1(void, setProjectionMatrix, IN, const osg::Matrixd &, matrix,
|
||||
__void__setProjectionMatrix__C5_osg_Matrixd_R1,
|
||||
"Set the projection matrix. ",
|
||||
"Can be thought of as setting the lens of a camera. ");
|
||||
I_Method6(void, setProjectionMatrixAsOrtho, IN, double, left, IN, double, right, IN, double, bottom, IN, double, top, IN, double, zNear, IN, double, zFar,
|
||||
__void__setProjectionMatrixAsOrtho__double__double__double__double__double__double,
|
||||
"Set to an orthographic projection. ",
|
||||
"See OpenGL glOrtho for documentation further details. ");
|
||||
I_Method4(void, setProjectionMatrixAsOrtho2D, IN, double, left, IN, double, right, IN, double, bottom, IN, double, top,
|
||||
__void__setProjectionMatrixAsOrtho2D__double__double__double__double,
|
||||
"Set to a 2D orthographic projection. ",
|
||||
"See OpenGL glOrtho2D documentation for further details. ");
|
||||
I_Method6(void, setProjectionMatrixAsFrustum, IN, double, left, IN, double, right, IN, double, bottom, IN, double, top, IN, double, zNear, IN, double, zFar,
|
||||
__void__setProjectionMatrixAsFrustum__double__double__double__double__double__double,
|
||||
"Set to a perspective projection. ",
|
||||
"See OpenGL glFrustum documentation for further details. ");
|
||||
I_Method4(void, setProjectionMatrixAsPerspective, IN, double, fovy, IN, double, aspectRatio, IN, double, zNear, IN, double, zFar,
|
||||
__void__setProjectionMatrixAsPerspective__double__double__double__double,
|
||||
"Create a symmetrical perspective projection, See OpenGL gluPerspective documentation for further details. ",
|
||||
"Aspect ratio is defined as width/height. ");
|
||||
I_Method0(osg::Matrixd &, getProjectionMatrix,
|
||||
__osg_Matrixd_R1__getProjectionMatrix,
|
||||
"Get the projection matrix. ",
|
||||
"");
|
||||
I_Method0(const osg::Matrixd &, getProjectionMatrix,
|
||||
__C5_osg_Matrixd_R1__getProjectionMatrix,
|
||||
"Get the const projection matrix. ",
|
||||
"");
|
||||
I_Method6(bool, getProjectionMatrixAsOrtho, IN, double &, left, IN, double &, right, IN, double &, bottom, IN, double &, top, IN, double &, zNear, IN, double &, zFar,
|
||||
__bool__getProjectionMatrixAsOrtho__double_R1__double_R1__double_R1__double_R1__double_R1__double_R1,
|
||||
"Get the othographic settings of the orthographic projection matrix. ",
|
||||
"Returns false if matrix is not an orthographic matrix, where parameter values are undefined. ");
|
||||
I_Method6(bool, getProjectionMatrixAsFrustum, IN, double &, left, IN, double &, right, IN, double &, bottom, IN, double &, top, IN, double &, zNear, IN, double &, zFar,
|
||||
__bool__getProjectionMatrixAsFrustum__double_R1__double_R1__double_R1__double_R1__double_R1__double_R1,
|
||||
"Get the frustum setting of a perspective projection matrix. ",
|
||||
"Returns false if matrix is not a perspective matrix, where parameter values are undefined. ");
|
||||
I_Method4(bool, getProjectionMatrixAsPerspective, IN, double &, fovy, IN, double &, aspectRatio, IN, double &, zNear, IN, double &, zFar,
|
||||
__bool__getProjectionMatrixAsPerspective__double_R1__double_R1__double_R1__double_R1,
|
||||
"Get the frustum setting of a symmetric perspective projection matrix. ",
|
||||
"Returns false if matrix is not a perspective matrix, where parameter values are undefined. Note, if matrix is not a symmetric perspective matrix then the shear will be lost. Asymmetric matrices occur when stereo, power walls, caves and reality center display are used. In these configurations one should use the 'getProjectionMatrixAsFrustum' method instead. ");
|
||||
I_Method1(void, setViewMatrix, IN, const osg::Matrixf &, matrix,
|
||||
__void__setViewMatrix__C5_osg_Matrixf_R1,
|
||||
"Set the view matrix. ",
|
||||
"Can be thought of as setting the position of the world relative to the camera in camera coordinates. ");
|
||||
I_Method1(void, setViewMatrix, IN, const osg::Matrixd &, matrix,
|
||||
__void__setViewMatrix__C5_osg_Matrixd_R1,
|
||||
"Set the view matrix. ",
|
||||
"Can be thought of as setting the position of the world relative to the camera in camera coordinates. ");
|
||||
I_Method3(void, setViewMatrixAsLookAt, IN, const osg::Vec3 &, eye, IN, const osg::Vec3 &, center, IN, const osg::Vec3 &, up,
|
||||
__void__setViewMatrixAsLookAt__C5_osg_Vec3_R1__C5_osg_Vec3_R1__C5_osg_Vec3_R1,
|
||||
"Set to the position and orientation of view matrix, using the same convention as gluLookAt. ",
|
||||
"");
|
||||
I_Method0(osg::Matrixd &, getViewMatrix,
|
||||
__osg_Matrixd_R1__getViewMatrix,
|
||||
"Get the view matrix. ",
|
||||
"");
|
||||
I_Method0(const osg::Matrixd &, getViewMatrix,
|
||||
__C5_osg_Matrixd_R1__getViewMatrix,
|
||||
"Get the const view matrix. ",
|
||||
"");
|
||||
I_MethodWithDefaults4(void, getViewMatrixAsLookAt, IN, osg::Vec3 &, eye, , IN, osg::Vec3 &, center, , IN, osg::Vec3 &, up, , IN, float, lookDistance, 1.0f,
|
||||
__void__getViewMatrixAsLookAt__osg_Vec3_R1__osg_Vec3_R1__osg_Vec3_R1__float,
|
||||
"Get to the position and orientation of a modelview matrix, using the same convention as gluLookAt. ",
|
||||
"");
|
||||
I_Method0(osg::Matrixd, getInverseViewMatrix,
|
||||
__Matrixd__getInverseViewMatrix,
|
||||
"Get the inverse view matrix. ",
|
||||
"");
|
||||
I_Method1(bool, addCamera, IN, osg::CameraNode *, camera,
|
||||
__bool__addCamera__osg_CameraNode_P1,
|
||||
I_Method1(bool, addSlave, IN, osg::Camera *, camera,
|
||||
__bool__addSlave__osg_Camera_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method3(bool, addCamera, IN, osg::CameraNode *, camera, IN, const osg::Matrix &, projectionOffset, IN, const osg::Matrix &, viewOffse,
|
||||
__bool__addCamera__osg_CameraNode_P1__C5_osg_Matrix_R1__C5_osg_Matrix_R1,
|
||||
I_Method3(bool, addSlave, IN, osg::Camera *, camera, IN, const osg::Matrix &, projectionOffset, IN, const osg::Matrix &, viewOffse,
|
||||
__bool__addSlave__osg_Camera_P1__C5_osg_Matrix_R1__C5_osg_Matrix_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(bool, removeCamera, IN, unsigned int, pos,
|
||||
__bool__removeCamera__unsigned_int,
|
||||
I_Method1(bool, removeSlave, IN, unsigned int, pos,
|
||||
__bool__removeSlave__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method0(unsigned int, getNumCameras,
|
||||
__unsigned_int__getNumCameras,
|
||||
I_Method0(unsigned int, getNumSlaves,
|
||||
__unsigned_int__getNumSlaves,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::CameraNode *, getCamera, IN, unsigned int, pos,
|
||||
__CameraNode_P1__getCamera__unsigned_int,
|
||||
I_Method1(osg::View::Slave &, getSlave, IN, unsigned int, pos,
|
||||
__Slave_R1__getSlave__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(const osg::CameraNode *, getCamera, IN, unsigned int, pos,
|
||||
__C5_CameraNode_P1__getCamera__unsigned_int,
|
||||
I_Method1(const osg::View::Slave &, getSlave, IN, unsigned int, pos,
|
||||
__C5_Slave_R1__getSlave__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::View::CameraData &, getCameraData, IN, unsigned int, pos,
|
||||
__CameraData_R1__getCameraData__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(const osg::View::CameraData &, getCameraData, IN, unsigned int, pos,
|
||||
__C5_CameraData_R1__getCameraData__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method2(bool, computeLocalToWorldMatrix, IN, osg::Matrix &, matrix, IN, osg::NodeVisitor *, x,
|
||||
__bool__computeLocalToWorldMatrix__Matrix_R1__NodeVisitor_P1,
|
||||
"Transform method that must be defined to provide generic interface for scene graph traversals. ",
|
||||
"");
|
||||
I_Method2(bool, computeWorldToLocalMatrix, IN, osg::Matrix &, matrix, IN, osg::NodeVisitor *, x,
|
||||
__bool__computeWorldToLocalMatrix__Matrix_R1__NodeVisitor_P1,
|
||||
"Transform method that must be defined to provide generic interface for scene graph traversals. ",
|
||||
"");
|
||||
I_ArrayProperty(osg::CameraNode *, Camera,
|
||||
__CameraNode_P1__getCamera__unsigned_int,
|
||||
I_SimpleProperty(osg::Camera *, Camera,
|
||||
__osg_Camera_P1__getCamera,
|
||||
__void__setCamera__osg_Camera_P1);
|
||||
I_ArrayProperty(osg::View::Slave &, Slave,
|
||||
__Slave_R1__getSlave__unsigned_int,
|
||||
0,
|
||||
__unsigned_int__getNumCameras,
|
||||
__bool__addCamera__osg_CameraNode_P1,
|
||||
__unsigned_int__getNumSlaves,
|
||||
0,
|
||||
__bool__removeCamera__unsigned_int);
|
||||
I_SimpleProperty(osg::Matrixd, InverseViewMatrix,
|
||||
__Matrixd__getInverseViewMatrix,
|
||||
0);
|
||||
I_SimpleProperty(const osg::Matrixd &, ProjectionMatrix,
|
||||
__C5_osg_Matrixd_R1__getProjectionMatrix,
|
||||
__void__setProjectionMatrix__C5_osg_Matrixd_R1);
|
||||
I_SimpleProperty(const osg::Matrixd &, ViewMatrix,
|
||||
__C5_osg_Matrixd_R1__getViewMatrix,
|
||||
__void__setViewMatrix__C5_osg_Matrixd_R1);
|
||||
0,
|
||||
__bool__removeSlave__unsigned_int);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::View::CameraData)
|
||||
I_Constructor0(____CameraData,
|
||||
BEGIN_VALUE_REFLECTOR(osg::View::Slave)
|
||||
I_Constructor0(____Slave,
|
||||
"",
|
||||
"");
|
||||
I_Constructor3(IN, osg::CameraNode *, camera, IN, const osg::Matrixd &, projectionOffset, IN, const osg::Matrixd &, viewOffset,
|
||||
____CameraData__osg_CameraNode_P1__C5_osg_Matrixd_R1__C5_osg_Matrixd_R1,
|
||||
I_Constructor3(IN, osg::Camera *, camera, IN, const osg::Matrixd &, projectionOffset, IN, const osg::Matrixd &, viewOffset,
|
||||
____Slave__osg_Camera_P1__C5_osg_Matrixd_R1__C5_osg_Matrixd_R1,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, const osg::View::CameraData &, rhs,
|
||||
____CameraData__C5_CameraData_R1,
|
||||
I_Constructor1(IN, const osg::View::Slave &, rhs,
|
||||
____Slave__C5_Slave_R1,
|
||||
"",
|
||||
"");
|
||||
I_PublicMemberProperty(osg::ref_ptr< osg::CameraNode >, _camera);
|
||||
I_PublicMemberProperty(osg::ref_ptr< osg::Camera >, _camera);
|
||||
I_PublicMemberProperty(osg::Matrixd, _projectionOffset);
|
||||
I_PublicMemberProperty(osg::Matrixd, _viewOffset);
|
||||
END_REFLECTOR
|
||||
|
@ -76,13 +76,3 @@ BEGIN_OBJECT_REFLECTOR(osgGA::GUIEventHandler)
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osgGA::GUIEventHandlerVisitor)
|
||||
I_Constructor0(____GUIEventHandlerVisitor,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, visit, IN, osgGA::GUIEventHandler &, x,
|
||||
__void__visit__GUIEventHandler_R1,
|
||||
"",
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
||||
|
@ -10,7 +10,7 @@ CXXFILES =\
|
||||
Viewer.cpp\
|
||||
ViewerEventHandler.cpp\
|
||||
|
||||
LIBS += -losgProducer -losg -losgIntrospection -losgUtil -losgGA -losgDB -lProducer -losgGA -losgText $(GL_LIBS) $(OTHER_LIBS)
|
||||
LIBS += -losgProducer -losg -losgIntrospection -losgUtil -losgDB -lProducer -losgGA -losgText $(GL_LIBS) $(OTHER_LIBS)
|
||||
|
||||
OPTF = -O
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include <osg/Matrix>
|
||||
#include <osg/Node>
|
||||
#include <osg/Object>
|
||||
#include <osg/Polytope>
|
||||
#include <osg/RenderInfo>
|
||||
#include <osg/Vec4>
|
||||
#include <osgShadow/OccluderGeometry>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
@ -31,8 +33,6 @@ TYPE_NAME_ALIAS(std::vector< osg::Vec3 >, osgShadow::OccluderGeometry::Vec3List)
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< GLuint >, osgShadow::OccluderGeometry::UIntList);
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osgShadow::OccluderGeometry::Edge >, osgShadow::OccluderGeometry::EdgeList);
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgShadow::OccluderGeometry)
|
||||
I_BaseType(osg::Drawable);
|
||||
I_Constructor0(____OccluderGeometry,
|
||||
@ -70,6 +70,22 @@ BEGIN_OBJECT_REFLECTOR(osgShadow::OccluderGeometry)
|
||||
__void__computeOccluderGeometry__osg_Drawable_P1__osg_Matrix_P1__float,
|
||||
"Compute an occluder geometry containing the geometry in specified drawable. ",
|
||||
"");
|
||||
I_Method2(void, comptueShadowVolumeGeometry, IN, const osg::Vec4 &, lightpos, IN, osgShadow::ShadowVolumeGeometry &, svg,
|
||||
__void__comptueShadowVolumeGeometry__C5_osg_Vec4_R1__ShadowVolumeGeometry_R1,
|
||||
"Compute ShadowVolumeGeometry. ",
|
||||
"");
|
||||
I_Method1(void, setBoundingPolytope, IN, const osg::Polytope &, polytope,
|
||||
__void__setBoundingPolytope__C5_osg_Polytope_R1,
|
||||
"Set the bounding polytope of the OccluderGeometry. ",
|
||||
"");
|
||||
I_Method0(osg::Polytope &, getBoundingPolytope,
|
||||
__osg_Polytope_R1__getBoundingPolytope,
|
||||
"Get the bounding polytope of the OccluderGeometry. ",
|
||||
"");
|
||||
I_Method0(const osg::Polytope &, getBoundingPolytope,
|
||||
__C5_osg_Polytope_R1__getBoundingPolytope,
|
||||
"Get the const bounding polytope of the OccluderGeometry. ",
|
||||
"");
|
||||
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
|
||||
__void__drawImplementation__osg_RenderInfo_R1,
|
||||
"Render the occluder geometry. ",
|
||||
@ -78,23 +94,87 @@ BEGIN_OBJECT_REFLECTOR(osgShadow::OccluderGeometry)
|
||||
__osg_BoundingBox__computeBound,
|
||||
"Compute the bounding box around occluder geometry. ",
|
||||
"");
|
||||
I_MethodWithDefaults3(void, processGeometry, IN, osg::Drawable *, drawable, , IN, osg::Matrix *, matrix, 0, IN, float, sampleRatio, 1.0f,
|
||||
__void__processGeometry__osg_Drawable_P1__osg_Matrix_P1__float,
|
||||
"",
|
||||
"");
|
||||
I_SimpleProperty(const osg::Polytope &, BoundingPolytope,
|
||||
__C5_osg_Polytope_R1__getBoundingPolytope,
|
||||
__void__setBoundingPolytope__C5_osg_Polytope_R1);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osgShadow::OccluderGeometry::Edge)
|
||||
I_Constructor0(____Edge,
|
||||
TYPE_NAME_ALIAS(std::vector< osg::Vec3 >, osgShadow::ShadowVolumeGeometry::Vec3List);
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< GLuint >, osgShadow::ShadowVolumeGeometry::UIntList);
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osgShadow::ShadowVolumeGeometry)
|
||||
I_BaseType(osg::Drawable);
|
||||
I_Constructor0(____ShadowVolumeGeometry,
|
||||
"",
|
||||
"");
|
||||
I_Constructor4(IN, unsigned int, p1, IN, unsigned int, p2, IN, unsigned int, t1, IN, unsigned int, t2,
|
||||
____Edge__unsigned_int__unsigned_int__unsigned_int__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_PublicMemberProperty(unsigned int, _p1);
|
||||
I_PublicMemberProperty(unsigned int, _p2);
|
||||
I_PublicMemberProperty(unsigned int, _t1);
|
||||
I_PublicMemberProperty(unsigned int, _t2);
|
||||
I_ConstructorWithDefaults2(IN, const osgShadow::ShadowVolumeGeometry &, oc, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____ShadowVolumeGeometry__C5_ShadowVolumeGeometry_R1__C5_osg_CopyOp_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osg::Object *, cloneType,
|
||||
__Object_P1__cloneType,
|
||||
"Clone the type of an object, with Object* return type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
|
||||
__Object_P1__clone__C5_osg_CopyOp_R1,
|
||||
"Clone an object, with Object* return type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
|
||||
__bool__isSameKindAs__C5_osg_Object_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const char *, libraryName,
|
||||
__C5_char_P1__libraryName,
|
||||
"return the name of the object's library. ",
|
||||
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
|
||||
I_Method0(const char *, className,
|
||||
__C5_char_P1__className,
|
||||
"return the name of the object's class type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(void, setVertices, IN, const osgShadow::ShadowVolumeGeometry::Vec3List &, vertices,
|
||||
__void__setVertices__C5_Vec3List_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgShadow::ShadowVolumeGeometry::Vec3List &, getVertices,
|
||||
__Vec3List_R1__getVertices,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const osgShadow::ShadowVolumeGeometry::Vec3List &, getVertices,
|
||||
__C5_Vec3List_R1__getVertices,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setNormals, IN, const osgShadow::ShadowVolumeGeometry::Vec3List &, normals,
|
||||
__void__setNormals__C5_Vec3List_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osgShadow::ShadowVolumeGeometry::Vec3List &, getNormals,
|
||||
__Vec3List_R1__getNormals,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const osgShadow::ShadowVolumeGeometry::Vec3List &, getNormals,
|
||||
__C5_Vec3List_R1__getNormals,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, drawImplementation, IN, osg::RenderInfo &, renderInfo,
|
||||
__void__drawImplementation__osg_RenderInfo_R1,
|
||||
"Render the occluder geometry. ",
|
||||
"");
|
||||
I_Method0(osg::BoundingBox, computeBound,
|
||||
__osg_BoundingBox__computeBound,
|
||||
"Compute the bounding box around occluder geometry. ",
|
||||
"");
|
||||
I_SimpleProperty(const osgShadow::ShadowVolumeGeometry::Vec3List &, Normals,
|
||||
__C5_Vec3List_R1__getNormals,
|
||||
__void__setNormals__C5_Vec3List_R1);
|
||||
I_SimpleProperty(const osgShadow::ShadowVolumeGeometry::Vec3List &, Vertices,
|
||||
__C5_Vec3List_R1__getVertices,
|
||||
__void__setVertices__C5_Vec3List_R1);
|
||||
END_REFLECTOR
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< GLuint >);
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osgShadow::OccluderGeometry::Edge >);
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/Drawable>
|
||||
#include <osg/Matrix>
|
||||
@ -166,21 +166,21 @@ BEGIN_OBJECT_REFLECTOR(osgSim::ImpostorSprite)
|
||||
__osg_BoundingBox__computeBound,
|
||||
"Compute the bounding box around Drawables's geometry. ",
|
||||
"");
|
||||
I_Method1(void, setCameraNode, IN, osg::CameraNode *, camera,
|
||||
__void__setCameraNode__osg_CameraNode_P1,
|
||||
I_Method1(void, setCamera, IN, osg::Camera *, camera,
|
||||
__void__setCamera__osg_Camera_P1,
|
||||
"Set the camera node to use for pre rendering the impostor sprite's texture. ",
|
||||
"");
|
||||
I_Method0(osg::CameraNode *, getCameraNode,
|
||||
__osg_CameraNode_P1__getCameraNode,
|
||||
I_Method0(osg::Camera *, getCamera,
|
||||
__osg_Camera_P1__getCamera,
|
||||
"Get the camera node to use for pre rendering the impostor sprite's texture. ",
|
||||
"");
|
||||
I_Method0(const osg::CameraNode *, getCameraNode,
|
||||
__C5_osg_CameraNode_P1__getCameraNode,
|
||||
I_Method0(const osg::Camera *, getCamera,
|
||||
__C5_osg_Camera_P1__getCamera,
|
||||
"Get the const camera node to use for pre rendering the impostor sprite's texture. ",
|
||||
"");
|
||||
I_SimpleProperty(osg::CameraNode *, CameraNode,
|
||||
__osg_CameraNode_P1__getCameraNode,
|
||||
__void__setCameraNode__osg_CameraNode_P1);
|
||||
I_SimpleProperty(osg::Camera *, Camera,
|
||||
__osg_Camera_P1__getCamera,
|
||||
__void__setCamera__osg_Camera_P1);
|
||||
I_SimpleProperty(osg::Vec3 *, ControlCoords,
|
||||
__osg_Vec3_P1__getControlCoords,
|
||||
0);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/Node>
|
||||
#include <osg/NodeVisitor>
|
||||
@ -119,16 +119,16 @@ BEGIN_OBJECT_REFLECTOR(osgSim::OverlayNode)
|
||||
__unsigned_int__getOverlayTextureSizeHint,
|
||||
"Get the texture size hint. ",
|
||||
"");
|
||||
I_Method0(osg::CameraNode *, getCamera,
|
||||
__osg_CameraNode_P1__getCamera,
|
||||
I_Method0(osg::Camera *, getCamera,
|
||||
__osg_Camera_P1__getCamera,
|
||||
"Get the camera used to implement the render to texture of the overlay subgraph. ",
|
||||
"");
|
||||
I_Method0(const osg::CameraNode *, getCamera,
|
||||
__C5_osg_CameraNode_P1__getCamera,
|
||||
I_Method0(const osg::Camera *, getCamera,
|
||||
__C5_osg_Camera_P1__getCamera,
|
||||
"Get the const camera used to implement the render to texture of the overlay subgraph. ",
|
||||
"");
|
||||
I_SimpleProperty(osg::CameraNode *, Camera,
|
||||
__osg_CameraNode_P1__getCamera,
|
||||
I_SimpleProperty(osg::Camera *, Camera,
|
||||
__osg_Camera_P1__getCamera,
|
||||
0);
|
||||
I_SimpleProperty(bool, ContinuousUpdate,
|
||||
__bool__getContinuousUpdate,
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include <osg/Billboard>
|
||||
#include <osg/BoundingBox>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/ClearNode>
|
||||
#include <osg/ClipNode>
|
||||
#include <osg/Drawable>
|
||||
@ -124,8 +124,8 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::CullVisitor)
|
||||
__void__apply__osg_ClearNode_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::CameraNode &, node,
|
||||
__void__apply__osg_CameraNode_R1,
|
||||
I_Method1(void, apply, IN, osg::Camera &, node,
|
||||
__void__apply__osg_Camera_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::OccluderNode &, node,
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Billboard>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Drawable>
|
||||
#include <osg/Geode>
|
||||
#include <osg/Group>
|
||||
@ -280,8 +280,8 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::PickVisitor)
|
||||
__void__apply__osg_Projection_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::CameraNode &, camera,
|
||||
__void__apply__osg_CameraNode_R1,
|
||||
I_Method1(void, apply, IN, osg::Camera &, camera,
|
||||
__void__apply__osg_Camera_R1,
|
||||
"",
|
||||
"");
|
||||
END_REFLECTOR
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Billboard>
|
||||
#include <osg/CameraNode>
|
||||
#include <osg/Camera>
|
||||
#include <osg/Drawable>
|
||||
#include <osg/Geode>
|
||||
#include <osg/Group>
|
||||
@ -152,8 +152,8 @@ BEGIN_OBJECT_REFLECTOR(osgUtil::IntersectionVisitor)
|
||||
__void__apply__osg_Projection_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, apply, IN, osg::CameraNode &, camera,
|
||||
__void__apply__osg_CameraNode_R1,
|
||||
I_Method1(void, apply, IN, osg::Camera &, camera,
|
||||
__void__apply__osg_Camera_R1,
|
||||
"",
|
||||
"");
|
||||
I_SimpleProperty(osgUtil::Intersector *, Intersector,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user