mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-07 18:42:36 +00:00
Added OrthographicCamera actor. Arguments are:
- 0: Offset. This pushes the camera further away, going behind the camera. Default is 1.0 (converted to negative - the value cannot go lower than that).
This commit is contained in:
parent
0fe2d72b75
commit
1620d405c6
2 changed files with 33 additions and 0 deletions
|
@ -78,6 +78,7 @@ DoomEdNums
|
|||
9081 = SkyPicker
|
||||
9082 = SectorSilencer
|
||||
9083 = SkyCamCompat
|
||||
9084 = OrthographicCamera
|
||||
9200 = Decal
|
||||
9300 = "$PolyAnchor"
|
||||
9301 = "$PolySpawn"
|
||||
|
|
|
@ -212,3 +212,35 @@ class SpectatorCamera : Actor
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Class OrthographicCamera : Actor
|
||||
{
|
||||
Default
|
||||
{
|
||||
+NOBLOCKMAP
|
||||
+NOINTERACTION
|
||||
CameraHeight 0;
|
||||
RenderStyle "None";
|
||||
}
|
||||
|
||||
override void PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
UpdateViewPos();
|
||||
}
|
||||
|
||||
override void Tick()
|
||||
{
|
||||
if (current != args[0])
|
||||
UpdateViewPos();
|
||||
|
||||
Super.Tick();
|
||||
}
|
||||
|
||||
private int current;
|
||||
private void UpdateViewPos()
|
||||
{
|
||||
current = args[0];
|
||||
SetViewPos((-abs(max(1.0, double(current))), 0, 0), VPSF_ORTHOGRAPHIC|VPSF_ALLOWOUTOFBOUNDS);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue