mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
rotation, better bottom bits
This commit is contained in:
parent
567b6535af
commit
0d1b9ee4f6
@ -118,6 +118,7 @@ impl Data {
|
|||||||
kind,
|
kind,
|
||||||
PlotKind::House(_)
|
PlotKind::House(_)
|
||||||
| PlotKind::Workshop(_)
|
| PlotKind::Workshop(_)
|
||||||
|
| PlotKind::AirshipDock(_)
|
||||||
| PlotKind::Plaza
|
| PlotKind::Plaza
|
||||||
| PlotKind::SavannahPit(_)
|
| PlotKind::SavannahPit(_)
|
||||||
| PlotKind::SavannahHut(_)
|
| PlotKind::SavannahHut(_)
|
||||||
|
@ -591,7 +591,7 @@ impl Site {
|
|||||||
(8.0, 3),
|
(8.0, 3),
|
||||||
(5.0, 4),
|
(5.0, 4),
|
||||||
(5.0, 5),
|
(5.0, 5),
|
||||||
(30.0, 6),
|
(15.0, 6),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let mut castles = 0;
|
let mut castles = 0;
|
||||||
|
@ -1,15 +1,17 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::Land;
|
use crate::{site2::gen::PrimitiveTransform, Land};
|
||||||
use common::terrain::{Block, BlockKind, SpriteKind};
|
use common::terrain::{Block, BlockKind, SpriteKind};
|
||||||
use rand::prelude::*;
|
use rand::prelude::*;
|
||||||
|
use std::f32::consts::PI;
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
/// Represents house data generated by the `generate()` method
|
/// Represents house data generated by the `generate()` method
|
||||||
pub struct AirshipDock {
|
pub struct AirshipDock {
|
||||||
/// Axis aligned bounding region for the house
|
/// Axis aligned bounding region for the house
|
||||||
bounds: Aabr<i32>,
|
bounds: Aabr<i32>,
|
||||||
/// Approximate altitude of the door tile
|
/// Approximate altitude of the door tile
|
||||||
pub(crate) alt: i32,
|
pub(crate) alt: i32,
|
||||||
|
rotation: f32,
|
||||||
|
pub door_tile: Vec2<i32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AirshipDock {
|
impl AirshipDock {
|
||||||
@ -21,14 +23,26 @@ impl AirshipDock {
|
|||||||
door_dir: Vec2<i32>,
|
door_dir: Vec2<i32>,
|
||||||
tile_aabr: Aabr<i32>,
|
tile_aabr: Aabr<i32>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
let door_tile_pos: Vec2<i32> = site.tile_center_wpos(door_tile);
|
||||||
let bounds = Aabr {
|
let bounds = Aabr {
|
||||||
min: site.tile_wpos(tile_aabr.min),
|
min: site.tile_wpos(tile_aabr.min),
|
||||||
max: site.tile_wpos(tile_aabr.max),
|
max: site.tile_wpos(tile_aabr.max),
|
||||||
};
|
};
|
||||||
|
let rotation = if door_dir.y < 0 {
|
||||||
|
PI
|
||||||
|
} else if door_dir.x < 0 {
|
||||||
|
PI / 2.0
|
||||||
|
} else if door_dir.y > 0 {
|
||||||
|
3.0 * PI / 2.0
|
||||||
|
} else {
|
||||||
|
0.0
|
||||||
|
};
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
door_tile: door_tile_pos,
|
||||||
bounds,
|
bounds,
|
||||||
alt: land.get_alt_approx(site.tile_center_wpos(door_tile + door_dir)) as i32,
|
alt: land.get_alt_approx(site.tile_center_wpos(door_tile + door_dir)) as i32,
|
||||||
|
rotation,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,23 +61,31 @@ impl Structure for AirshipDock {
|
|||||||
let center = self.bounds.center();
|
let center = self.bounds.center();
|
||||||
let height = base + 28;
|
let height = base + 28;
|
||||||
|
|
||||||
// Base
|
//rotation
|
||||||
|
|
||||||
|
//lower doorway
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.cylinder_with_radius(
|
||||||
min: (self.bounds.min + 1).with_z(base - 16),
|
Vec2::new(center.x - 1, center.y + 12).with_z(base - 5),
|
||||||
max: Vec2::new(self.bounds.max.x, self.bounds.max.y).with_z(base),
|
4.5,
|
||||||
})
|
7.0,
|
||||||
.fill(brick.clone());
|
)
|
||||||
|
.rotate_about_min(Mat3::new(1, 0, 0, 0, 0, -1, 0, 1, 0))
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(wood.clone());
|
||||||
|
|
||||||
//bracing
|
//bracing
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(height), 7.0, 7.0)
|
.cylinder_with_radius(center.with_z(height), 7.0, 7.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(height + 1), 7.0, 5.0)
|
.cylinder_with_radius(center.with_z(height + 1), 7.0, 5.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(height + 7), 8.0, 1.0)
|
.cylinder_with_radius(center.with_z(height + 7), 8.0, 1.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
|
|
||||||
//platform edging
|
//platform edging
|
||||||
@ -75,8 +97,9 @@ impl Structure for AirshipDock {
|
|||||||
},
|
},
|
||||||
5.0,
|
5.0,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(woodalt.clone());
|
.fill(woodalt.clone());
|
||||||
//platforrm
|
//platform
|
||||||
painter
|
painter
|
||||||
.superquadric(
|
.superquadric(
|
||||||
Aabb {
|
Aabb {
|
||||||
@ -85,6 +108,7 @@ impl Structure for AirshipDock {
|
|||||||
},
|
},
|
||||||
5.0,
|
5.0,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.superquadric(
|
.superquadric(
|
||||||
@ -94,6 +118,7 @@ impl Structure for AirshipDock {
|
|||||||
},
|
},
|
||||||
5.0,
|
5.0,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
//platform walkway bits
|
//platform walkway bits
|
||||||
painter
|
painter
|
||||||
@ -101,44 +126,87 @@ impl Structure for AirshipDock {
|
|||||||
min: Vec2::new(center.x - 2, center.y - 22).with_z(height + 8),
|
min: Vec2::new(center.x - 2, center.y - 22).with_z(height + 8),
|
||||||
max: Vec2::new(center.x + 2, center.y + 16).with_z(height + 10),
|
max: Vec2::new(center.x + 2, center.y + 16).with_z(height + 10),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(woodalt.clone());
|
.fill(woodalt.clone());
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x - 1, center.y - 22).with_z(height + 8),
|
min: Vec2::new(center.x - 1, center.y - 22).with_z(height + 8),
|
||||||
max: Vec2::new(center.x + 1, center.y + 16).with_z(height + 10),
|
max: Vec2::new(center.x + 1, center.y + 16).with_z(height + 10),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x - 2, center.y - 16).with_z(height + 9),
|
min: Vec2::new(center.x - 2, center.y - 16).with_z(height + 9),
|
||||||
max: Vec2::new(center.x + 2, center.y + 10).with_z(height + 10),
|
max: Vec2::new(center.x + 2, center.y + 10).with_z(height + 10),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x - 1, center.y - 22).with_z(height + 9),
|
min: Vec2::new(center.x - 1, center.y - 22).with_z(height + 9),
|
||||||
max: Vec2::new(center.x + 1, center.y + 16).with_z(height + 10),
|
max: Vec2::new(center.x + 1, center.y + 16).with_z(height + 10),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
|
|
||||||
//column
|
//column
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(base), 6.0, 45.0)
|
.cylinder_with_radius(center.with_z(base), 6.0, 45.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
//column thick bits
|
//column thick bits
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(base + 35), 7.0, 3.0)
|
.cylinder_with_radius(center.with_z(base + 35), 7.0, 3.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(base), 7.0, 1.0)
|
.cylinder_with_radius(center.with_z(base), 7.0, 1.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
|
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(base), 5.0, 45.0)
|
.cylinder_with_radius(center.with_z(base), 5.0, 45.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.clear();
|
||||||
|
//lower doorway cut
|
||||||
|
painter
|
||||||
|
.cylinder_with_radius(
|
||||||
|
Vec2::new(center.x - 1, center.y + 12).with_z(base - 5),
|
||||||
|
3.5,
|
||||||
|
7.0,
|
||||||
|
)
|
||||||
|
.rotate_about_min(Mat3::new(1, 0, 0, 0, 0, -1, 0, 1, 0))
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.clear();
|
||||||
|
// Base
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec2::new(center.x - 11, center.y - 11).with_z(base - 16),
|
||||||
|
max: Vec2::new(center.x + 11, center.y + 11).with_z(base),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(brick.clone());
|
||||||
|
|
||||||
|
//stair cut
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec2::new(center.x - 6, center.y + 9).with_z(base - 1),
|
||||||
|
max: Vec2::new(center.x + 4, center.y + 11).with_z(base),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.clear();
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec2::new(center.x - 5, center.y + 10).with_z(base - 2),
|
||||||
|
max: Vec2::new(center.x + 3, center.y + 11).with_z(base - 1),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
//cone
|
//cone
|
||||||
painter
|
painter
|
||||||
.cone_with_radius(center.with_z(base + 45), 8.0, 18.0)
|
.cone_with_radius(center.with_z(base + 45), 8.0, 18.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
//remove 1/4 cyl
|
//remove 1/4 cyl
|
||||||
painter
|
painter
|
||||||
@ -146,12 +214,14 @@ impl Structure for AirshipDock {
|
|||||||
min: Vec2::new(center.x - 1, center.y + 1).with_z(height + 9),
|
min: Vec2::new(center.x - 1, center.y + 1).with_z(height + 9),
|
||||||
max: Vec2::new(center.x + 6, center.y + 6).with_z(height + 17),
|
max: Vec2::new(center.x + 6, center.y + 6).with_z(height + 17),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x, center.y + 2).with_z(height + 9),
|
min: Vec2::new(center.x, center.y + 2).with_z(height + 9),
|
||||||
max: Vec2::new(center.x + 6, center.y + 7).with_z(height + 17),
|
max: Vec2::new(center.x + 6, center.y + 7).with_z(height + 17),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
//platform cleanup
|
//platform cleanup
|
||||||
painter
|
painter
|
||||||
@ -159,6 +229,7 @@ impl Structure for AirshipDock {
|
|||||||
min: Vec2::new(center.x - 2, center.y - 15).with_z(height + 8),
|
min: Vec2::new(center.x - 2, center.y - 15).with_z(height + 8),
|
||||||
max: Vec2::new(center.x + 6, center.y + 9).with_z(height + 9),
|
max: Vec2::new(center.x + 6, center.y + 9).with_z(height + 9),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
|
|
||||||
//upper door
|
//upper door
|
||||||
@ -167,30 +238,50 @@ impl Structure for AirshipDock {
|
|||||||
min: Vec2::new(center.x + 5, center.y - 2).with_z(height + 10),
|
min: Vec2::new(center.x + 5, center.y - 2).with_z(height + 10),
|
||||||
max: Vec2::new(center.x + 7, center.y + 2).with_z(height + 13),
|
max: Vec2::new(center.x + 7, center.y + 2).with_z(height + 13),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x + 5, center.y - 1).with_z(height + 10),
|
min: Vec2::new(center.x + 5, center.y - 1).with_z(height + 10),
|
||||||
max: Vec2::new(center.x + 7, center.y + 1).with_z(height + 15),
|
max: Vec2::new(center.x + 7, center.y + 1).with_z(height + 15),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x + 5, center.y - 1).with_z(height + 10),
|
min: Vec2::new(center.x + 5, center.y - 1).with_z(height + 10),
|
||||||
max: Vec2::new(center.x + 7, center.y + 1).with_z(height + 13),
|
max: Vec2::new(center.x + 7, center.y + 1).with_z(height + 13),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
//door sprites
|
//door sprites
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x + 6, center.y - 1).with_z(height + 10),
|
let door_rot = if self.rotation == 0.0 {
|
||||||
SpriteKind::Door,
|
(2, 6)
|
||||||
2,
|
} else if self.rotation == PI / 2.0 {
|
||||||
);
|
(4, 0)
|
||||||
painter.rotated_sprite(
|
} else if self.rotation == PI {
|
||||||
Vec2::new(center.x + 6, center.y).with_z(height + 10),
|
(6, 2) //good
|
||||||
SpriteKind::Door,
|
} else {
|
||||||
6,
|
(0, 4)
|
||||||
);
|
};
|
||||||
|
let sprite_fill = Fill::Block(Block::air(SpriteKind::Door).with_ori(door_rot.0).unwrap());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x + 6, center.y - 1, height + 10),
|
||||||
|
max: Vec3::new(center.x + 7, center.y + 0, height + 11),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
let sprite_fill = Fill::Block(Block::air(SpriteKind::Door).with_ori(door_rot.1).unwrap());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x + 6, center.y + 0, height + 10),
|
||||||
|
max: Vec3::new(center.x + 7, center.y + 1, height + 11),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
|
||||||
//bracing diagonal bits
|
//bracing diagonal bits
|
||||||
painter
|
painter
|
||||||
.line(
|
.line(
|
||||||
@ -198,6 +289,7 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x + 11, center.y - 3).with_z(height + 8),
|
Vec2::new(center.x + 11, center.y - 3).with_z(height + 8),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.line(
|
.line(
|
||||||
@ -205,6 +297,7 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x + 11, center.y + 2).with_z(height + 8),
|
Vec2::new(center.x + 11, center.y + 2).with_z(height + 8),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
//
|
//
|
||||||
painter
|
painter
|
||||||
@ -213,6 +306,7 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x - 6, center.y - 3).with_z(height),
|
Vec2::new(center.x - 6, center.y - 3).with_z(height),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.line(
|
.line(
|
||||||
@ -220,6 +314,7 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x - 6, center.y + 2).with_z(height),
|
Vec2::new(center.x - 6, center.y + 2).with_z(height),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
//
|
//
|
||||||
painter
|
painter
|
||||||
@ -228,6 +323,7 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x - 3, center.y - 6).with_z(height),
|
Vec2::new(center.x - 3, center.y - 6).with_z(height),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.line(
|
.line(
|
||||||
@ -235,6 +331,7 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x + 2, center.y - 6).with_z(height),
|
Vec2::new(center.x + 2, center.y - 6).with_z(height),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
//
|
//
|
||||||
painter
|
painter
|
||||||
@ -243,6 +340,7 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x - 3, center.y + 9).with_z(height + 7),
|
Vec2::new(center.x - 3, center.y + 9).with_z(height + 7),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.line(
|
.line(
|
||||||
@ -250,11 +348,13 @@ impl Structure for AirshipDock {
|
|||||||
Vec2::new(center.x + 2, center.y + 9).with_z(height + 7),
|
Vec2::new(center.x + 2, center.y + 9).with_z(height + 7),
|
||||||
0.8,
|
0.8,
|
||||||
)
|
)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
|
|
||||||
//stairs
|
//stairs
|
||||||
painter
|
painter
|
||||||
.cylinder_with_radius(center.with_z(height + 8), 5.0, 1.0)
|
.cylinder_with_radius(center.with_z(height + 8), 5.0, 1.0)
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
|
|
||||||
let stairs_clear1 = painter.cylinder_with_radius(center.with_z(base), 5.0, 38.0);
|
let stairs_clear1 = painter.cylinder_with_radius(center.with_z(base), 5.0, 38.0);
|
||||||
@ -264,7 +364,8 @@ impl Structure for AirshipDock {
|
|||||||
stairs_clear1,
|
stairs_clear1,
|
||||||
dungeon::spiral_staircase(center.with_z(base + 3), 6.0, 0.5, 9.0),
|
dungeon::spiral_staircase(center.with_z(base + 3), 6.0, 0.5, 9.0),
|
||||||
))
|
))
|
||||||
.fill(brick.clone());
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(wood.clone());
|
||||||
|
|
||||||
//clean up interface at top
|
//clean up interface at top
|
||||||
painter
|
painter
|
||||||
@ -272,101 +373,115 @@ impl Structure for AirshipDock {
|
|||||||
min: Vec2::new(center.x + 1, center.y + 3).with_z(height + 8),
|
min: Vec2::new(center.x + 1, center.y + 3).with_z(height + 8),
|
||||||
max: Vec2::new(center.x + 4, center.y + 5).with_z(height + 9),
|
max: Vec2::new(center.x + 4, center.y + 5).with_z(height + 9),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(wood.clone());
|
.fill(wood.clone());
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x + 0, center.y + 2).with_z(height + 9),
|
min: Vec2::new(center.x + 0, center.y + 2).with_z(height + 9),
|
||||||
max: Vec2::new(center.x + 6, center.y + 7).with_z(height + 10),
|
max: Vec2::new(center.x + 6, center.y + 7).with_z(height + 10),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x + 1, center.y + 3).with_z(height + 9),
|
min: Vec2::new(center.x + 1, center.y + 3).with_z(height + 9),
|
||||||
max: Vec2::new(center.x + 6, center.y + 7).with_z(height + 10),
|
max: Vec2::new(center.x + 6, center.y + 7).with_z(height + 10),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.clear();
|
.clear();
|
||||||
painter
|
painter
|
||||||
.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x + 0, center.y + 2).with_z(height + 9),
|
min: Vec2::new(center.x + 0, center.y + 2).with_z(height + 9),
|
||||||
max: Vec2::new(center.x + 1, center.y + 3).with_z(height + 17),
|
max: Vec2::new(center.x + 1, center.y + 3).with_z(height + 17),
|
||||||
})
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
.fill(brick.clone());
|
.fill(brick.clone());
|
||||||
//windows
|
//corner column
|
||||||
painter.fill(
|
painter
|
||||||
painter.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
|
min: Vec2::new(center.x + 0, center.y + 2).with_z(height + 9),
|
||||||
|
max: Vec2::new(center.x + 1, center.y + 3).with_z(height + 17),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(brick.clone());
|
||||||
|
|
||||||
|
let window_rot = if self.rotation == 0.0 || self.rotation == PI {
|
||||||
|
(2, 4)
|
||||||
|
} else {
|
||||||
|
(4, 2)
|
||||||
|
};
|
||||||
|
let sprite_fill = Fill::Block(
|
||||||
|
Block::air(SpriteKind::Window1)
|
||||||
|
.with_ori(window_rot.0)
|
||||||
|
.unwrap(),
|
||||||
|
);
|
||||||
|
//upper window
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x - 6, center.y - 1).with_z(height + 12),
|
min: Vec2::new(center.x - 6, center.y - 1).with_z(height + 12),
|
||||||
max: Vec2::new(center.x - 5, center.y + 1).with_z(height + 15),
|
max: Vec2::new(center.x - 5, center.y + 1).with_z(height + 15),
|
||||||
}),
|
})
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(2).unwrap()),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
|
|
||||||
//lower windows
|
//lower windows
|
||||||
painter.fill(
|
painter
|
||||||
painter.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x - 6, center.y - 1).with_z(base + 19),
|
min: Vec2::new(center.x - 6, center.y - 1).with_z(base + 19),
|
||||||
max: Vec2::new(center.x - 5, center.y + 1).with_z(base + 22),
|
max: Vec2::new(center.x - 5, center.y + 1).with_z(base + 22),
|
||||||
}),
|
})
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(2).unwrap()),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
painter.fill(
|
.aabb(Aabb {
|
||||||
painter.aabb(Aabb {
|
|
||||||
min: Vec2::new(center.x - 6, center.y - 1).with_z(base + 1),
|
min: Vec2::new(center.x - 6, center.y - 1).with_z(base + 1),
|
||||||
max: Vec2::new(center.x - 5, center.y + 1).with_z(base + 4),
|
max: Vec2::new(center.x - 5, center.y + 1).with_z(base + 4),
|
||||||
}),
|
})
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(2).unwrap()),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
painter.fill(
|
.aabb(Aabb {
|
||||||
painter.aabb(Aabb {
|
|
||||||
min: Vec2::new(center.x + 5, center.y - 1).with_z(base + 4),
|
min: Vec2::new(center.x + 5, center.y - 1).with_z(base + 4),
|
||||||
max: Vec2::new(center.x + 6, center.y + 1).with_z(base + 7),
|
max: Vec2::new(center.x + 6, center.y + 1).with_z(base + 7),
|
||||||
}),
|
})
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(2).unwrap()),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
painter.fill(
|
painter
|
||||||
painter.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x + 5, center.y - 1).with_z(base + 22),
|
min: Vec2::new(center.x + 5, center.y - 1).with_z(base + 22),
|
||||||
max: Vec2::new(center.x + 6, center.y + 1).with_z(base + 25),
|
max: Vec2::new(center.x + 6, center.y + 1).with_z(base + 25),
|
||||||
}),
|
})
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(2).unwrap()),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
painter.fill(
|
.aabb(Aabb {
|
||||||
painter.aabb(Aabb {
|
|
||||||
min: Vec2::new(center.x + 5, center.y - 1).with_z(base + 30),
|
min: Vec2::new(center.x + 5, center.y - 1).with_z(base + 30),
|
||||||
max: Vec2::new(center.x + 6, center.y + 1).with_z(base + 33),
|
max: Vec2::new(center.x + 6, center.y + 1).with_z(base + 33),
|
||||||
}),
|
})
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(2).unwrap()),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
|
||||||
|
let sprite_fill = Fill::Block(
|
||||||
|
Block::air(SpriteKind::Window1)
|
||||||
|
.with_ori(window_rot.1)
|
||||||
|
.unwrap(),
|
||||||
);
|
);
|
||||||
//side windows
|
//side windows
|
||||||
painter.fill(
|
painter
|
||||||
painter.aabb(Aabb {
|
.aabb(Aabb {
|
||||||
min: Vec2::new(center.x - 1, center.y + 5).with_z(base + 17),
|
min: Vec2::new(center.x - 1, center.y + 5).with_z(base + 17),
|
||||||
max: Vec2::new(center.x + 1, center.y + 6).with_z(base + 20),
|
max: Vec2::new(center.x + 1, center.y + 6).with_z(base + 20),
|
||||||
}),
|
})
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(4).unwrap()),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
painter.fill(
|
.aabb(Aabb {
|
||||||
painter.aabb(Aabb {
|
|
||||||
min: Vec2::new(center.x - 1, center.y - 6).with_z(base + 13),
|
min: Vec2::new(center.x - 1, center.y - 6).with_z(base + 13),
|
||||||
max: Vec2::new(center.x + 1, center.y - 5).with_z(base + 16),
|
max: Vec2::new(center.x + 1, center.y - 5).with_z(base + 16),
|
||||||
}),
|
|
||||||
Fill::Block(Block::air(SpriteKind::Window1).with_ori(4).unwrap()),
|
|
||||||
);
|
|
||||||
//lower doorway
|
|
||||||
painter
|
|
||||||
.aabb(Aabb {
|
|
||||||
min: Vec2::new(center.x - 4, center.y + 4).with_z(base + 0),
|
|
||||||
max: Vec2::new(center.x + 1, center.y + 7).with_z(base + 4),
|
|
||||||
})
|
})
|
||||||
.clear();
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
painter
|
.fill(sprite_fill.clone());
|
||||||
.aabb(Aabb {
|
|
||||||
min: Vec2::new(center.x - 4, center.y + 8).with_z(base),
|
|
||||||
max: Vec2::new(center.x + 1, center.y + 9).with_z(base + 1),
|
|
||||||
})
|
|
||||||
.clear();
|
|
||||||
//lights
|
//lights
|
||||||
painter.rotated_sprite(
|
painter.rotated_sprite(
|
||||||
Vec2::new(center.x - 3, center.y + 5).with_z(base + 8),
|
Vec2::new(center.x - 3, center.y + 5).with_z(base + 8),
|
||||||
@ -451,93 +566,133 @@ impl Structure for AirshipDock {
|
|||||||
);
|
);
|
||||||
//upper lighting
|
//upper lighting
|
||||||
|
|
||||||
painter.rotated_sprite(
|
let sprite_fill = Fill::Block(Block::air(SpriteKind::Lantern).with_ori(2).unwrap());
|
||||||
Vec2::new(center.x + 14, center.y + 8).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x + 14, center.y - 15).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x - 11, center.y + 8).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x - 11, center.y - 15).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
|
|
||||||
painter.rotated_sprite(
|
//on walkway lamps
|
||||||
Vec2::new(center.x + 4, center.y + 5).with_z(base + 44),
|
painter
|
||||||
SpriteKind::Lantern,
|
.aabb(Aabb {
|
||||||
6,
|
min: Vec3::new(center.x - 2, center.y + 15, height + 7),
|
||||||
);
|
max: Vec3::new(center.x - 1, center.y + 16, height + 8),
|
||||||
painter.rotated_sprite(
|
})
|
||||||
Vec2::new(center.x + 4, center.y - 5).with_z(base + 44),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
SpriteKind::Lantern,
|
.fill(sprite_fill.clone());
|
||||||
6,
|
painter
|
||||||
);
|
.aabb(Aabb {
|
||||||
painter.rotated_sprite(
|
min: Vec3::new(center.x + 1, center.y + 15, height + 7),
|
||||||
Vec2::new(center.x - 5, center.y + 4).with_z(base + 44),
|
max: Vec3::new(center.x + 2, center.y + 16, height + 8),
|
||||||
SpriteKind::Lantern,
|
})
|
||||||
6,
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
painter.rotated_sprite(
|
painter
|
||||||
Vec2::new(center.x - 5, center.y - 5).with_z(base + 44),
|
.aabb(Aabb {
|
||||||
SpriteKind::Lantern,
|
min: Vec3::new(center.x - 2, center.y - 21, height + 7),
|
||||||
6,
|
max: Vec3::new(center.x - 1, center.y - 22, height + 8),
|
||||||
);
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x + 1, center.y - 21, height + 7),
|
||||||
|
max: Vec3::new(center.x + 2, center.y - 22, height + 8),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
|
||||||
|
//on platform lamps
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x - 11, center.y + 8, height + 7),
|
||||||
|
max: Vec3::new(center.x - 10, center.y + 9, height + 8),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x + 14, center.y + 8, height + 7),
|
||||||
|
max: Vec3::new(center.x + 15, center.y + 9, height + 8),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x - 11, center.y - 15, height + 7),
|
||||||
|
max: Vec3::new(center.x - 10, center.y - 14, height + 8),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x + 14, center.y - 15, height + 7),
|
||||||
|
max: Vec3::new(center.x + 15, center.y - 14, height + 8),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
//on cone lamps
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x - 6, center.y + 5, height + 16),
|
||||||
|
max: Vec3::new(center.x - 5, center.y + 6, height + 17),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x + 5, center.y + 5, height + 16),
|
||||||
|
max: Vec3::new(center.x + 6, center.y + 6, height + 17),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x - 6, center.y - 6, height + 16),
|
||||||
|
max: Vec3::new(center.x - 5, center.y - 5, height + 17),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x + 5, center.y - 6, height + 16),
|
||||||
|
max: Vec3::new(center.x + 6, center.y - 5, height + 17),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x + 1, center.y + 15).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x + 1, center.y - 22).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x - 2, center.y + 15).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x - 2, center.y - 22).with_z(base + 35),
|
|
||||||
SpriteKind::Lantern,
|
|
||||||
6,
|
|
||||||
);
|
|
||||||
//interior
|
//interior
|
||||||
painter.rotated_sprite(
|
|
||||||
Vec2::new(center.x - 2, center.y - 3).with_z(base + 5),
|
painter
|
||||||
SpriteKind::Lantern,
|
.aabb(Aabb {
|
||||||
6,
|
min: Vec3::new(center.x - 2, center.y - 3, base + 6),
|
||||||
);
|
max: Vec3::new(center.x - 1, center.y + -2, base + 7),
|
||||||
painter.rotated_sprite(
|
})
|
||||||
Vec2::new(center.x - 2, center.y - 3).with_z(base + 15),
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
SpriteKind::Lantern,
|
.fill(sprite_fill.clone());
|
||||||
6,
|
painter
|
||||||
);
|
.aabb(Aabb {
|
||||||
painter.rotated_sprite(
|
min: Vec3::new(center.x - 2, center.y - 3, base + 15),
|
||||||
Vec2::new(center.x - 2, center.y - 3).with_z(base + 24),
|
max: Vec3::new(center.x - 1, center.y + -2, base + 16),
|
||||||
SpriteKind::Lantern,
|
})
|
||||||
6,
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
);
|
.fill(sprite_fill.clone());
|
||||||
painter.rotated_sprite(
|
painter
|
||||||
Vec2::new(center.x - 2, center.y - 3).with_z(base + 33),
|
.aabb(Aabb {
|
||||||
SpriteKind::Lantern,
|
min: Vec3::new(center.x - 2, center.y - 3, base + 24),
|
||||||
6,
|
max: Vec3::new(center.x - 1, center.y + -2, base + 25),
|
||||||
);
|
})
|
||||||
painter.rotated_sprite(
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
Vec2::new(center.x - 2, center.y - 3).with_z(base + 44),
|
.fill(sprite_fill.clone());
|
||||||
SpriteKind::Lantern,
|
painter
|
||||||
6,
|
.aabb(Aabb {
|
||||||
);
|
min: Vec3::new(center.x - 2, center.y - 3, base + 33),
|
||||||
|
max: Vec3::new(center.x - 1, center.y + -2, base + 34),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
|
painter
|
||||||
|
.aabb(Aabb {
|
||||||
|
min: Vec3::new(center.x - 2, center.y - 3, base + 44),
|
||||||
|
max: Vec3::new(center.x - 1, center.y + -2, base + 45),
|
||||||
|
})
|
||||||
|
.rotate_about(Mat3::rotation_z(self.rotation).as_(), center.with_z(base))
|
||||||
|
.fill(sprite_fill.clone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user