@@ -71,26 +71,25 @@ private ShadowUtil() {
7171 * Updates a points arrays with the frustum corners of the provided camera.
7272 *
7373 * @param viewCam the viewing Camera (not null, unaffected)
74- * @param points storage for the corner coordinates (not null, length ≥8,
75- * modified)
74+ * @param points storage for the corner coordinates (not null, length ≥8, modified)
7675 */
7776 public static void updateFrustumPoints2 (Camera viewCam , Vector3f [] points ) {
7877 int w = viewCam .getWidth ();
7978 int h = viewCam .getHeight ();
8079
8180 TempVars vars = TempVars .get ();
8281 Vector2f tempVec2 = vars .vect2d ;
83- Vector3f tempStore = vars .vect1 ;
8482
85- points [ 0 ]. set ( viewCam .getWorldCoordinates (tempVec2 .set (0 , 0 ), 0 , tempStore ) );
86- points [ 1 ]. set ( viewCam .getWorldCoordinates (tempVec2 .set (0 , h ), 0 , tempStore ) );
87- points [ 2 ]. set ( viewCam .getWorldCoordinates (tempVec2 .set (w , h ), 0 , tempStore ) );
88- points [ 3 ]. set ( viewCam .getWorldCoordinates (tempVec2 .set (w , 0 ), 0 , tempStore ) );
83+ viewCam .getWorldCoordinates (tempVec2 .set (0 , 0 ), 0 , points [ 0 ] );
84+ viewCam .getWorldCoordinates (tempVec2 .set (0 , h ), 0 , points [ 1 ] );
85+ viewCam .getWorldCoordinates (tempVec2 .set (w , h ), 0 , points [ 2 ] );
86+ viewCam .getWorldCoordinates (tempVec2 .set (w , 0 ), 0 , points [ 3 ] );
8987
90- points [4 ].set (viewCam .getWorldCoordinates (tempVec2 .set (0 , 0 ), 1 , tempStore ));
91- points [5 ].set (viewCam .getWorldCoordinates (tempVec2 .set (0 , h ), 1 , tempStore ));
92- points [6 ].set (viewCam .getWorldCoordinates (tempVec2 .set (w , h ), 1 , tempStore ));
93- points [7 ].set (viewCam .getWorldCoordinates (tempVec2 .set (w , 0 ), 1 , tempStore ));
88+ viewCam .getWorldCoordinates (tempVec2 .set (0 , 0 ), 1 , points [4 ]);
89+ viewCam .getWorldCoordinates (tempVec2 .set (0 , h ), 1 , points [5 ]);
90+ viewCam .getWorldCoordinates (tempVec2 .set (w , h ), 1 , points [6 ]);
91+ viewCam .getWorldCoordinates (tempVec2 .set (w , 0 ), 1 , points [7 ]);
92+
9493 vars .release ();
9594 }
9695
@@ -106,10 +105,10 @@ public static void updateFrustumPoints2(Camera viewCam, Vector3f[] points) {
106105 * @param points storage for the corner coordinates (not null, length ≥ 8, modified)
107106 */
108107 public static void updateFrustumPoints (Camera viewCam ,
109- float nearOverride ,
110- float farOverride ,
111- float scale ,
112- Vector3f [] points ) {
108+ float nearOverride ,
109+ float farOverride ,
110+ float scale ,
111+ Vector3f [] points ) {
113112
114113 TempVars vars = TempVars .get ();
115114
@@ -513,11 +512,11 @@ private void process(Spatial scene) {
513512 * @param shadowMapSize the size of each edge of the shadow map texture (in pixels), used for stabilization
514513 */
515514 public static void updateShadowCamera (ViewPort viewPort ,
516- GeometryList receivers ,
517- Camera shadowCam ,
518- Vector3f [] points ,
519- GeometryList splitOccluders ,
520- float shadowMapSize ) {
515+ GeometryList receivers ,
516+ Camera shadowCam ,
517+ Vector3f [] points ,
518+ GeometryList splitOccluders ,
519+ float shadowMapSize ) {
521520
522521 boolean ortho = shadowCam .isParallelProjection ();
523522
@@ -661,7 +660,7 @@ public static void updateShadowCamera(ViewPort viewPort,
661660 * @param outputGeometryList The list to which geometries within the camera frustum will be added (not null, modified)
662661 */
663662 public static void getGeometriesInCamFrustum (GeometryList inputGeometryList ,
664- Camera camera , GeometryList outputGeometryList ) {
663+ Camera camera , GeometryList outputGeometryList ) {
665664 int planeState = camera .getPlaneState ();
666665 for (int i = 0 ; i < inputGeometryList .size (); i ++) {
667666 Geometry g = inputGeometryList .get (i );
@@ -685,7 +684,7 @@ public static void getGeometriesInCamFrustum(GeometryList inputGeometryList,
685684 * @param outputGeometryList The list to which matching geometries within the camera frustum will be added (not null, modified)
686685 */
687686 public static void getGeometriesInCamFrustum (Spatial rootScene , Camera camera ,
688- RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
687+ RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
689688 if (rootScene instanceof Node ) {
690689 int planeState = camera .getPlaneState ();
691690 addGeometriesInCamFrustumFromNode (camera , (Node ) rootScene , mode , outputGeometryList );
@@ -728,7 +727,7 @@ private static boolean checkShadowMode(RenderQueue.ShadowMode shadowMode, Render
728727 * @param outputGeometryList The list to add matching geometries to (not null, modified)
729728 */
730729 private static void addGeometriesInCamFrustumFromNode (Camera camera , Node scene ,
731- RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
730+ RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
732731 if (scene .getCullHint () == Spatial .CullHint .Always ) {
733732 return ;
734733 }
@@ -762,7 +761,7 @@ else if (child instanceof Geometry && child.getCullHint() != Spatial.CullHint.Al
762761 * @param outputGeometryList The list to which geometries within the light's radius will be added (not null, modified)
763762 */
764763 public static void getGeometriesInLightRadius (GeometryList inputGeometryList ,
765- Camera [] cameras , GeometryList outputGeometryList ) {
764+ Camera [] cameras , GeometryList outputGeometryList ) {
766765 for (int i = 0 ; i < inputGeometryList .size (); i ++) {
767766 Geometry g = inputGeometryList .get (i );
768767 boolean inFrustum = false ;
@@ -796,7 +795,7 @@ public static void getGeometriesInLightRadius(GeometryList inputGeometryList,
796795 * @param outputGeometryList The list to which matching geometries will be added (not null, modified)
797796 */
798797 public static void getLitGeometriesInViewPort (Spatial rootScene , Camera vpCamera , Camera [] cameras ,
799- RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
798+ RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
800799 if (rootScene instanceof Node ) {
801800 addGeometriesInCamFrustumAndViewPortFromNode (vpCamera , cameras , rootScene , mode , outputGeometryList );
802801 }
@@ -813,7 +812,7 @@ public static void getLitGeometriesInViewPort(Spatial rootScene, Camera vpCamera
813812 * @param outputGeometryList The list to add matching geometries to (not null, modified)
814813 */
815814 private static void addGeometriesInCamFrustumAndViewPortFromNode (Camera vpCamera , Camera [] cameras ,
816- Spatial scene , RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
815+ Spatial scene , RenderQueue .ShadowMode mode , GeometryList outputGeometryList ) {
817816 if (scene .getCullHint () == Spatial .CullHint .Always ) {
818817 return ;
819818 }
0 commit comments