From aee3c96da30a77115f8774aa6de77f83f2e9a3c1 Mon Sep 17 00:00:00 2001 From: Austin Eng <213reeses@gmail.com> Date: Wed, 1 Feb 2017 12:23:48 -0500 Subject: [PATCH] add default plane distances for drawing if no splits created --- Source/Scene/DebugCameraPrimitive.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Scene/DebugCameraPrimitive.js b/Source/Scene/DebugCameraPrimitive.js index 3bec71974541..1e825629f570 100644 --- a/Source/Scene/DebugCameraPrimitive.js +++ b/Source/Scene/DebugCameraPrimitive.js @@ -105,7 +105,7 @@ define([ } var scratchColor = new Color(); - + var scratchSplits = [1.0, 100000.0]; /** * @private */ @@ -128,6 +128,10 @@ define([ var frustumSplits = frameState.frustumSplits; var numFrustums = frustumSplits.length - 1; + if (numFrustums <= 0) { + frustumSplits = scratchSplits; // plane distances if no splits have been created + numFrustums = 1; + } var positions = new Float64Array(3 * 4 * (numFrustums + 1)); var f;