NBA

How J.R. Smith’s deal impacts the Knicks’ cap space in 2015

The Knicks were thrilled J.R. Smith accepted a four-year, $24.5 million guaranteed deal last July, offering him the most they could under the Early-Bird exception.

It was surprising hours later that Smith, coming off Sixth Man of the Year honors, came back to the Knicks and said he changed his mind. The flaky shooting guard wanted a three-year deal with an opt-out after two seasons to maximize his value.

That Smith opt-out next June looms large now as Knicks president Phil Jackson eyes his hefty cap space in 2015 to add more marquee players alongside Carmelo Anthony. Anthony agreed not to take his 7.5 percent pay raise in Year Two of his new deal, giving the Knicks $1.4 million more to play with.

Smith’s opt-out decision could greatly impact the Knicks’ future championship plans, increasing the amount of cap space they would have.

Smith had an inconsistent season, an awful start partly because he played tentatively after last summer’s knee surgery.

If Smith has a bounce-back season, he could be just cocky enough to opt out of the last year of his deal that would pay him $6.4 million.

If Smith opts out, the Knicks could have an estimated $32 million of space with the salary cap expected to rise to $66.5 million. Even with all the cap holds for the remaining roster spots, that room would be enough for a max player — Marc Gasol’s max is just $18.5 million because he’s coming off his rookie-extension contract — and another solid contributor in the $10 million range (Dwyane Wade?).

The only players on the books for 2015 are Anthony’s $22.9 million, Jose Calderon’s $7.4 million, Pablo Prigioni’s guaranteed portion $450,000 and Tim Hardaway’s $1.3 million. Figure the Knicks execute the team option on Shane Larkin’s $1.7 million.

If Smith opts in, however, the total cap space drops to $25.5 million, not the same “wiggle room,’’ as Jackson might say. A lot of roster spots need to be filled, including the Knicks’ 2015 first-round draft pick.

Smith opting out could benefit the club — even if it means him staying with the Knicks for a longer-term deal if he takes to the Zen Master and rookie coach Derek Fisher.

Smith appeared on the ESPN show “First Take’’ Wednesday and admitted in an honest interview that he was unfocused last season.

“I was playing like a person who didn’t want to be there, not looking as focused as a person who should be,” said Smith, who had a strong five weeks and finished averaging 14.5 points.

“I’m not going to make any excuses for myself, but knee surgery is a tough thing to come back from. I didn’t expect to be [back to] where I was.”

Smith, 28, still believes he has the talent to be an All-Star. If he moves in that direction in 2014-15, he might be untying shoelaces in another city.

“Extremely realistic,” the Knicks shooting guard said when asked how realistic it was the Knicks could win the East.

“I’m confident,” he said. “We’re in a great place. Melo is obviously the biggest piece to the puzzle. He’s the captain of the boat, and we’re just trying to turn the machine.”