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

◆ HandleView()

void DayZPlayer::HandleView ( )
inlineprotected

3rd person camera

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

2019 {
2020 if (!IsAlive())
2021 {
2023 {
2024 ExitSights();
2025 }
2026 return;
2027 }
2028
2029 HumanInputController hic = GetInputController();
2030
2031 bool camChange = hic.CameraViewChanged();
2032 int thirdPersonViewMode = g_Game.GetWorld().GetThirdPersonViewMode();
2033
2034 if (IsRaised())
2035 {
2036 if (m_IsWeapon)
2037 {
2038 camChange = false;
2039 }
2040 }
2041
2043 if (thirdPersonViewMode == ThirdPersonMode.DISABLED)
2044 {
2045 m_Camera3rdPerson = false;
2046 }
2047 else if (camChange)
2048 {
2050 }
2051
2052 // exits optics completely, comment to return to ADS
2054 ExitSights();
2055
2056 if (IsPlayerInStance(DayZPlayerConstants.STANCEMASK_RAISEDPRONE) && (m_CameraOptics || m_CameraIronsight))
2057 {
2058 SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN_BACK);
2060 }
2062 {
2063 SetVerticalMinimumAimLimit(DayZPlayerCameraIronsights.CONST_UD_MIN);
2065 }
2066
2067 if (hic.IsZoomToggle() && !m_MovementState.IsRaised())
2068 {
2070 if ((IsClimbingLadder() && Math.AbsInt(m_MovementState.m_iMovement) == 2) || (IsSwimming() && m_MovementState.m_iMovement == 3))
2071 {
2073 }
2074 else if (!IsClimbingLadder() && !IsSwimming() && !IsInVehicle())
2075 {
2076 float pSpeed;
2077 vector pLocalDirection;
2078 hic.GetMovement(pSpeed ,pLocalDirection);
2079
2080 if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT && pSpeed == 3)
2081 {
2083 }
2084 }
2085 }
2086 else
2087 {
2089 }
2090
2091 if (m_MovementState.IsRaisedInProne())
2092 {
2093 float headingAngle = MiscGameplayFunctions.GetHeadingAngle(this);
2094 float headingAngleDiffBlock = Math.AbsFloat(m_LastHeadingAngleBlock - headingAngle);
2095 float headingAngleDiffBlock2 = Math.AbsFloat(m_LastHeadingAngleBlock2 - headingAngle);
2096 float headingAngleDiff = 0.0;
2097
2098 if (m_LastHeadingAngle * headingAngle < 0.0)
2099 {
2100 headingAngleDiff = Math.AbsFloat(m_LastHeadingAngle + headingAngle);
2101 }
2102 else
2103 {
2104 headingAngleDiff = Math.AbsFloat(m_LastHeadingAngle - headingAngle);
2105 }
2106
2107 if (headingAngleDiff > 0.2)
2108 {
2109 int time = g_Game.GetTime();
2110
2111 float timefilterconstant = 400 - (headingAngleDiff * 100);
2112
2113 if (headingAngleDiffBlock > 0.8 && time - m_LastBackSoundTime > timefilterconstant)
2114 {
2115 float volume = headingAngleDiff / 0.5;
2116 if (volume > 1)
2117 {
2118 volume = 1;
2119 }
2120 if (volume < 0.25)
2121 {
2122 volume = 0.25;
2123 }
2124
2125 m_SoundOffset = headingAngleDiff / 2;
2126 if (m_SoundOffset > 0.25)
2127 {
2128 m_SoundOffset = 0.25;
2129 }
2130
2131 string soundSetName = "Cloth_Body_longmove_TShirt_Soundset";
2132
2133 string bodyClothName = "";
2134 EntityAI attachment = GetInventory().FindAttachment(InventorySlots.BODY);
2135 if (attachment)
2136 {
2137 bodyClothName = attachment.GetAttachmentSoundType();
2138 }
2139
2140 if (bodyClothName != "")
2141 {
2142 string path = "CfgSoundTables CfgAttachmentSoundTables Cloth_Body_Longmove_LookupTable";
2143 int soundCount = g_Game.ConfigGetChildrenCount(path);
2144
2145 for (int i = 0; i < soundCount; i++)
2146 {
2147 string name = "";
2148 g_Game.ConfigGetChildName(path, i, name);
2149
2150 if (name == bodyClothName)
2151 {
2152 TStringArray stringArray = new TStringArray();
2153 g_Game.ConfigGetTextArray(path + " " + name + " soundSets", stringArray);
2154 soundSetName = stringArray.Get(0);
2155
2156 delete stringArray;
2157 }
2158 }
2159 }
2160
2161 SoundParams soundParams = new SoundParams(soundSetName);
2162 SoundObjectBuilder soundObjectBuilder = new SoundObjectBuilder(soundParams);
2163
2164 if (soundObjectBuilder != NULL)
2165 {
2166 SoundObject soundObject = soundObjectBuilder.BuildSoundObject();
2167
2168 if (soundObject != NULL)
2169 {
2170 soundObject.SetPosition(GetPosition());
2171
2172 AbstractWave wave = g_Game.GetSoundScene().Play3D(soundObject, soundObjectBuilder);
2173 wave.SetStartOffset(m_SoundOffset);
2174 wave.SetVolumeRelative(volume);
2175
2176 m_LastBackSoundTime = g_Game.GetTime();
2177 m_LastHeadingAngleBlock = headingAngle;
2178 }
2179 }
2180 }
2181
2182 if (headingAngleDiffBlock2 > 1.5 && time - m_LastBackSoundTime2 > (timefilterconstant * 2))
2183 {
2184 float volume2 = headingAngleDiff * 2;
2185 if (volume2 > 1)
2186 {
2187 volume2 = 1;
2188 }
2189
2190 m_SoundOffset = headingAngleDiff / 1.8;
2191 if (m_SoundOffset < 0.1)
2192 {
2193 m_SoundOffset = 0.1;
2194 }
2195 if (m_SoundOffset > 0.3)
2196 {
2197 m_SoundOffset = 0.3;
2198 }
2199
2200 string soundSetName2 = "walkProne_noHS_asphalt_ext_Char_SoundSet";
2201 string surfaceType = GetSurfaceType();
2202
2203 if (surfaceType != "")
2204 {
2205 string movementSurfaceType = "walkProne_" + surfaceType;
2206
2207 string path2 = "CfgSoundTables CfgStepSoundTables walkProne_noHS_Char_LookupTable";
2208 int soundCount2 = g_Game.ConfigGetChildrenCount(path2);
2209
2210 for (int i2 = 0; i2 < soundCount2; i2++)
2211 {
2212 string name2 = "";
2213 g_Game.ConfigGetChildName(path2, i2, name2);
2214
2215 if (name2 == movementSurfaceType)
2216 {
2217 TStringArray stringArray2 = new TStringArray();
2218 g_Game.ConfigGetTextArray(path2 + " " + name2 + " soundSets", stringArray2);
2219 soundSetName2 = stringArray2.Get(0);
2220
2221 delete stringArray2;
2222 }
2223 }
2224 }
2225
2226 SoundParams soundParams2 = new SoundParams(soundSetName2);
2227 SoundObjectBuilder soundObjectBuilder2 = new SoundObjectBuilder(soundParams2);
2228
2229 if (soundObjectBuilder2 != NULL)
2230 {
2231 SoundObject soundObject2 = soundObjectBuilder2.BuildSoundObject();
2232
2233 if (soundObject2 != NULL)
2234 {
2235 soundObject2.SetPosition(GetPosition());
2236
2237 AbstractWave wave2 = g_Game.GetSoundScene().Play3D(soundObject2, soundObjectBuilder2);
2238 wave2.SetStartOffset(m_SoundOffset);
2239 wave2.SetVolumeRelative(volume2);
2240
2241 m_LastBackSoundTime2 = g_Game.GetTime();
2242 m_LastHeadingAngleBlock2 = headingAngle;
2243 }
2244 }
2245 }
2246
2247 m_LastHeadingAngle = headingAngle;
2248 }
2249 }
2250 }
class LogManager EntityAI
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:4074
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:4122
float m_LastHeadingAngle
Определения DayZPlayerImplement.c:2254
bool m_IsWeapon
Определения DayZPlayerImplement.c:155
bool IsClimbingLadder()
Определения DayZPlayerImplement.c:478
float m_LastHeadingAngleBlock
Определения DayZPlayerImplement.c:2252
bool IsSwimming()
Определения DayZPlayerImplement.c:473
bool m_CameraOptics
Определения DayZPlayerImplement.c:116
void ExitSights()
Определения DayZPlayerImplement.c:399
float m_LastHeadingAngleBlock2
Определения DayZPlayerImplement.c:2253
bool IsInVehicle()
Определения DayZPlayerImplement.c:468
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:2255
bool m_LiftWeapon_player
Определения DayZPlayerImplement.c:134
int m_LastBackSoundTime2
Определения DayZPlayerImplement.c:2256
bool IsRaised()
Определения DayZPlayerImplement.c:4005
float m_SoundOffset
Определения DayZPlayerImplement.c:2257
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 ----------------------—
class array< Class T > TStringArray
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.
proto string Get(int index)
Gets n-th character from string.
ThirdPersonMode
Определения World.c:302

Перекрестные ссылки Math::AbsFloat(), Math::AbsInt(), AbstractWave(), HumanInputController::CameraViewChanged(), ExitSights(), g_Game, string::Get(), 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() и TStringArray.

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