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

◆ HandleView()

void DayZPlayer::HandleView ( )
inlineprotected

3rd person camera

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

2003 {
2004 if (!IsAlive())
2005 {
2007 {
2008 ExitSights();
2009 }
2010 return;
2011 }
2012
2013 HumanInputController hic = GetInputController();
2014
2015 bool camChange = hic.CameraViewChanged();
2016
2017 if (IsRaised())
2018 {
2019 if (m_IsWeapon)
2020 {
2021 camChange = false;
2022 }
2023 }
2024
2026 if (g_Game.GetWorld().Is3rdPersonDisabled())
2027 {
2028 m_Camera3rdPerson = false;
2029 }
2030 else if (camChange)
2031 {
2033 }
2034
2035 // exits optics completely, comment to return to ADS
2037 ExitSights();
2038
2039 if (IsPlayerInStance(DayZPlayerConstants.STANCEMASK_RAISEDPRONE) && (m_CameraOptics || m_CameraIronsight))
2040 {
2041 SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN_BACK);
2043 }
2045 {
2046 SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN);
2048 }
2049
2050 if (hic.IsZoomToggle() && !m_MovementState.IsRaised())
2051 {
2053 if ((IsClimbingLadder() && Math.AbsInt(m_MovementState.m_iMovement) == 2) || (IsSwimming() && m_MovementState.m_iMovement == 3))
2054 {
2056 }
2057 else if (!IsClimbingLadder() && !IsSwimming() && !IsInVehicle())
2058 {
2059 float pSpeed;
2060 vector pLocalDirection;
2061 hic.GetMovement(pSpeed ,pLocalDirection);
2062
2063 if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT && pSpeed == 3)
2064 {
2066 }
2067 }
2068 }
2069 else
2070 {
2072 }
2073
2074 if (m_MovementState.IsRaisedInProne())
2075 {
2076 float headingAngle = MiscGameplayFunctions.GetHeadingAngle(this);
2077 float headingAngleDiffBlock = Math.AbsFloat(m_LastHeadingAngleBlock - headingAngle);
2078 float headingAngleDiffBlock2 = Math.AbsFloat(m_LastHeadingAngleBlock2 - headingAngle);
2079 float headingAngleDiff = 0.0;
2080
2081 if (m_LastHeadingAngle * headingAngle < 0.0)
2082 {
2083 headingAngleDiff = Math.AbsFloat(m_LastHeadingAngle + headingAngle);
2084 }
2085 else
2086 {
2087 headingAngleDiff = Math.AbsFloat(m_LastHeadingAngle - headingAngle);
2088 }
2089
2090 if (headingAngleDiff > 0.2)
2091 {
2092 int time = g_Game.GetTime();
2093
2094 float timefilterconstant = 400 - (headingAngleDiff * 100);
2095
2096 if (headingAngleDiffBlock > 0.8 && time - m_LastBackSoundTime > timefilterconstant)
2097 {
2098 float volume = headingAngleDiff / 0.5;
2099 if (volume > 1)
2100 {
2101 volume = 1;
2102 }
2103 if (volume < 0.25)
2104 {
2105 volume = 0.25;
2106 }
2107
2108 m_SoundOffset = headingAngleDiff / 2;
2109 if (m_SoundOffset > 0.25)
2110 {
2111 m_SoundOffset = 0.25;
2112 }
2113
2114 string soundSetName = "Cloth_Body_longmove_TShirt_Soundset";
2115
2116 string bodyClothName = "";
2117 EntityAI attachment = GetInventory().FindAttachment(InventorySlots.BODY);
2118 if (attachment)
2119 {
2120 bodyClothName = attachment.GetAttachmentSoundType();
2121 }
2122
2123 if (bodyClothName != "")
2124 {
2125 string path = "CfgSoundTables CfgAttachmentSoundTables Cloth_Body_Longmove_LookupTable";
2126 int soundCount = g_Game.ConfigGetChildrenCount(path);
2127
2128 for (int i = 0; i < soundCount; i++)
2129 {
2130 string name = "";
2131 g_Game.ConfigGetChildName(path, i, name);
2132
2133 if (name == bodyClothName)
2134 {
2135 TStringArray stringArray = new TStringArray();
2136 g_Game.ConfigGetTextArray(path + " " + name + " soundSets", stringArray);
2137 soundSetName = stringArray.Get(0);
2138
2139 delete stringArray;
2140 }
2141 }
2142 }
2143
2144 SoundParams soundParams = new SoundParams(soundSetName);
2145 SoundObjectBuilder soundObjectBuilder = new SoundObjectBuilder(soundParams);
2146
2147 if (soundObjectBuilder != NULL)
2148 {
2149 SoundObject soundObject = soundObjectBuilder.BuildSoundObject();
2150
2151 if (soundObject != NULL)
2152 {
2153 soundObject.SetPosition(GetPosition());
2154
2155 AbstractWave wave = g_Game.GetSoundScene().Play3D(soundObject, soundObjectBuilder);
2156 wave.SetStartOffset(m_SoundOffset);
2157 wave.SetVolumeRelative(volume);
2158
2159 m_LastBackSoundTime = g_Game.GetTime();
2160 m_LastHeadingAngleBlock = headingAngle;
2161 }
2162 }
2163 }
2164
2165 if (headingAngleDiffBlock2 > 1.5 && time - m_LastBackSoundTime2 > (timefilterconstant * 2))
2166 {
2167 float volume2 = headingAngleDiff * 2;
2168 if (volume2 > 1)
2169 {
2170 volume2 = 1;
2171 }
2172
2173 m_SoundOffset = headingAngleDiff / 1.8;
2174 if (m_SoundOffset < 0.1)
2175 {
2176 m_SoundOffset = 0.1;
2177 }
2178 if (m_SoundOffset > 0.3)
2179 {
2180 m_SoundOffset = 0.3;
2181 }
2182
2183 string soundSetName2 = "walkProne_noHS_asphalt_ext_Char_SoundSet";
2184 string surfaceType = GetSurfaceType();
2185
2186 if (surfaceType != "")
2187 {
2188 string movementSurfaceType = "walkProne_" + surfaceType;
2189
2190 string path2 = "CfgSoundTables CfgStepSoundTables walkProne_noHS_Char_LookupTable";
2191 int soundCount2 = g_Game.ConfigGetChildrenCount(path2);
2192
2193 for (int i2 = 0; i2 < soundCount2; i2++)
2194 {
2195 string name2 = "";
2196 g_Game.ConfigGetChildName(path2, i2, name2);
2197
2198 if (name2 == movementSurfaceType)
2199 {
2200 TStringArray stringArray2 = new TStringArray();
2201 g_Game.ConfigGetTextArray(path2 + " " + name2 + " soundSets", stringArray2);
2202 soundSetName2 = stringArray2.Get(0);
2203
2204 delete stringArray2;
2205 }
2206 }
2207 }
2208
2209 SoundParams soundParams2 = new SoundParams(soundSetName2);
2210 SoundObjectBuilder soundObjectBuilder2 = new SoundObjectBuilder(soundParams2);
2211
2212 if (soundObjectBuilder2 != NULL)
2213 {
2214 SoundObject soundObject2 = soundObjectBuilder2.BuildSoundObject();
2215
2216 if (soundObject2 != NULL)
2217 {
2218 soundObject2.SetPosition(GetPosition());
2219
2220 AbstractWave wave2 = g_Game.GetSoundScene().Play3D(soundObject2, soundObjectBuilder2);
2221 wave2.SetStartOffset(m_SoundOffset);
2222 wave2.SetVolumeRelative(volume2);
2223
2224 m_LastBackSoundTime2 = g_Game.GetTime();
2225 m_LastHeadingAngleBlock2 = headingAngle;
2226 }
2227 }
2228 }
2229
2230 m_LastHeadingAngle = headingAngle;
2231 }
2232 }
2233 }
class LogManager EntityAI
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:3942
ECameraZoomType
Определения ECameraZoomType.c:2
string path
Определения OptionSelectorMultistate.c:142
bool m_Camera3rdPerson
Определения DayZPlayerImplement.c:109
bool m_CameraIronsight
Определения DayZPlayerImplement.c:115
bool m_CameraOpticsAimOverride
Определения DayZPlayerImplement.c:117
bool IsWeaponObstructionBlockingADS()
string GetSurfaceType(SurfaceAnimationBone limbType)
Определения DayZPlayerImplement.c:3179
float m_LastHeadingAngle
Определения DayZPlayerImplement.c:2237
bool m_IsWeapon
Определения DayZPlayerImplement.c:154
bool IsClimbingLadder()
Определения DayZPlayerImplement.c:475
float m_LastHeadingAngleBlock
Определения DayZPlayerImplement.c:2235
bool IsSwimming()
Определения DayZPlayerImplement.c:470
bool m_CameraOptics
Определения DayZPlayerImplement.c:116
void ExitSights()
Определения DayZPlayerImplement.c:396
float m_LastHeadingAngleBlock2
Определения DayZPlayerImplement.c:2236
bool IsInVehicle()
Определения DayZPlayerImplement.c:465
ref HumanMovementState m_MovementState
time step for gradual update of dead screen visibilibty up to full visbility [s]
Определения DayZPlayerImplement.c:92
int m_LastBackSoundTime
Определения DayZPlayerImplement.c:2238
bool m_LiftWeapon_player
Определения DayZPlayerImplement.c:134
int m_LastBackSoundTime2
Определения DayZPlayerImplement.c:2239
bool IsRaised()
Определения DayZPlayerImplement.c:3861
float m_SoundOffset
Определения DayZPlayerImplement.c:2240
ECameraZoomType m_CameraEyeZoomLevel
Определения DayZPlayerImplement.c:114
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 ----------------------—
array< string > TStringArray
Определения EnScript.c:712
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473
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(), ExitSights(), g_Game, HumanInputController::GetMovement(), GetPosition(), GetSurfaceType(), IsClimbingLadder(), IsInVehicle(), IsPlayerInStance(), IsRaised(), IsSwimming(), IsWeaponObstructionBlockingADS(), 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, SoundObject::SetPosition(), SetVerticalMinimumAimLimit(), SoundObjectBuilder() и SoundParams().

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