Browse Source

avoid deprecated interface

David Rose 14 năm trước cách đây
mục cha
commit
9d40ea1184
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      direct/src/showbase/MirrorDemo.py

+ 4 - 3
direct/src/showbase/MirrorDemo.py

@@ -67,9 +67,10 @@ def setupMirror(name, width, height):
     # camera to reverse the direction of its face culling.  We also
     # camera to reverse the direction of its face culling.  We also
     # tell it not to draw (that is, to clip) anything behind the
     # tell it not to draw (that is, to clip) anything behind the
     # mirror plane.
     # mirror plane.
-    camera.setInitialState(RenderState.make(
-        CullFaceAttrib.makeReverse(),
-        ClipPlaneAttrib.make(ClipPlaneAttrib.OAdd, planeNode)))
+    dummy = NodePath('dummy')
+    dummy.setAttrib(CullFaceAttrib.makeReverse())
+    dummy.setClipPlane(planeNP)
+    camera.setInitialState(dummy.getState())
 
 
     # Create a visible representation of the camera so we can see it.
     # Create a visible representation of the camera so we can see it.
     #cameraVis = loader.loadModel('camera.egg')
     #cameraVis = loader.loadModel('camera.egg')