OpenUT99-Plus
Unreal Engine 1, rebuilt from scratch
Loading...
Searching...
No Matches
scene.h
Go to the documentation of this file.
1// A map ready to draw: BSP surfaces batched by texture, player starts. No GL here (used by ut_mapview --check).
2#pragma once
3#include <cstdint>
4#include <string>
5#include <vector>
6
7#include "level.h"
8#include "lighting.h"
9#include "packages.h"
10#include "texture.h"
11
12namespace ut {
13
14struct Batch {
15 std::string texture; // "Package.Name" for logs
17 uint32_t flags = 0; // poly flags shared by the batch (masked, translucent, modulated, two-sided)
18 std::vector<Vertex> verts; // triangles, UE world coordinates, UVs in texture units
19};
20
21// Geometry rebuilt every frame (live actors of a running world): world-space triangles, drawn full bright.
22struct LiveBatch {
23 const Image* image = nullptr; // owned by the producer, stable while it lives
24 uint32_t flags = 0;
25 std::vector<Vertex> verts;
26};
27
28struct Spawn {
30 int32_t pitch = 0, yaw = 0; // UE rotator units, 65536 = full turn
31};
32
33struct Scene {
34 std::vector<Batch> batches;
35 Image lightmap; // atlas of all lightmaps, RGB = light / 2 (shader doubles it); texel (0, 0) = full bright
36 bool has_sky = false;
37 Vec3 sky_pos{}; // SkyZoneInfo location: FakeBackdrop surfaces show the level seen from here
38 std::vector<Spawn> starts;
39 size_t surfaces = 0, skipped = 0, missing_textures = 0;
40 size_t mesh_actors = 0; // actors drawn with a LodMesh (frame 0)
41};
42
43// Throws std::runtime_error if the map or its Level / Model cannot be read. mesh_actors = false leaves the map's mesh
44// actors out (a running world draws them live).
45Scene load_scene(PackageSet& set, const std::string& map, bool mesh_actors = true);
46
47} // namespace ut
Definition packages.h:16
Definition collision.cpp:7
Scene load_scene(PackageSet &set, const std::string &map, bool mesh_actors)
Definition scene.cpp:215
Definition scene.h:14
std::string texture
Definition scene.h:15
std::vector< Vertex > verts
Definition scene.h:18
uint32_t flags
Definition scene.h:17
Image image
Definition scene.h:16
Definition texture.h:10
Definition scene.h:22
std::vector< Vertex > verts
Definition scene.h:25
uint32_t flags
Definition scene.h:24
const Image * image
Definition scene.h:23
Definition scene.h:33
std::vector< Spawn > starts
Definition scene.h:38
bool has_sky
Definition scene.h:36
std::vector< Batch > batches
Definition scene.h:34
Image lightmap
Definition scene.h:35
Vec3 sky_pos
Definition scene.h:37
size_t skipped
Definition scene.h:39
size_t surfaces
Definition scene.h:39
size_t missing_textures
Definition scene.h:39
size_t mesh_actors
Definition scene.h:40
Definition scene.h:28
Vec3 pos
Definition scene.h:29
int32_t yaw
Definition scene.h:30
int32_t pitch
Definition scene.h:30
Definition upkg.h:66