Cam tweaks

This commit is contained in:
He-Man 2018-05-13 21:49:57 +02:00
parent 1be153a001
commit a256e46965
2 changed files with 26 additions and 16 deletions

View File

@ -20,13 +20,16 @@ if (["CfgEpochClient", "BaseCamOnlyHome",true] call EPOCH_fnc_returnConfigEntryV
_mycams = _mycams select {!(((nearestobjects [_x,["Plotpole_EPOCH"],_buildingJammerRange]) select {(_x getVariable["BUILD_OWNER", "-1"]) in [getPlayerUID player, Epoch_my_GroupUID]}) isequalto [])};
};
if !(_mycams isequalto []) then {
_curcam = EPOCH_BaseCams find Epoch_ActiveCam;
_curcam = _mycams find Epoch_ActiveCam;
if (_curcam > -1 && (count _mycams) > (_curcam + 1)) then {
Epoch_ActiveCam = _mycams select (_curcam + 1);
}
else {
Epoch_ActiveCam = _mycams select 0;
};
}
else {
Epoch_ActiveCam = objnull;
};
if !(isnull (finddisplay -1200)) exitwith {};
@ -34,12 +37,13 @@ if (isnull Epoch_ActiveCam) exitwith {
["No Camera found",5] call Epoch_Message;
};
[] spawn {
private ["_display","_AutoCam","_ActiveCam","_campos","_CamFov","_CamDir","_CamDist","_EpochCam","_targetpos","_dirs","_intensity","_sharpness","_h","_oldalpha","_newalpha"];
_mycams spawn {
private ["_mycams","_display","_AutoCam","_ActiveCam","_campos","_CamFov","_CamDir","_CamDist","_EpochCam","_targetheight","_targetpos","_dirs","_intensity","_sharpness","_h","_oldalpha","_newalpha"];
_mycams = _this;
createdialog 'Epoch_CamDialog';
waituntil {!isnull finddisplay -1200};
_display = finddisplay -1200;
(_display displayctrl 1000) ctrlsettext format ["Cam %1",(EPOCH_BaseCams find Epoch_ActiveCam) + 1];
(_display displayctrl 1000) ctrlsettext format ["Cam %1",(_mycams find Epoch_ActiveCam) + 1];
(_display displayctrl 1001) ctrlsetstructuredtext parseText format [
"<t align='center' color='#FFFF00' size='1'>Controls:</t><br/><br/>Cam Up: %1<br/>Cam Down: %2<br/>Cam Left: %3<br/>Cam Right: %4<br/>Zoom In: %5<br/>Zoom Out: %6<br/><br/>AutoCam: %7<br/>NextCam: %8",
keyName Epoch_KB_BaseCamUp,keyName Epoch_KB_BaseCamDown,keyName Epoch_KB_BaseCamLeft,keyName Epoch_KB_BaseCamRight,keyName Epoch_KB_BaseCamZoomIn,keyName Epoch_KB_BaseCamZoomOut,keyName Epoch_KB_BaseCamAutoCam,keyName Epoch_KB_BaseCamNextCam
@ -60,17 +64,22 @@ if (isnull Epoch_ActiveCam) exitwith {
Epoch_CamFilmGrain ppEffectCommit 0;
_CamFov = 0.7;
_CamDir = 0;
_CamDist = 200;
_CamDist = 250;
_EpochCam = 'camera' camCreate _campos;
showCinemaBorder true;
_EpochCam cameraEffect ['internal', 'front'];
_EpochCam camCommit 0;
_targetheight = ((getposasl Epoch_ActiveCam) select 2)-50;
_targetpos = Epoch_ActiveCam getRelPos [_CamDist, 180+_CamDir];
_targetpos set [2,_targetheight];
if !(surfaceiswater _targetpos) then {
_targetpos = ASLtoATL _targetpos;
};
_EpochCam camSetTarget _targetpos;
_EpochCam camCommit 0;
_dirs = [5,10,15,20,25,30,35,40,45,40,35,30,25,20,15,10,5,0,-5,-10,-15,-20,-25,-30,-35,-40,-45,-40,-35,-30,-25,-20,-15,-10,-5,0];
while {!isnull _display} do {
Epoch_CamAdjust params ["_dir","_dist","_zoom"];
Epoch_CamAdjust params ["_dir","_height","_zoom"];
_AutoCam = Epoch_AutoCam;
if !(_ActiveCam isequalto Epoch_ActiveCam) then {
_ActiveCam = Epoch_ActiveCam;
@ -79,32 +88,33 @@ if (isnull Epoch_ActiveCam) exitwith {
_campos set [2,(getposatl Epoch_ActiveCam select 2)];
_CamFov = 0.7;
_CamDir = 0;
_CamDist = 200;
_EpochCam = 'camera' camCreate _campos;
showCinemaBorder true;
_EpochCam cameraEffect ['internal', 'front'];
_EpochCam camCommit 0;
_targetheight = ((getposasl Epoch_ActiveCam) select 2)-50;
_intensity = ((player distance Epoch_ActiveCam) / 10000) min 1;
_sharpness = 1.25 - _intensity;
Epoch_CamFilmGrain ppEffectAdjust [_intensity,_sharpness,2.01,0.75,1.0,true];
Epoch_CamFilmGrain ppEffectCommit 0;
(_display displayctrl 1000) ctrlsettext format ["Cam %1",(EPOCH_BaseCams find Epoch_ActiveCam) + 1];
(_display displayctrl 1000) ctrlsettext format ["Cam %1",(_mycams find Epoch_ActiveCam) + 1];
};
if !(Epoch_AutoCam) then {
_h = getposatl Epoch_ActiveCam select 2;
_oldalpha = atan (_h/_CamDist);
_newalpha = (_oldalpha + _dist) max 1;
_CamDist = _h/(tan _newalpha);
_targetheight = ((_targetheight + _height) min 50) max -150;
_CamDir = ((_CamDir + _dir) max -45) min 45;
_CamFov = ((_CamFov + _zoom) min 2) max 0.1;
}
else {
_CamDist = 200;
_targetheight = ((getposasl Epoch_ActiveCam) select 2)-50;
_CamFov = 0.7;
_CamDir = _dirs deleteat 0;
_dirs pushback _CamDir;
};
_targetpos = Epoch_ActiveCam getRelPos [_CamDist, 180+_CamDir];
_targetpos set [2,_targetheight];
if !(surfaceiswater _targetpos) then {
_targetpos = ASLtoATL _targetpos;
};
_EpochCam camSetTarget _targetpos;
_EpochCam camSetFov _CamFov;
_EpochCam camCommit 0.75;

View File

@ -303,7 +303,7 @@ if (!isnull (finddisplay -1200) && !isnull Epoch_ActiveCam) then {
Epoch_CamTrigger = diag_ticktime - 0.2;
};
if (diag_ticktime - Epoch_CamTrigger < 0.1) then {
_multi = 2;
_multi = 3;
};
Epoch_CamTrigger = diag_ticktime;
switch _dikCode do {
@ -320,11 +320,11 @@ if (!isnull (finddisplay -1200) && !isnull Epoch_ActiveCam) then {
};
case Epoch_KB_BaseCamUp: { /* Num 8 */
Epoch_AutoCam = false;
Epoch_CamAdjust = [0,-4*_multi,0];
Epoch_CamAdjust = [0,8*_multi,0];
};
case Epoch_KB_BaseCamDown: { /* Num 2 */
Epoch_AutoCam = false;
Epoch_CamAdjust = [0,4*_multi,0];
Epoch_CamAdjust = [0,-8*_multi,0];
};
case Epoch_KB_BaseCamZoomOut: { /* Num - */
Epoch_AutoCam = false;