+ inside = (boundingSphere.w > Math::MACHINE_EPSILON_1000) &&
+ (camera.CheckSphereInFrustum(updateBufferIndex, Vector3(boundingSphere), boundingSphere.w));
+
+ if(inside && !isLayer3d && viewportSet)
+ {
+ nodeUpdateAreaUseHint = SetNodeUpdateArea(node, isLayer3d, nodeWorldMatrix, nodeSize, nodeUpdateArea);
+ nodeUpdateAreaSet = true;
+
+ const Vector3& scale = node->GetWorldScale(updateBufferIndex);
+ const Vector3& size = Vector3(nodeUpdateArea.z, nodeUpdateArea.w, 1.0f) * scale;
+
+ if(size.LengthSquared() > Math::MACHINE_EPSILON_1000)
+ {
+ MatrixUtils::Multiply(nodeModelViewMatrix, nodeWorldMatrix, viewMatrix);
+ nodeModelViewMatrixSet = true;
+
+ // Assume actors are at z=0, compute AABB in view space & test rect intersection
+ // against z=0 plane boundaries for frustum. (NOT viewport). This should take into account
+ // magnification due to FOV etc.
+ ClippingBox boundingBox = RenderItem::CalculateTransformSpaceAABB(nodeModelViewMatrix, Vector3(nodeUpdateArea.x, nodeUpdateArea.y, 0.0f), Vector3(nodeUpdateArea.z, nodeUpdateArea.w, 0.0f));
+ ClippingBox clippingBox(camera.mLeftClippingPlane, camera.mBottomClippingPlane, camera.mRightClippingPlane - camera.mLeftClippingPlane, fabsf(camera.mBottomClippingPlane - camera.mTopClippingPlane));
+ inside = clippingBox.Intersects(boundingBox);
+ }
+ }
+ /*
+ * Note, the API Camera::CheckAABBInFrustum() can be used to test if a bounding box is (partially/fully) inside the view frustum.
+ */