use approx_det::assert_relative_eq;
use wasm_bindgen_test::*;
use crate::collision_tasks::tests::common::{
convex1contact_manifold_wide_to_convex1contact_manifold, get_input_wide,
Convex1ContactManifold, Mvec3, TestInput,
};
use crate::collision_tasks::ShapeWideTester;
use crate::shapes::SphereWide;
use crate::traits::PairWideTest;
use crate::Sphere;
wasm_bindgen_test_configure!(run_in_browser);
pub(crate) type InputType = TestInput<Sphere, Sphere>;
const ADJUST_DEPTH_FACTOR: f32 = 0.5;
#[test]
#[wasm_bindgen_test]
#[cfg(feature = "serde")]
fn test_sphere_sphere_tester_tangent() {
let _ = env_logger::builder().is_test(true).try_init();
let file_input = include_bytes!("resource/sphere_sphere/tangent.json");
let input0: InputType = serde_json::from_slice(file_input).expect("file should be proper JSON");
let mut output0 = Convex1ContactManifold {
offset_a: Mvec3 {
x: 0.0,
y: 0.5,
z: 0.0,
},
normal: Mvec3 {
x: 0.0,
y: -1.0,
z: 0.0,
},
depth: 0.0,
feature_id: 0,
contact_exists: true,
};
output0.adjust_offset_a_to_shape_surface(ADJUST_DEPTH_FACTOR);
let array = [input0];
let outputs = [output0];
let pair_count = array.len();
TestWide!(
SphereWide,
SphereWide,
array,
pair_count,
outputs,
convex1contact_manifold_wide_to_convex1contact_manifold
);
}