Skip to content

Commit 863bd87

Browse files
committed
Update genmesh, obj and image versions
1 parent 748774f commit 863bd87

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ bitflags = "1"
2727
cgmath = { version = "0.16", features = ["mint"] }
2828
derivative = "1.0"
2929
froggy = "0.4.4"
30-
genmesh = "0.5"
30+
genmesh = "0.6"
3131
gfx = "0.17.1"
3232
gfx_glyph = "0.13"
3333
gltf = { features = ["names", "utils", "import"], optional = true, version = "0.11.1" }
34-
image = "0.18"
34+
image = "0.20"
3535
includedir = "0.5"
3636
itertools = "0.8"
3737
log = "0.4"
38-
obj = { version = "0.8.1", features = ["genmesh"] }
38+
obj = { version = "0.9", features = ["genmesh"] }
3939
phf = "0.7.12"
4040
quick-error = "1.2"
4141
rodio = "0.8"

src/geometry.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl Geometry {
158158
) -> Self {
159159
Self::generate(
160160
generators::Plane::new(),
161-
|GenVertex { pos, .. }| [pos[0] * 0.5 * width, pos[1] * 0.5 * height, 0.0].into(),
161+
|GenVertex { pos, .. }| [pos.x * 0.5 * width, pos.y * 0.5 * height, 0.0].into(),
162162
|v| v.normal.into(),
163163
)
164164
}
@@ -188,9 +188,9 @@ impl Geometry {
188188
generators::Cube::new(),
189189
|GenVertex { pos, .. }| {
190190
[
191-
pos[0] * 0.5 * width,
192-
pos[1] * 0.5 * height,
193-
pos[2] * 0.5 * depth,
191+
pos.x * 0.5 * width,
192+
pos.y * 0.5 * height,
193+
pos.z * 0.5 * depth,
194194
].into()
195195
},
196196
|v| v.normal.into(),
@@ -230,10 +230,10 @@ impl Geometry {
230230
generators::Cylinder::new(radius_segments),
231231
//Three.js has height along the Y axis for some reason
232232
|GenVertex { pos, .. }| {
233-
let scale = (pos[2] + 1.0) * 0.5 * radius_top + (1.0 - pos[2]) * 0.5 * radius_bottom;
234-
[pos[1] * scale, pos[2] * 0.5 * height, pos[0] * scale].into()
233+
let scale = (pos.z + 1.0) * 0.5 * radius_top + (1.0 - pos.z) * 0.5 * radius_bottom;
234+
[pos.y * scale, pos.z * 0.5 * height, pos.x * scale].into()
235235
},
236-
|GenVertex { normal, .. }| [normal[1], normal[2], normal[0]].into(),
236+
|GenVertex { normal, .. }| [normal.y, normal.z, normal.x].into(),
237237
)
238238
}
239239

@@ -257,8 +257,8 @@ impl Geometry {
257257
meridional_segments: usize,
258258
) -> Self {
259259
Self::generate(
260-
generators::SphereUV::new(equatorial_segments, meridional_segments),
261-
|GenVertex { pos, .. }| [pos[0] * radius, pos[1] * radius, pos[2] * radius].into(),
260+
generators::SphereUv::new(equatorial_segments, meridional_segments),
261+
|GenVertex { pos, .. }| [pos.x * radius, pos.y * radius, pos.z * radius].into(),
262262
|v| v.normal.into(),
263263
)
264264
}

0 commit comments

Comments
 (0)