DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandleView()

void DayZPlayer::HandleView ( )
inlineprotected

3rd person camera

См. определение в файле DayZPlayerImplement.c строка 1905

1906 {
1907 if (!IsAlive())
1908 {
1910 {
1911 ExitSights();
1912 }
1913 return;
1914 }
1915
1916 HumanInputController hic = GetInputController();
1917
1918 bool camChange = hic.CameraViewChanged();
1919
1920 if (IsRaised())
1921 {
1922 if (m_IsWeapon)
1923 {
1924 camChange = false;
1925 }
1926 }
1927
1929 if (GetGame().GetWorld().Is3rdPersonDisabled())
1930 {
1931 m_Camera3rdPerson = false;
1932 }
1933 else if (camChange)
1934 {
1936 }
1937
1938 // exits optics completely, comment to return to ADS
1940 ExitSights();
1941
1942 if (IsPlayerInStance(DayZPlayerConstants.STANCEMASK_RAISEDPRONE) && (m_CameraOptics || m_CameraIronsight))
1943 {
1944 SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN_BACK);
1946 }
1948 {
1949 SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN);
1951 }
1952
1953 if (hic.IsZoomToggle() && !m_MovementState.IsRaised())
1954 {
1956 if ((IsClimbingLadder() && Math.AbsInt(m_MovementState.m_iMovement) == 2) || (IsSwimming() && m_MovementState.m_iMovement == 3))
1957 {
1959 }
1960 else if (!IsClimbingLadder() && !IsSwimming() && !IsInVehicle())
1961 {
1962 float pSpeed;
1963 vector pLocalDirection;
1964 hic.GetMovement(pSpeed ,pLocalDirection);
1965
1966 if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT && pSpeed == 3)
1967 {
1969 }
1970 }
1971 }
1972 else
1973 {
1975 }
1976
1977 if (m_MovementState.IsRaisedInProne())
1978 {
1979 float headingAngle = MiscGameplayFunctions.GetHeadingAngle(this);
1980 float headingAngleDiffBlock = Math.AbsFloat(m_LastHeadingAngleBlock - headingAngle);
1981 float headingAngleDiffBlock2 = Math.AbsFloat(m_LastHeadingAngleBlock2 - headingAngle);
1982 float headingAngleDiff = 0.0;
1983
1984 if (m_LastHeadingAngle * headingAngle < 0.0)
1985 {
1986 headingAngleDiff = Math.AbsFloat(m_LastHeadingAngle + headingAngle);
1987 }
1988 else
1989 {
1990 headingAngleDiff = Math.AbsFloat(m_LastHeadingAngle - headingAngle);
1991 }
1992
1993 if (headingAngleDiff > 0.2)
1994 {
1995 int time = GetGame().GetTime();
1996
1997 float timefilterconstant = 400 - (headingAngleDiff * 100);
1998
1999 if (headingAngleDiffBlock > 0.8 && time - m_LastBackSoundTime > timefilterconstant)
2000 {
2001 float volume = headingAngleDiff / 0.5;
2002 if (volume > 1)
2003 {
2004 volume = 1;
2005 }
2006 if (volume < 0.25)
2007 {
2008 volume = 0.25;
2009 }
2010
2011 m_SoundOffset = headingAngleDiff / 2;
2012 if (m_SoundOffset > 0.25)
2013 {
2014 m_SoundOffset = 0.25;
2015 }
2016
2017 string soundSetName = "Cloth_Body_longmove_TShirt_Soundset";
2018
2019 string bodyClothName = "";
2020 EntityAI attachment = GetInventory().FindAttachment(InventorySlots.BODY);
2021 if (attachment)
2022 {
2023 bodyClothName = attachment.GetAttachmentSoundType();
2024 }
2025
2026 if (bodyClothName != "")
2027 {
2028 string path = "CfgSoundTables CfgAttachmentSoundTables Cloth_Body_Longmove_LookupTable";
2029 int soundCount = GetGame().ConfigGetChildrenCount(path);
2030
2031 for (int i = 0; i < soundCount; i++)
2032 {
2033 string name = "";
2035
2036 if (name == bodyClothName)
2037 {
2038 TStringArray stringArray = new TStringArray();
2039 GetGame().ConfigGetTextArray(path + " " + name + " soundSets", stringArray);
2040 soundSetName = stringArray.Get(0);
2041
2042 delete stringArray;
2043 }
2044 }
2045 }
2046
2047 SoundParams soundParams = new SoundParams(soundSetName);
2048 SoundObjectBuilder soundObjectBuilder = new SoundObjectBuilder(soundParams);
2049
2050 if (soundObjectBuilder != NULL)
2051 {
2052 SoundObject soundObject = soundObjectBuilder.BuildSoundObject();
2053
2054 if (soundObject != NULL)
2055 {
2056 soundObject.SetPosition(GetPosition());
2057
2058 AbstractWave wave = GetGame().GetSoundScene().Play3D(soundObject, soundObjectBuilder);
2059 wave.SetStartOffset(m_SoundOffset);
2060 wave.SetVolumeRelative(volume);
2061
2063 m_LastHeadingAngleBlock = headingAngle;
2064 }
2065 }
2066 }
2067
2068 if (headingAngleDiffBlock2 > 1.5 && time - m_LastBackSoundTime2 > (timefilterconstant * 2))
2069 {
2070 float volume2 = headingAngleDiff * 2;
2071 if (volume2 > 1)
2072 {
2073 volume2 = 1;
2074 }
2075
2076 m_SoundOffset = headingAngleDiff / 1.8;
2077 if (m_SoundOffset < 0.1)
2078 {
2079 m_SoundOffset = 0.1;
2080 }
2081 if (m_SoundOffset > 0.3)
2082 {
2083 m_SoundOffset = 0.3;
2084 }
2085
2086 string soundSetName2 = "walkProne_noHS_asphalt_ext_Char_SoundSet";
2087 string surfaceType = GetSurfaceType();
2088
2089 if (surfaceType != "")
2090 {
2091 string movementSurfaceType = "walkProne_" + surfaceType;
2092
2093 string path2 = "CfgSoundTables CfgStepSoundTables walkProne_noHS_Char_LookupTable";
2094 int soundCount2 = GetGame().ConfigGetChildrenCount(path2);
2095
2096 for (int i2 = 0; i2 < soundCount2; i2++)
2097 {
2098 string name2 = "";
2099 GetGame().ConfigGetChildName(path2, i2, name2);
2100
2101 if (name2 == movementSurfaceType)
2102 {
2103 TStringArray stringArray2 = new TStringArray();
2104 GetGame().ConfigGetTextArray(path2 + " " + name2 + " soundSets", stringArray2);
2105 soundSetName2 = stringArray2.Get(0);
2106
2107 delete stringArray2;
2108 }
2109 }
2110 }
2111
2112 SoundParams soundParams2 = new SoundParams(soundSetName2);
2113 SoundObjectBuilder soundObjectBuilder2 = new SoundObjectBuilder(soundParams2);
2114
2115 if (soundObjectBuilder2 != NULL)
2116 {
2117 SoundObject soundObject2 = soundObjectBuilder2.BuildSoundObject();
2118
2119 if (soundObject2 != NULL)
2120 {
2121 soundObject2.SetPosition(GetPosition());
2122
2123 AbstractWave wave2 = GetGame().GetSoundScene().Play3D(soundObject2, soundObjectBuilder2);
2124 wave2.SetStartOffset(m_SoundOffset);
2125 wave2.SetVolumeRelative(volume2);
2126
2128 m_LastHeadingAngleBlock2 = headingAngle;
2129 }
2130 }
2131 }
2132
2133 m_LastHeadingAngle = headingAngle;
2134 }
2135 }
2136 }
class LogManager EntityAI
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ECameraZoomType
Определения ECameraZoomType.c:2
string path
Определения OptionSelectorMultistate.c:142
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native AbstractSoundScene GetSoundScene()
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
bool m_Camera3rdPerson
Определения DayZPlayerImplement.c:133
bool m_CameraIronsight
Определения DayZPlayerImplement.c:139
bool m_CameraOpticsAimOverride
Определения DayZPlayerImplement.c:141
string GetSurfaceType(SurfaceAnimationBone limbType)
Определения DayZPlayerImplement.c:3137
float m_LastHeadingAngle
Определения DayZPlayerImplement.c:2140
bool m_IsWeapon
Определения DayZPlayerImplement.c:176
bool IsClimbingLadder()
Определения DayZPlayerImplement.c:486
float m_LastHeadingAngleBlock
Определения DayZPlayerImplement.c:2138
bool IsSwimming()
Определения DayZPlayerImplement.c:481
bool m_CameraOptics
Определения DayZPlayerImplement.c:140
void ExitSights()
Определения DayZPlayerImplement.c:411
float m_LastHeadingAngleBlock2
Определения DayZPlayerImplement.c:2139
bool IsInVehicle()
Определения DayZPlayerImplement.c:476
ref HumanMovementState m_MovementState
time step for gradual update of dead screen visibilibty up to full visbility [s]
Определения DayZPlayerImplement.c:116
int m_LastBackSoundTime
Определения DayZPlayerImplement.c:2141
bool m_LiftWeapon_player
Определения DayZPlayerImplement.c:158
int m_LastBackSoundTime2
Определения DayZPlayerImplement.c:2142
bool IsRaised()
Определения DayZPlayerImplement.c:3809
float m_SoundOffset
Определения DayZPlayerImplement.c:2143
ECameraZoomType m_CameraEyeZoomLevel
Определения DayZPlayerImplement.c:138
proto void GetMovement(out float pSpeed, out vector pLocalDirection)
returns pSpeed 0,1..2..3 (idle, walk, run, sprint), local normalized direction vector
proto native bool CameraViewChanged()
1st/3rd person camera view
proto native bool IsZoomToggle()
zooming toggle
proto native void SetVerticalMinimumAimLimit(float value)
sets vertical minimum aim limit for a player
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native bool IsPlayerInStance(int pStanceMask)
-------------— camera additiona functions ----------------------—
proto native CGame GetGame()
array< string > TStringArray
Определения EnScript.c:685
proto native AbstractWave Play3D(SoundObject soundObject, SoundObjectBuilder soundBuilder)
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
void AbstractWave()
Определения Sound.c:167
class SoundObject SoundParams(string name)
proto native void SetPosition(vector position)
Note: Sets the position locally if parented, retrieves globally with the sound offset.

Перекрестные ссылки Math::AbsFloat(), Math::AbsInt(), AbstractWave(), HumanInputController::CameraViewChanged(), CGame::ConfigGetChildName(), CGame::ConfigGetChildrenCount(), CGame::ConfigGetTextArray(), ExitSights(), GetGame(), HumanInputController::GetMovement(), GetPosition, CGame::GetSoundScene(), GetSurfaceType(), CGame::GetTime(), IsClimbingLadder(), IsInVehicle(), IsPlayerInStance(), IsRaised(), IsSwimming(), HumanInputController::IsZoomToggle(), m_Camera3rdPerson, m_CameraEyeZoomLevel, m_CameraIronsight, m_CameraOptics, m_CameraOpticsAimOverride, m_IsWeapon, m_LastBackSoundTime, m_LastBackSoundTime2, m_LastHeadingAngle, m_LastHeadingAngleBlock, m_LastHeadingAngleBlock2, m_LiftWeapon_player, m_MovementState, m_SoundOffset, name, path, AbstractSoundScene::Play3D(), SoundObject::SetPosition(), SetVerticalMinimumAimLimit(), SoundObjectBuilder() и SoundParams().

Используется в CommandHandler().