Client: console command 'dev_sunpos' will now also report the sunangle and

pitch values for a light_environment entity.
This commit is contained in:
Marco Cawthorne 2021-07-02 13:43:58 +02:00
parent dc592c1deb
commit 3d236a64ed

View file

@ -683,13 +683,22 @@ CSQC_ConsoleCommand(string sCMD)
switch (argv(0)) {
case "dev_sunpos":
vector sunpos;
vector sunang;
vector sunpos, sunang;
vector lepos, leang;
makevectors(getproperty(VF_ANGLES));
sunpos = v_forward * -1;
sunang = vectoangles(sunpos);
makevectors(getproperty(VF_ANGLES));
lepos = v_forward * -1;
leang = vectoangles(lepos);
leang[1] -= 180;
leang[0] *= -1;
localcmd(sprintf("r_shadows_throwdirection %v\n", sunpos));
print(sprintf("env_sun: pitch: %d; angle: %d\n", -sunang[0], sunang[1]));
print(sprintf("light_environment: sunangle: %d; pitch: %d\n", leang[1], leang[0]));
break;
case "dev_measure":
static vector measurepos;