Here is a thought+data dump regarding getting the world-position of the ramp corners.
let top = cell_center_in_world_space + Vector3<i32>::new(0, -ramp_height, 0); // N
let right = cell_center_in_world_space + Vector3<i32>::new(ramp_height, 0, 0); // E
let bottom = cell_center_in_world_space + Vector3<i32>::new(0, ramp_height, 0); // S
let left = cell_center_in_world_space + Vector3<i32>::new(-ramp_height, 0, 0); // W
For each of those new world positions we'll need to add a vec3 with a z component for the associated corner on the particular tile.
Looking at the data we spit out from empires.dat I cannot come up with a way to create these associations automatically:
The first TerrainFrameData contains all of the flat frames.
All of the following are ramps, some of which contain duplicate image data (so we could perhaps make a small optimization here if necessary, but that makes this more complex than necessary).
match frame_index {
0..8 => flat,
9 => N,
10 => S,
11 => E,
12 => W,
13 => NE,
14 => SE,
15 => NW,
16 => SW,
17 => N,
18 => S,
19 => E,
20 => W,
21 => N,
22 => S,
23 => W,
24 => E,
}
Here is a thought+data dump regarding getting the world-position of the ramp corners.
For each of those new world positions we'll need to add a vec3 with a z component for the associated corner on the particular tile.
Looking at the data we spit out from
empires.dat
I cannot come up with a way to create these associations automatically:The first
TerrainFrameData
contains all of the flat frames. All of the following are ramps, some of which contain duplicate image data (so we could perhaps make a small optimization here if necessary, but that makes this more complex than necessary).ref #33