sky_camera: Fix not taking different camera position vectors into account,
this broke by accident a few commits ago. Apologies.
This commit is contained in:
parent
ebdd55d397
commit
3d700a4fd7
3 changed files with 20 additions and 16 deletions
|
@ -166,7 +166,7 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
setproperty(VF_ENVMAP, "$whiteimage");
|
setproperty(VF_ENVMAP, "$whiteimage");
|
||||||
setproperty(VF_ORIGIN, g_vecCubePos);
|
setproperty(VF_ORIGIN, g_vecCubePos);
|
||||||
setproperty(VF_AFOV, 90);
|
setproperty(VF_AFOV, 90);
|
||||||
SkyCamera_Setup();
|
SkyCamera_Setup(g_vecCubePos);
|
||||||
renderscene();
|
renderscene();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ CSQC_UpdateView(float w, float h, float focus)
|
||||||
}
|
}
|
||||||
|
|
||||||
setproperty(VF_DRAWWORLD, 1);
|
setproperty(VF_DRAWWORLD, 1);
|
||||||
SkyCamera_Setup();
|
SkyCamera_Setup(getproperty(VF_ORIGIN));
|
||||||
|
|
||||||
/* draw the viewmodel in a second pass if desired */
|
/* draw the viewmodel in a second pass if desired */
|
||||||
if (autocvar_r_viewmodelpass) {
|
if (autocvar_r_viewmodelpass) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ View_Init(void)
|
||||||
pSeat->m_eViewModel.classname = "vm";
|
pSeat->m_eViewModel.classname = "vm";
|
||||||
pSeat->m_eViewModel.renderflags = RF_DEPTHHACK;
|
pSeat->m_eViewModel.renderflags = RF_DEPTHHACK;
|
||||||
pSeat->m_eViewModel.effects |= EF_NOSHADOW;
|
pSeat->m_eViewModel.effects |= EF_NOSHADOW;
|
||||||
|
|
||||||
pSeat->m_eMuzzleflash = spawn();
|
pSeat->m_eMuzzleflash = spawn();
|
||||||
pSeat->m_eMuzzleflash.classname = "mflash";
|
pSeat->m_eMuzzleflash.classname = "mflash";
|
||||||
pSeat->m_eMuzzleflash.renderflags = RF_ADDITIVE;
|
pSeat->m_eMuzzleflash.renderflags = RF_ADDITIVE;
|
||||||
|
@ -89,7 +89,6 @@ void
|
||||||
View_CalcBob(void)
|
View_CalcBob(void)
|
||||||
{
|
{
|
||||||
float cycle;
|
float cycle;
|
||||||
|
|
||||||
vector vel;
|
vector vel;
|
||||||
|
|
||||||
if (self.flags & FL_ONGROUND == -1) {
|
if (self.flags & FL_ONGROUND == -1) {
|
||||||
|
@ -133,7 +132,8 @@ Really convoluted function that makes the gun,
|
||||||
muzzleflash, dynamic lights and so on appear
|
muzzleflash, dynamic lights and so on appear
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void View_DrawViewModel(void)
|
void
|
||||||
|
View_DrawViewModel(void)
|
||||||
{
|
{
|
||||||
entity m_eViewModel = pSeat->m_eViewModel;
|
entity m_eViewModel = pSeat->m_eViewModel;
|
||||||
entity m_eMuzzleflash = pSeat->m_eMuzzleflash;
|
entity m_eMuzzleflash = pSeat->m_eMuzzleflash;
|
||||||
|
@ -207,7 +207,8 @@ void View_DrawViewModel(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void View_PostDraw(void)
|
void
|
||||||
|
View_PostDraw(void)
|
||||||
{
|
{
|
||||||
entity m_eMuzzleflash = pSeat->m_eMuzzleflash;
|
entity m_eMuzzleflash = pSeat->m_eMuzzleflash;
|
||||||
|
|
||||||
|
@ -217,7 +218,8 @@ void View_PostDraw(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void View_Stairsmooth(void)
|
void
|
||||||
|
View_Stairsmooth(void)
|
||||||
{
|
{
|
||||||
vector currentpos = pSeat->m_vecPredictedOrigin;
|
vector currentpos = pSeat->m_vecPredictedOrigin;
|
||||||
vector endpos = currentpos;
|
vector endpos = currentpos;
|
||||||
|
@ -253,14 +255,16 @@ Resets the timeline and plays a new sequence
|
||||||
onto the view model
|
onto the view model
|
||||||
====================
|
====================
|
||||||
*/
|
*/
|
||||||
void View_PlayAnimation(int iSequence)
|
void
|
||||||
|
View_PlayAnimation(int iSequence)
|
||||||
{
|
{
|
||||||
pSeat->m_eViewModel.frame = (float)iSequence;
|
pSeat->m_eViewModel.frame = (float)iSequence;
|
||||||
player pl = (player)pSeat->m_ePlayer;
|
player pl = (player)pSeat->m_ePlayer;
|
||||||
pl.weapontime = 0.0f;
|
pl.weapontime = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
int View_GetAnimation(void)
|
int
|
||||||
|
View_GetAnimation(void)
|
||||||
{
|
{
|
||||||
return pSeat->m_eViewModel.frame;
|
return pSeat->m_eViewModel.frame;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,20 +62,20 @@ sky_camera::sky_camera(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SkyCamera_Setup(void)
|
SkyCamera_Setup(vector org)
|
||||||
{
|
{
|
||||||
if (g_skyscale != 0 && g_skypos) {
|
if (g_skyscale != 0 && g_skypos) {
|
||||||
vector porg;
|
vector porg;
|
||||||
vector realpos;
|
vector realpos;
|
||||||
|
|
||||||
if (autocvar_dev_skyscale) {
|
if (autocvar_dev_skyscale) {
|
||||||
realpos[0] = g_vecCubePos[0] / autocvar_dev_skyscale;
|
realpos[0] = org[0] / autocvar_dev_skyscale;
|
||||||
realpos[1] = g_vecCubePos[1] / autocvar_dev_skyscale;
|
realpos[1] = org[1] / autocvar_dev_skyscale;
|
||||||
realpos[2] = g_vecCubePos[2] / autocvar_dev_skyscale;
|
realpos[2] = org[2] / autocvar_dev_skyscale;
|
||||||
} else {
|
} else {
|
||||||
realpos[0] = g_vecCubePos[0] / g_skyscale;
|
realpos[0] = org[0] / g_skyscale;
|
||||||
realpos[1] = g_vecCubePos[1] / g_skyscale;
|
realpos[1] = org[1] / g_skyscale;
|
||||||
realpos[2] = g_vecCubePos[2] / g_skyscale;
|
realpos[2] = org[2] / g_skyscale;
|
||||||
}
|
}
|
||||||
setproperty(VF_SKYROOM_CAMERA, g_skypos + realpos);
|
setproperty(VF_SKYROOM_CAMERA, g_skypos + realpos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue