Skip to content

Commit

Permalink
Fix tests under double precision mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Oct 18, 2024
1 parent 4607f9c commit d86ce11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/joltc-sys/JoltC
Submodule JoltC updated 2 files
+32 −0 JoltC/Functions.h
+75 −0 JoltC/JoltC.cpp
19 changes: 12 additions & 7 deletions crates/joltc-sys/tests/framework/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,19 @@ pub fn vec4(x: f32, y: f32, z: f32, w: f32) -> JPC_Vec4 {
JPC_Vec4 { x, y, z, w }
}

// If 'double-precision' is set, there is padding in this struct
#[allow(clippy::needless_update)]
pub fn rmat44_identity() -> JPC_RMat44 {
JPC_RMat44 {
col: [
vec4(1.0, 0.0, 0.0, 0.0),
vec4(0.0, 1.0, 0.0, 0.0),
vec4(0.0, 0.0, 1.0, 0.0),
],
col3: rvec3(0.0, 0.0, 0.0),
unsafe {
JPC_RMat44 {
col: [
vec4(1.0, 0.0, 0.0, 0.0),
vec4(0.0, 1.0, 0.0, 0.0),
vec4(0.0, 0.0, 1.0, 0.0),
],
col3: rvec3(0.0, 0.0, 0.0),
..std::mem::zeroed()
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/joltc-sys/tests/smoke_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl SmokeTest for NarrowPhaseShapeCast {
..mem::zeroed()
},
Settings: Default::default(),
BaseOffset: vec3(0.0, 0.0, 0.0),
BaseOffset: rvec3(0.0, 0.0, 0.0),
..mem::zeroed()
};
let hit = JPC_NarrowPhaseQuery_CastShapeEasiest(query, &mut args);
Expand Down

0 comments on commit d86ce11

Please sign in to comment.