Skip to content

Commit 953a05d

Browse files
committed
Extend glam version range to 0.30
1 parent 3051754 commit 953a05d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ blosc-src = { version = "0.3.0", features = ["lz4"] }
2727
bytemuck = { version = "1.13", features = ["extern_crate_alloc"] }
2828
byteorder = "1.4"
2929
flate2 = "1"
30-
glam = ">=0.18,<=0.25"
30+
glam = ">=0.18,<=0.30"
3131
half = { version = "2.2.1", features = ["bytemuck"] }
3232
log = "0.4"
3333
thiserror = "1"

src/data_structure.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl Metadata {
219219
#[derive(Debug, Clone, PartialEq)]
220220
pub enum MetadataValue {
221221
String(String),
222-
Vec3i(glam::IVec3),
222+
Vec3i(IVec3),
223223
I32(i32),
224224
I64(i64),
225225
Float(f32),
@@ -233,11 +233,8 @@ pub trait Node {
233233
const TOTAL: u32;
234234

235235
fn local_coord_to_offset(&self, xyz: LocalCoord) -> Index {
236-
Index(
237-
(((xyz.0[0] & (Self::DIM - 1)) >> Self::TOTAL) << (2 * Self::LOG_2_DIM))
238-
+ (((xyz.0[1] & (Self::DIM - 1)) >> Self::TOTAL) << Self::LOG_2_DIM)
239-
+ ((xyz.0[2] & (Self::DIM - 1)) >> Self::TOTAL),
240-
)
236+
let index_3d = (xyz.0 & (Self::DIM - 1)) >> Self::TOTAL;
237+
Index((index_3d.x << (2 * Self::LOG_2_DIM)) + (index_3d.y << Self::LOG_2_DIM) + index_3d.z)
241238
}
242239

243240
fn offset_to_local_coord(&self, offset: Index) -> LocalCoord {

0 commit comments

Comments
 (0)