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

◆ DayZIntroScene()

void DayZIntroScene::DayZIntroScene ( )
inlineprotected

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

14 {
15 string root_path = "cfgCharacterScenes " + g_Game.GetWorldName();
16
17 int count = g_Game.ConfigGetChildrenCount(root_path);
18 int index = Math.RandomInt(0, count - 1);
19 string childName;
20 g_Game.ConfigGetChildName(root_path, index, childName);
21
22 string scene_path = root_path + " " + childName;
23 m_Target = SwapYZ(g_Game.ConfigGetVector(scene_path + " target"));
24 vector position = SwapYZ(g_Game.ConfigGetVector(scene_path + " position"));
25 TIntArray date = new TIntArray;
26 TFloatArray storm = new TFloatArray;
27 g_Game.ConfigGetIntArray(scene_path + " date", date);
28 float fov = g_Game.ConfigGetFloat(scene_path + " fov");
29 float overcast = g_Game.ConfigGetFloat(scene_path + " overcast");
30 float rain = g_Game.ConfigGetFloat(scene_path + " rain");
31 float snowfall = g_Game.ConfigGetFloat(scene_path + " snowfall");
32 float fog = g_Game.ConfigGetFloat(scene_path + " fog");
33 float windspeed = -1;
34 if ( g_Game.ConfigIsExisting(scene_path + " windspeed") ) windspeed = g_Game.ConfigGetFloat(scene_path + " windspeed");
35 g_Game.ConfigGetFloatArray(scene_path + " storm", storm);
36
37 World world = g_Game.GetWorld();
38
39 if (world && date.Count() >= 5)
40 {
41 world.SetDate(date.Get(0), date.Get(1), date.Get(2), date.Get(3), date.Get(4));
42 }
43
44 g_Game.ObjectDelete( m_Camera );
45 Class.CastTo(m_Camera, g_Game.CreateObject("staticcamera", SnapToGround(position), true)); //Vector(position[0] , position[1] + 1, position[2])
46
47 Math3D.MatrixIdentity4(m_CameraTrans);
48
49 if (m_Camera)
50 {
51 //m_Camera.SetPosition(Vector(m_Camera.GetPosition()[0],m_Camera.GetPosition()[1]+0,m_Camera.GetPosition()[2]));
52 m_Camera.LookAt(m_Target);
53 m_Camera.SetFOV(fov);
54 m_Camera.SetFocus(5.0, 0.0); //5.0, 1.0
55
56 m_Camera.SetActive(true);
57
58 Math3D.DirectionAndUpMatrix(m_Target - SnapToGround(position), "0 1 0", m_CameraTrans);
59 m_CameraTrans[3] = m_Camera.GetPosition();
60 m_CharacterPos = Vector(0.685547, -0.988281, 3.68823).Multiply4(m_CameraTrans);
61
62 float pos_x = m_CharacterPos[0];
63 float pos_z = m_CharacterPos[2];
64 float pos_y = g_Game.SurfaceY(pos_x, pos_z);
65 vector ground_demo_pos = Vector(pos_x, pos_y, pos_z);
66 m_CharacterPos = ground_demo_pos;
67
68 vector to_cam_dir = m_Camera.GetPosition() - m_CharacterPos;
69 m_CharacterRot[0] = Math.Atan2(to_cam_dir[0], to_cam_dir[2]) * Math.RAD2DEG;
70 }
71
72 m_Weather = g_Game.GetWeather();
73 m_Weather.GetOvercast().SetLimits( overcast, overcast );
74 m_Weather.GetRain().SetLimits( rain, rain );
75 m_Weather.GetSnowfall().SetLimits( snowfall, snowfall );
76 m_Weather.GetFog().SetLimits( fog, fog );
77
78 m_Weather.GetOvercast().Set( overcast, 0, 0);
79 m_Weather.GetRain().Set( rain, 0, 0);
80 m_Weather.GetSnowfall().Set( snowfall, 0, 0);
81 m_Weather.GetFog().Set( fog, 0, 0);
82
83 if ( storm.Count() == 3 )
84 {
85 m_Weather.SetStorm(storm.Get(0),storm.Get(1),storm.Get(2));
86 }
87
88 if ( windspeed != -1 )
89 {
90 m_Weather.SetWindSpeed(windspeed);
91 m_Weather.SetWindMaximumSpeed(windspeed);
92 m_Weather.SetWindFunctionParams(1,1,1);
93 }
94
96 m_Character.LoadCharacterData(m_CharacterPos, m_CharacterRot);
97
98 PPEffects.Init(); //Deprecated, left in for legacy purposes only
99
101 }
DayZGame g_Game
Определения DayZGame.c:3942
vector m_CharacterPos
Определения DayZIntroScene.c:6
vector SwapYZ(vector vec)
Определения DayZIntroScene.c:160
void SetInitPostprocesses()
Since this can get created at the same time as DayZGame, non-static postprocesses need to be deffered...
Определения DayZIntroScene.c:138
Weather m_Weather
Определения DayZIntroScene.c:8
Camera m_Camera
Определения DayZIntroScene.c:4
vector m_CameraTrans[4]
Определения DayZIntroScene.c:5
ref IntroSceneCharacter m_Character
Определения DayZIntroScene.c:3
vector m_CharacterRot
Определения DayZIntroScene.c:7
vector m_Target
Определения DayZIntroScene.c:9
vector SnapToGround(vector pos)
Определения DayZIntroScene.c:171
void IntroSceneCharacter()
Определения IntroSceneCharacter.c:19
proto native void SetDate(int year, int month, int day, int hour, int minute)
Sets actual ingame world time.
proto vector Multiply4(vector mat[4])
Transforms position.
array< float > TFloatArray
Определения EnScript.c:713
array< int > TIntArray
Определения EnScript.c:714
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
const int CALL_CATEGORY_GUI
Определения 3_Game/DayZ/tools/tools.c:9

Перекрестные ссылки Math::Atan2(), CALL_CATEGORY_GUI, Class::CastTo(), Math3D::DirectionAndUpMatrix(), g_Game, PPEffects::Init(), Managed::IntroSceneCharacter(), m_Camera, m_CameraTrans, m_Character, m_CharacterPos, m_CharacterRot, m_Target, m_Weather, Math3D::MatrixIdentity4(), vector::Multiply4(), Math::RAD2DEG, Math::RandomInt(), World::SetDate(), SetInitPostprocesses(), SnapToGround(), SwapYZ() и Vector().