Force library
This commit is contained in:
parent
d9e4e06c78
commit
f3d930405c
3 changed files with 58 additions and 4 deletions
|
|
@ -346,4 +346,11 @@ test "quat apply to vec " {
|
|||
try std.testing.expect(std.math.approxEqAbs(f64, rotated.x(), -2, 1e-12));
|
||||
try std.testing.expect(std.math.approxEqAbs(f64, rotated.y(), 1, 1e-12));
|
||||
try std.testing.expect(std.math.approxEqAbs(f64, rotated.z(), 1, 1e-12));
|
||||
|
||||
const forward_body = Vec3F64.init(1, 0, 0);
|
||||
const forward_inertial = quatApply(quat, forward_body);
|
||||
|
||||
try std.testing.expectApproxEqAbs(@as(f64, 0), forward_inertial.x(), 1e-12);
|
||||
try std.testing.expectApproxEqAbs(@as(f64, 1), forward_inertial.y(), 1e-12);
|
||||
try std.testing.expectApproxEqAbs(@as(f64, 0), forward_inertial.z(), 1e-12);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue