If the car is in a private parking (let's say your driveway), but visible from a public place (the street), of from a neighbour's place (private also) it can be counted as indecent exposure.
If the car is in your backyard with opaque fences all around, who cares, no offence.
If there are no opaque barriers and the neibours spot you, you're toast. If your neibhour call the cops because he saw you doing wild stuff while he was sitting on his roof to spy at his neibhours, over the opaque barriers, you're safe because it would be hard to get any charges to stick without the peeping tom neibour getting charged also. Basically, If you can be seen by somebody who did nothing special to see you and you get cought, you're done.
If the car is in a public place where it's unlikely anybody will see you (industrial park at night, empty parking lot...), it will depends on the cop's mood because, if he's asking questions, somebody did see you, either him or someone else so, when a cop spot you, unless he's standing on the top of his car to see what you're doing, it doesn't matter if you are on private grounds or not, you can get charged. If a cop ask you to move, better not play smart and do so. You never know, the guy might be jealous he's not getting enough himself and might think the revenge is worth the trouble of filing a complaint! A surveillance camera operator spotting you is the same as somebody physically there, it doesn't matter if that camera is on top of a 50' poll, it's there and was there before you were doing your stuff so, it's not considered as unusual.
I've heard of charges dropped for "young adults" having fun in a car, late at night on a "belvedere", with other cars around obviously containing peoples doing the same things. They got saved because the car windows were all fogged-up so, nobody could see inside and identify what was happening, even if it was quite evident. If you can't be seen, there's no indecency going on!
From what I gather, as long as you make reasonnable efforts not to be seen, and are sucessfull, you're safe. (Duhh! to myself
) If you get spotted and the person can see what's happening, you can get charged. Visibility is the key, doesn't matter if you are inside the car, in your home, in the backyard, beside the car in a parking lot... Same goes: visibility. Think about it: you bang a girl in a hotel room with blinds open, you get charged. Same in a car, even if both are private place.
It did happen to a couple having wild fun at the hotel within the Toronto Skydome a few years ago, during a baseball game... The room was facing the interior of the stadium and the curtains were open... Amazing what can be done with a zoom TV lens... They did national TV and got fined on top of it! Dunno if the lady was the guy's wife?
This is only from experience, sorry I can't point to any legal content.