That's weird!
I had a doubt, so I checked the 409 code I've been using for a long time for headlight detection and activation.
And I have been using the sun for a long time: LocomotiveUSSR
public void TrainEffects(float f) {
if (danger()) {
hierMesh().chunkVisible("LocoLightFC", false); //Headlight
hierMesh().chunkVisible("LocoLightL", false);
hierMesh().chunkVisible("LocoLightR", false);
hierMesh().chunkVisible("TenderLightL", false); //Red rear light
} else if (((Tuple3f) (World.Sun().ToSun)).z > 0.01F) {
hierMesh().chunkVisible("LocoLightFC", false);
hierMesh().chunkVisible("LocoLightL", false);
hierMesh().chunkVisible("LocoLightR", false);
hierMesh().chunkVisible("TenderLightL", false);
} else if (((Tuple3f) (World.Sun().ToSun)).z > -0.22F) {
hierMesh().chunkVisible("LocoLightFC", false);
hierMesh().chunkVisible("LocoLightL", true);
hierMesh().chunkVisible("LocoLightR", true);
hierMesh().chunkVisible("TenderLightL", true);
} else {
hierMesh().chunkVisible("LocoLightFC", true);
hierMesh().chunkVisible("LocoLightL", true);
hierMesh().chunkVisible("LocoLightR", true);
hierMesh().chunkVisible("TenderLightL", true);
}
}
public void StopEffects() {
hierMesh().chunkVisible("LocoLightFC", false);
hierMesh().chunkVisible("LocoLightL", false);
hierMesh().chunkVisible("LocoLightR", false);
hierMesh().chunkVisible("TenderLightL", false);
}
On the other hand I do have a simple hazard detection at 1500m in all weathers!
Where does the code you refer to come from? BAT?