nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
film.cc
Go to the documentation of this file.
1#include "tools/cinema/film.h"
2
3#include <raymath.h>
4
5#include <algorithm>
6#include <cmath>
7#include <string>
8#include <vector>
9
10#include "absl/strings/str_cat.h"
11#include "content/text.h"
12#include "terrain/lands.h"
13
14namespace nanommo::cinema {
15namespace {
16
17// The server's first world, whose seed each land adds its own to.
18constexpr uint32_t kWorldSeed = 1;
19// The lens when no key says.
20constexpr float kFov = 45.0f;
21// In metres a second, as the server's World moves players and monsters.
22constexpr float kWalkSpeed = 1.8f;
23constexpr float kRunSpeed = 3.1f;
24
25float Smooth(float s) { return s * s * (3.0f - 2.0f * s); }
26
27// From linear, at 0, to smoothed in and out, at 1.
28float Eased(float s, float ease) {
29 s = std::clamp(s, 0.0f, 1.0f);
30 return s + ease * (Smooth(s) - s);
31}
32
33// Through b at 0 and c at 1, curving as a and d say, so that a camera passing
34// through several keys turns smoothly at each.
35Vector3 CatmullRom(Vector3 a, Vector3 b, Vector3 c, Vector3 d, float u) {
36 const float u2 = u * u;
37 const float u3 = u2 * u;
38 const auto term = [&](float pa, float pb, float pc, float pd) {
39 return 0.5f * (2.0f * pb + (pc - pa) * u +
40 (2.0f * pa - 5.0f * pb + 4.0f * pc - pd) * u2 +
41 (3.0f * pb - pa - 3.0f * pc + pd) * u3);
42 };
43 return {term(a.x, b.x, c.x, d.x), term(a.y, b.y, c.y, d.y),
44 term(a.z, b.z, c.z, d.z)};
45}
46
47float Radians(float degrees) { return degrees * DEG2RAD; }
48
49Camera3D Lens(Vector3 eye, Vector3 look, float fov) {
50 return {.position = eye,
51 .target = look,
52 .up = {0.0f, 1.0f, 0.0f},
53 .fovy = fov,
54 .projection = CAMERA_PERSPECTIVE};
55}
56
57Camera3D Along(const google::protobuf::RepeatedPtrField<Key>& keys,
58 float seconds, float ease, const Terrain& terrain) {
59 // Each key's eye, look and lens, with what a key leaves out carried on.
60 std::vector<Vector3> eyes, looks;
61 std::vector<float> fovs, times;
62 for (const Key& key : keys) {
63 eyes.push_back(Place(key.eye(), terrain));
64 looks.push_back(key.has_look() ? Place(key.look(), terrain)
65 : looks.empty() ? Vector3Add(eyes.back(), {0, 0, 1})
66 : looks.back());
67 fovs.push_back(key.fov() > 0.0f ? key.fov()
68 : fovs.empty() ? kFov
69 : fovs.back());
70 times.push_back(key.at());
71 }
72 const int n = static_cast<int>(keys.size());
73 if (n == 1) {
74 return Lens(eyes[0], looks[0], fovs[0]);
75 }
76 // Eased over the whole path, so that it sets off and stops gently, rather
77 // than at each key.
78 const float first = times.front();
79 const float span = std::max(times.back() - first, 1e-3f);
80 const float t = first + span * Eased((seconds - first) / span, ease);
81 int i = 0;
82 while (i < n - 2 && t > times[i + 1]) {
83 ++i;
84 }
85 const float u = std::clamp(
86 (t - times[i]) / std::max(times[i + 1] - times[i], 1e-3f), 0.0f, 1.0f);
87 const auto curve = [&](const std::vector<Vector3>& p) {
88 return CatmullRom(p[std::max(i - 1, 0)], p[i], p[i + 1],
89 p[std::min(i + 2, n - 1)], u);
90 };
91 return Lens(curve(eyes), curve(looks), Lerp(fovs[i], fovs[i + 1], u));
92}
93
94Camera3D Round(const Orbit& orbit, float share, const Terrain& terrain) {
95 const Vector3 center = Place(orbit.center(), terrain);
96 const float angle = Radians(Lerp(orbit.from(), orbit.to(), share));
97 const Vector3 eye = {center.x + orbit.radius() * std::sin(angle),
98 center.y + orbit.up(),
99 center.z + orbit.radius() * std::cos(angle)};
100 return Lens(eye, center, orbit.fov() > 0.0f ? orbit.fov() : kFov);
101}
102
103// Where someone is, which way they face, and whether they're on their way
104// somewhere, at a moment of the game, after the legs they started by then.
105struct Spot {
106 Vector2 at;
107 float yaw = 0.0f;
108 protocol::Motion motion = protocol::MOTION_IDLE;
109};
110
111Spot Walked(const Point& start, float yaw,
112 const google::protobuf::RepeatedPtrField<Leg>& legs, float game) {
113 Spot spot{.at = {start.x(), start.z()}, .yaw = yaw};
114 // When they're free to set off on the next leg: once they've arrived from
115 // the one before.
116 float free = -1e9f;
117 for (const Leg& leg : legs) {
118 const float off = std::max(leg.at(), free);
119 if (game < off) {
120 break;
121 }
122 const Vector2 to = {leg.to().x(), leg.to().z()};
123 const Vector2 way = Vector2Subtract(to, spot.at);
124 const float distance = Vector2Length(way);
125 const float speed = leg.run() ? kRunSpeed : kWalkSpeed;
126 const float arrive = off + distance / speed;
127 if (distance > 1e-3f) {
128 spot.yaw = std::atan2(way.x, way.y);
129 }
130 if (game < arrive) {
131 spot.at = Vector2Lerp(spot.at, to, (game - off) / (arrive - off));
132 spot.motion = leg.run() ? protocol::MOTION_RUN : protocol::MOTION_WALK;
133 return spot;
134 }
135 spot.at = to;
136 free = arrive;
137 }
138 return spot;
139}
140
141} // namespace
142
143absl::StatusOr<Film> ReadFilm(const std::string& path) {
144 absl::StatusOr<std::string> text = ReadFile(path);
145 if (!text.ok()) {
146 return text.status();
147 }
148 Film film;
149 if (absl::Status parsed = ParseText(*text, film); !parsed.ok()) {
150 return absl::InvalidArgumentError(
151 absl::StrCat(path, ": ", parsed.message()));
152 }
153 for (const Shot& shot : film.shots()) {
154 if (!IsLand(shot.land())) {
155 return absl::InvalidArgumentError(
156 absl::StrCat(shot.id(), ": no land called ", shot.land()));
157 }
158 if (shot.camera().empty() && !shot.has_orbit() && !shot.has_shoulder()) {
159 return absl::InvalidArgumentError(absl::StrCat(
160 shot.id(), ": no camera keys, no orbit and no shoulder"));
161 }
162 if (shot.has_shoulder() &&
163 std::ranges::none_of(shot.players(), [&](const Player& p) {
164 return p.id() == shot.shoulder().player();
165 })) {
166 return absl::InvalidArgumentError(
167 absl::StrCat(shot.id(), ": no player ", shot.shoulder().player(),
168 " for the camera to look over"));
169 }
170 }
171 return film;
172}
173
174int LandOf(const Shot& shot) { return LandNamed(shot.land()); }
175
177 return Terrain(kWorldSeed + kLands[land].seed, kLands[land].wading);
178}
179
180float SpeedAt(const Shot& shot, float seconds) {
181 const auto& pace = shot.pace();
182 if (pace.empty()) {
183 return 1.0f;
184 }
185 if (seconds <= pace[0].at()) {
186 return pace[0].speed();
187 }
188 for (int i = 0; i + 1 < pace.size(); ++i) {
189 const Pace& from = pace[i];
190 const Pace& to = pace[i + 1];
191 if (seconds < to.at()) {
192 const float share = (seconds - from.at()) / (to.at() - from.at());
193 return Lerp(from.speed(), to.speed(), Smooth(share));
194 }
195 }
196 return pace[pace.size() - 1].speed();
197}
198
199float Clock::Advance(float seconds) {
200 // In small steps, as the pace can change within a frame.
201 constexpr int kSteps = 16;
202 const float step = seconds / kSteps;
203 float moved = 0.0f;
204 for (int i = 0; i < kSteps; ++i) {
205 moved += step * SpeedAt(shot_, film_ + (i + 0.5f) * step);
206 }
207 film_ += seconds;
208 game_ += moved;
209 return moved;
210}
211
212Vector3 Place(const Point& point, const Terrain& terrain) {
213 const float base =
214 point.sea() ? Terrain::kSeaLevel : terrain.Height(point.x(), point.z());
215 return {point.x(), base + point.up(), point.z()};
216}
217
218namespace {
219
220// The shoulder camera's player, as the shot places them, or none.
221const Player* Watcher(const Shot& shot) {
222 for (const Player& player : shot.players()) {
223 if (player.id() == shot.shoulder().player()) {
224 return &player;
225 }
226 }
227 return nullptr;
228}
229
230Camera3D OverShoulder(const Shot& shot, float share, bool tall,
231 const Terrain& terrain) {
232 const Shoulder& shoulder = shot.shoulder();
233 const Player* watcher = Watcher(shot);
234 const Vector3 feet =
235 watcher != nullptr ? Place(watcher->at(), terrain) : Vector3{};
236 const Vector3 look = Place(shoulder.look(), terrain);
237 const Vector3 forward =
238 Vector3Normalize({look.x - feet.x, 0.0f, look.z - feet.z});
239 // To their right, as they face what they watch.
240 const Vector3 right = {-forward.z, 0.0f, forward.x};
241 const float back = Lerp(shoulder.back(), shoulder.back_end(), share);
242 const Vector3 eye = {feet.x - forward.x * back + right.x * shoulder.side(),
243 feet.y + shoulder.up(),
244 feet.z - forward.z * back + right.z * shoulder.side()};
245 const float fov = tall && shoulder.tall_fov() > 0.0f ? shoulder.tall_fov()
246 : shoulder.fov() > 0.0f ? shoulder.fov()
247 : kFov;
248 return Lens(eye, look, fov);
249}
250
251} // namespace
252
253Camera3D CameraAt(const Shot& shot, float seconds, bool tall,
254 const Terrain& terrain) {
255 const float share = Eased(seconds / shot.seconds(), shot.ease());
256 if (shot.has_shoulder()) {
257 return OverShoulder(shot, share, tall, terrain);
258 }
259 if (tall && !shot.tall().empty()) {
260 return Along(shot.tall(), seconds, shot.ease(), terrain);
261 }
262 if (tall && shot.has_tall_orbit()) {
263 return Round(shot.tall_orbit(), share, terrain);
264 }
265 if (!shot.camera().empty()) {
266 return Along(shot.camera(), seconds, shot.ease(), terrain);
267 }
268 return Round(shot.orbit(), share, terrain);
269}
270
271Stage::Stage(const Shot& shot, const Content& content)
272 : shot_(shot), content_(content) {
273 for (const Monster& monster : shot.monsters()) {
274 foes_.push_back({.spec = monster,
275 .at = {monster.at().x(), monster.at().z()},
276 .yaw = Radians(monster.yaw()),
277 .hits = std::max(monster.hits(), 1u)});
278 }
279 // A pack spreads out like the seeds of a sunflower, each a golden angle
280 // round from the one before, and a little further out.
281 constexpr float kGolden = 2.39996f;
282 for (const Pack& pack : shot.packs()) {
283 for (uint32_t i = 0; i < pack.count(); ++i) {
284 const float out = pack.radius() * std::sqrt((i + 0.5f) / pack.count());
285 const float turn = kGolden * static_cast<float>(i);
286 Monster monster;
287 monster.set_id(pack.first() + i);
288 monster.set_kind(pack.kind());
289 monster.mutable_at()->set_x(pack.center().x() + out * std::sin(turn));
290 monster.mutable_at()->set_z(pack.center().z() + out * std::cos(turn));
291 monster.set_face(pack.face());
292 monster.set_yaw(pack.yaw());
293 monster.set_charge(pack.charge());
294 // Not all at once: each a little after the one inside it.
295 monster.set_charge_at(pack.charge_at() + 0.04f * static_cast<float>(i));
296 monster.set_hits(pack.hits());
297 monster.set_level(pack.level());
298 if (pack.dies() > 0.0f) {
299 monster.set_dies(pack.dies() + 0.13f * (i % 7));
300 }
301 foes_.push_back({.spec = monster,
302 .at = {monster.at().x(), monster.at().z()},
303 .yaw = Radians(pack.yaw()),
304 .hits = std::max(monster.hits(), 1u)});
305 }
306 }
307}
308
309Stage::Blow Stage::BlowOf(const Player& player, const Cast& cast) const {
310 const auto skill = content_.skills.by_id.find(cast.skill());
311 if (skill == content_.skills.by_id.end()) {
312 return {};
313 }
314 const skills::Effect& effect = skill->second.effect();
315 if (effect.weapon()) {
316 const auto item = content_.items.by_id.find(player.weapon());
317 if (item == content_.items.by_id.end()) {
318 return {};
319 }
320 const items::Weapon& weapon = item->second.weapon();
321 return {.lasts = weapon.swing_ms() / 1000.0f,
322 .lands = weapon.hit_ms() / 1000.0f,
323 .reach = weapon.reach()};
324 }
325 return {.lasts = effect.cast_ms() / 1000.0f,
326 .lands = effect.hit_ms() / 1000.0f,
327 .reach = effect.reach(),
328 .all = effect.all(),
329 .push = effect.push(),
330 .arc = effect.arc()};
331}
332
333Vector2 Stage::PlayerAt(int player, float game) const {
334 const Player& who = shot_.players(player);
335 return Walked(who.at(), Radians(who.yaw()), who.legs(), game).at;
336}
337
338void Stage::Land(int player, const Cast& cast, float game) {
339 const Player& who = shot_.players(player);
340 const Blow blow = BlowOf(who, cast);
341 if (blow.reach <= 0.0f) {
342 return;
343 }
344 const Vector2 from = PlayerAt(player, game);
345 const auto alive = [](const Foe& foe) { return !foe.fallen; };
346 std::vector<Foe*> hit;
347 if (blow.all) {
348 // Facing the target, if there's one, for a skill that hits a slice.
349 float facing = Radians(who.yaw());
350 for (const Foe& foe : foes_) {
351 if (foe.spec.id() == cast.target()) {
352 facing = std::atan2(foe.at.x - from.x, foe.at.y - from.y);
353 }
354 }
355 for (Foe& foe : foes_) {
356 const Vector2 way = Vector2Subtract(foe.at, from);
357 if (!alive(foe) || Vector2Length(way) > blow.reach) {
358 continue;
359 }
360 const float off =
361 std::remainder(std::atan2(way.x, way.y) - facing, 2.0f * PI);
362 if (blow.arc <= 0.0f || std::abs(off) <= Radians(blow.arc) / 2) {
363 hit.push_back(&foe);
364 }
365 }
366 } else {
367 // The target, or else the nearest in reach, with a little to spare, as a
368 // film's monsters don't stand where the server would let them.
369 Foe* target = nullptr;
370 Foe* nearest = nullptr;
371 float best = blow.reach + 1.0f;
372 for (Foe& foe : foes_) {
373 if (!alive(foe)) {
374 continue;
375 }
376 const float d = Vector2Distance(foe.at, from);
377 if (foe.spec.id() == cast.target() && d <= blow.reach + 2.0f) {
378 target = &foe;
379 }
380 if (d < best) {
381 best = d;
382 nearest = &foe;
383 }
384 }
385 if (Foe* struck = target != nullptr ? target : nearest) {
386 hit.push_back(struck);
387 }
388 }
389 for (Foe* foe : hit) {
390 foe->fallen = --foe->hits == 0;
391 if (blow.push > 0.0f) {
392 const Vector2 away = Vector2Normalize(Vector2Subtract(foe->at, from));
393 foe->pushed_from = foe->at;
394 foe->pushed_to = Vector2Add(foe->at, Vector2Scale(away, blow.push));
395 foe->pushed_at = game;
396 }
397 }
398}
399
400void Stage::Step(float from, float to) {
401 // The blows that land in the step.
402 for (int p = 0; p < shot_.players_size(); ++p) {
403 const Player& who = shot_.players(p);
404 for (const Cast& cast : who.casts()) {
405 const float lands = cast.at() + BlowOf(who, cast).lands;
406 if (lands > from && lands <= to) {
407 Land(p, cast, lands);
408 }
409 }
410 }
411 constexpr float kPushTime = 0.3f;
412 const float seconds = to - from;
413 for (Foe& foe : foes_) {
414 const Monster& spec = foe.spec;
415 if (spec.dies() > 0.0f && to >= spec.dies()) {
416 foe.fallen = true;
417 }
418 foe.motion = protocol::MOTION_IDLE;
419 if (foe.pushed_at >= 0.0f && to < foe.pushed_at + kPushTime) {
420 const float share = (to - foe.pushed_at) / kPushTime;
421 foe.at = Vector2Lerp(foe.pushed_from, foe.pushed_to,
422 1.0f - (1.0f - share) * (1.0f - share));
423 continue;
424 }
425 if (foe.fallen) {
426 continue;
427 }
428 if (!spec.legs().empty()) {
429 const Spot spot = Walked(spec.at(), Radians(spec.yaw()), spec.legs(), to);
430 foe.at = spot.at, foe.yaw = spot.yaw, foe.motion = spot.motion;
431 }
432 int chased = -1;
433 for (int p = 0; p < shot_.players_size(); ++p) {
434 if (shot_.players(p).id() == spec.charge() && to >= spec.charge_at()) {
435 chased = p;
436 }
437 if (shot_.players(p).id() == spec.face() && spec.legs().empty()) {
438 const Vector2 at = PlayerAt(p, to);
439 foe.yaw = std::atan2(at.x - foe.at.x, at.y - foe.at.y);
440 }
441 }
442 if (chased >= 0) {
443 const Vector2 at = PlayerAt(chased, to);
444 const Vector2 way = Vector2Subtract(at, foe.at);
445 const float distance = Vector2Length(way);
446 foe.yaw = std::atan2(way.x, way.y);
447 const auto kind = content_.monsters.kinds.find(spec.kind());
448 const float reach = kind != content_.monsters.kinds.end()
449 ? kind->second.fight().reach()
450 : 1.0f;
451 if (distance > reach) {
452 const float step = std::min(kRunSpeed * seconds, distance - reach);
453 foe.at = Vector2Add(foe.at, Vector2Scale(way, step / distance));
454 foe.motion = protocol::MOTION_RUN;
455 } else {
456 foe.motion = protocol::MOTION_ATTACK;
457 }
458 }
459 }
460 // Those standing don't stand in each other.
461 constexpr float kApart = 0.75f;
462 for (size_t i = 0; i < foes_.size(); ++i) {
463 for (size_t j = i + 1; j < foes_.size(); ++j) {
464 Foe& a = foes_[i];
465 Foe& b = foes_[j];
466 if (a.fallen || b.fallen) {
467 continue;
468 }
469 const Vector2 way = Vector2Subtract(b.at, a.at);
470 const float distance = Vector2Length(way);
471 if (distance < kApart && distance > 1e-4f) {
472 const Vector2 half =
473 Vector2Scale(way, 0.5f * (kApart - distance) / distance);
474 a.at = Vector2Subtract(a.at, half);
475 b.at = Vector2Add(b.at, half);
476 }
477 }
478 }
479}
480
481protocol::World Stage::At(float game) {
482 // In small steps, so that charges stop in reach and blows land in order.
483 constexpr float kStep = 1.0f / 120.0f;
484 while (now_ < game) {
485 const float to = std::min(game, now_ + kStep);
486 Step(now_, to);
487 now_ = to;
488 }
489
490 protocol::World world;
491 const int land = LandOf(shot_);
492 world.set_seed(kWorldSeed + kLands[land].seed);
493 world.set_land(land);
494 for (int i = 0; i < shot_.players_size(); ++i) {
495 const Player& who = shot_.players(i);
496 Spot spot = Walked(who.at(), Radians(who.yaw()), who.legs(), game);
497 protocol::Player* player = world.add_players();
498 player->set_id(who.id());
499 player->set_name(who.name());
500 const uint32_t level = who.level() > 0 ? who.level() : 10;
501 player->set_level(level);
502 // As the server's levels have it.
503 player->set_max_health(100 + 20 * (level - 1));
504 player->set_health(player->max_health());
505 player->set_weapon(who.weapon());
506 for (const uint32_t item : who.wearing()) {
507 player->add_wearing(item);
508 }
509 const auto facing = [&](uint32_t id) {
510 for (const Foe& foe : foes_) {
511 if (foe.spec.id() == id) {
512 spot.yaw = std::atan2(foe.at.x - spot.at.x, foe.at.y - spot.at.y);
513 }
514 }
515 };
516 if (spot.motion == protocol::MOTION_IDLE && who.face() != 0) {
517 facing(who.face());
518 }
519 // Whom the camera watches over, watching what it looks at.
520 if (spot.motion == protocol::MOTION_IDLE && shot_.has_shoulder() &&
521 shot_.shoulder().player() == who.id()) {
522 const Point& look = shot_.shoulder().look();
523 spot.yaw = std::atan2(look.x() - spot.at.x, look.z() - spot.at.y);
524 }
525 // The last skill they started, while it lasts.
526 uint32_t casts = 0;
527 for (const Cast& cast : who.casts()) {
528 if (cast.at() > game) {
529 continue;
530 }
531 ++casts;
532 if (game < cast.at() + BlowOf(who, cast).lasts) {
533 spot.motion = protocol::MOTION_SKILL;
534 player->set_skill(cast.skill());
535 player->set_target(cast.target());
536 facing(cast.target());
537 }
538 }
539 player->set_casts(casts);
540 player->set_x(spot.at.x);
541 player->set_z(spot.at.y);
542 player->set_yaw(spot.yaw);
543 player->set_motion(spot.motion);
544 }
545 if (shot_.players_size() > 0) {
546 world.set_you(shot_.players(0).id());
547 }
548 for (const Foe& foe : foes_) {
549 protocol::Monster* monster = world.add_monsters();
550 monster->set_id(foe.spec.id());
551 monster->set_kind(foe.spec.kind());
552 monster->set_level(foe.spec.level() > 0 ? foe.spec.level() : 5);
553 const auto kind = content_.monsters.kinds.find(foe.spec.kind());
554 const uint32_t health =
555 kind != content_.monsters.kinds.end() ? kind->second.max_health() : 80;
556 monster->set_max_health(health);
557 monster->set_health(foe.fallen ? 0 : health);
558 monster->set_x(foe.at.x);
559 monster->set_z(foe.at.y);
560 monster->set_yaw(foe.yaw);
561 monster->set_motion(foe.fallen ? protocol::MOTION_DEAD : foe.motion);
562 }
563 return world;
564}
565
566} // namespace nanommo::cinema
static constexpr float kSeaLevel
Definition terrain.h:50
float Height(float x, float z) const
On the triangles between the grid's corners, as the client draws them.
Definition terrain.cc:102
float Advance(float seconds)
Moves the film on by the seconds, and gives how far the game moved.
Definition film.cc:199
Stage(const Shot &shot, const Content &content)
Definition film.cc:271
protocol::World At(float game)
Definition film.cc:481
Camera3D CameraAt(const Shot &shot, float seconds, bool tall, const Terrain &terrain)
Definition film.cc:253
Vector3 Place(const Point &point, const Terrain &terrain)
Definition film.cc:212
float SpeedAt(const Shot &shot, float seconds)
How fast the game runs at that second of the shot.
Definition film.cc:180
int LandOf(const Shot &shot)
The land a shot is in, by its place in kLands.
Definition film.cc:174
Terrain TerrainOf(int land)
The land's terrain, as the server builds it for the first world.
Definition film.cc:176
absl::StatusOr< Film > ReadFilm(const std::string &path)
The shots in a text file, as the content files are written.
Definition film.cc:143
constexpr float kWalkSpeed
In tiles a second. A tile is a metre, and walking is the walk clip's speed.
Definition walking.h:9
constexpr std::chrono::milliseconds kPushTime
How long a blow's push takes, fast at first and slowing, as a shove does.
Definition world.h:136
int LandNamed(std::string_view name)
Its place in the list, or the first land's for a name that isn't there.
Definition lands.cc:10
absl::Status ParseText(std::string_view text, google::protobuf::Message &message)
Definition text.cc:32
constexpr std::array< Land, 3 > kLands
Definition lands.h:31
constexpr float kRunSpeed
Definition walking.h:10
float Eased(skills::Ease ease, float t)
Definition skills.cc:104
absl::StatusOr< std::string > ReadFile(const std::string &path)
Definition text.cc:43
Samples Step(Ground ground, uint32_t seed)
Definition foley.cc:122
bool IsLand(std::string_view name)
Definition lands.cc:19
Motion motion
Definition world.h:158
std::string name
Definition world.h:49
uint32_t casts
Definition world.h:105
float yaw
In radians, around the vertical. Zero faces along z, towards the camera.
Definition world.h:62