The charges against him are heinous, but disgraced MMA fighter War Machine’s antics in court, coupled with the sickening defense offered by his legal team, give the impression he’s not taking any of it seriously.

Prosecutors have alleged War Machine — born Jonathan Koppenhaver — brutally raped and bashed his ex-girlfriend, former adult film actor Christine Mackinday, 23, and choked and punched her friend Corey Thomas.

The allegations, dating back to May 2013 and culminating in a near-fatal attack in August last year, amount to 34 charges, including five counts of sexual assault and two of attempted murder. The world saw the results of his alleged frenzy of violence in photographs that Mackinday — better known as Christy Mack — posted to social media from her hospital bed.

But defense lawyer Brandon Sua attempted to undermine those charges as his trial opened this week by arguing that Mackinday’s line of work indicated consent and had instilled in her “the desire, the preference, the acceptability towards a particular form of sex activities that were outside of the norm.”

Sua said the pair had met while Mackinday was filming a pornographic movie and engaged in rough sex throughout their relationship. He told the Clark County District Court she had accused Koppenhaver of sexual assault in the past but had dropped charges rather than face a trial.

The defense ploy sparked a lengthy legal debate during which prosecutors argued that rape shield laws should limit the ability of defendants to introduce evidence of victims’ sexual history and prohibit the defense from revealing details of Mackinday’s movies to a jury, the Las Vegas Review-Journal reported.

“Because she consented to those acts through her course of employment does not mean the defendant is then entitled to think he can do that to her,” Chief Deputy District Attorney Jaqueline Bluth said. “You can’t make that leap.”

District Judge Elissa Cadish questioned whether pornography established consent.

“I don’t see how any of those activities that she did in adult movies would ever show her consent to the acts with the defendant that he’s charged with,” she said. “I’m not seeing that connection.”

However, the judge did ask Sua to submit a written motion detailing the sexual history between Koppenhaver and Mackinday.

While this legal exchange was under way — at the point where Sua raised Mackinday’s past and unpursued rape allegations against his client — Bluth interrupted to alert the court of inappropriate behavior by War Machine.

“Judge, for the record, Mr. Koppenhaver just blew a kiss at me,” she said, according to the Review-Journal.

Sua said he did not see it.

“I’m not going to make up that he blew a kiss at me, which I find offensive,” Bluth retorted.

Cadish then turned to address Koppenhaver, seated in the jury box, shackled and dressed in an orange jumpsuit.

“Mr. Koppenhaver, stop. You are not to make any gestures of any kind toward counsel. Don’t go there,” the judge said.

Koppenhaver smiled and replied, “Yes, ma’am.”

A police report tendered to the court described the full horror of Mackinday’s injuries and as well those allegedly inflicted on her friend Thomas, who was present during the alleged Aug. 8 incident.

They stated Koppenhaver attacked Mackinday and Thomas in her home near the Las Vegas National Golf Club.

Koppenhaver burst into the home and accused Mackinday of cheating on him before assaulting Thomas, the report said.

Police allege Koppenhaver choked and punched Thomas for nearly 10 minutes before telling him to leave and warning him not to call police.

The court heard Mackinday dialed 911 while Thomas was being attacked and then hid the mobile phone. Koppenhaver allegedly punched her as they went into a bathroom before he forced her to take a shower.

Mackinday sustained a “blowout” fracture to her left eye and numerous broken bones in her face, two missing teeth, a lacerated liver, broken ribs and serious bruising in several places.

Sua said text messages from Koppenhaver’s phone would call into question the validity of Mackinday’s statements.

He said text messages from the night of the alleged attack showed “ample evidence of (Mackinday) enticing Koppenhaver to come over that evening, ample evidence of her consenting to him being there.”

Prosecutors said they had no idea that Koppenhaver had kept the phone. The ex-Bellator MMA and Ultimate Fighting Championship fighter was arrested in California after going on the run for a week after the attack.

Cadish ordered Sua to turn the phone over to prosecutors by next week after Bluth said she needed to review all of the messages.

The defendant has legally changed his name to War Machine but was referred to as “Mr. Koppenhaver” in court.