Compare commits
51 Commits
Author | SHA1 | Date | |
---|---|---|---|
d3bc8e0e85 | |||
b4406522f5 | |||
4e111df791 | |||
def5497ec1 | |||
ba6a2bd670 | |||
b879b09369 | |||
e7a881ddc0 | |||
f4767a1a3e | |||
22087c53b3 | |||
759648ebfb | |||
f4903abd33 | |||
83b948200c | |||
7d89eb6d0c | |||
9ae1c3505d | |||
43e1f8a173 | |||
5790863111 | |||
c48b9d63bd | |||
980db44c9d | |||
af1939a576 | |||
8bccc2fe66 | |||
0d8ab36031 | |||
daa86f7228 | |||
406448dcca | |||
734be35937 | |||
4bd5815184 | |||
1a5a48d303 | |||
aae9ba5e80 | |||
b9f280f94b | |||
e8a6f4dab3 | |||
aaad5d5c22 | |||
5c059ed17d | |||
bd72b50db6 | |||
5b5ed4f38e | |||
e845ce246a | |||
18fdbb9a99 | |||
5bb4491e0f | |||
ab6c5d583d | |||
dc79b4011d | |||
bd6b7ff217 | |||
74afcf457d | |||
7881a090c3 | |||
1f29021d4a | |||
b8714fbbc8 | |||
d9a95e9284 | |||
3b54bc8326 | |||
0db0f2854e | |||
40799945ce | |||
3bb280a787 | |||
76b1e6af54 | |||
8a13307d98 | |||
585d6c8a92 |
29
Cargo.lock
generated
29
Cargo.lock
generated
@ -22,9 +22,8 @@ checksum = "50202def95bf36cb7d1d7a7962cea1c36a3f8ad42425e5d2b71d7acb8041b5b8"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fixed_wide"
|
name = "fixed_wide"
|
||||||
version = "0.1.1"
|
version = "0.1.0"
|
||||||
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
source = "git+https://git.itzana.me/StrafesNET/fixed_wide_vectors?rev=438d0ec6ec4ae97d13d950ea317ce324dd205e10#438d0ec6ec4ae97d13d950ea317ce324dd205e10"
|
||||||
checksum = "d9c2cf115b3785ede870fada07e8b1aeba3378345b4ca86fe3c772ecabc05c0f"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bnum",
|
"bnum",
|
||||||
@ -34,9 +33,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glam"
|
name = "glam"
|
||||||
version = "0.29.0"
|
version = "0.28.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c28091a37a5d09b555cb6628fd954da299b536433834f5b8e59eba78e0cbbf8a"
|
checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "id"
|
name = "id"
|
||||||
@ -52,8 +51,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "linear_ops"
|
name = "linear_ops"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
source = "git+https://git.itzana.me/StrafesNET/fixed_wide_vectors?rev=438d0ec6ec4ae97d13d950ea317ce324dd205e10#438d0ec6ec4ae97d13d950ea317ce324dd205e10"
|
||||||
checksum = "b2e6977ac24f47086d8a7a2d4ae1c720e86dfdc8407cf5e34c18bfa01053c456"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fixed_wide",
|
"fixed_wide",
|
||||||
"paste",
|
"paste",
|
||||||
@ -77,9 +75,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.37"
|
version = "1.0.36"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
|
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@ -87,12 +85,11 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ratio_ops"
|
name = "ratio_ops"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
source = "git+https://git.itzana.me/StrafesNET/fixed_wide_vectors?rev=438d0ec6ec4ae97d13d950ea317ce324dd205e10#438d0ec6ec4ae97d13d950ea317ce324dd205e10"
|
||||||
checksum = "01239195d6afe0509e7e3511b716c0540251dfe7ece0a9a5a27116afb766c42c"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strafesnet_common"
|
name = "strafesnet_common"
|
||||||
version = "0.5.2"
|
version = "0.4.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
@ -105,9 +102,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.79"
|
version = "2.0.72"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590"
|
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -116,6 +113,6 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.13"
|
version = "1.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||||
|
10
Cargo.toml
10
Cargo.toml
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "strafesnet_common"
|
name = "strafesnet_common"
|
||||||
version = "0.5.2"
|
version = "0.4.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://git.itzana.me/StrafesNET/common"
|
repository = "https://git.itzana.me/StrafesNET/common"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
@ -12,8 +12,8 @@ authors = ["Rhys Lloyd <krakow20@gmail.com>"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
arrayvec = "0.7.4"
|
arrayvec = "0.7.4"
|
||||||
bitflags = "2.6.0"
|
bitflags = "2.6.0"
|
||||||
fixed_wide = { version = "0.1.1", registry = "strafesnet", features = ["deferred-division","zeroes","wide-mul"] }
|
fixed_wide = { git = "https://git.itzana.me/StrafesNET/fixed_wide_vectors", rev = "438d0ec6ec4ae97d13d950ea317ce324dd205e10", features = ["deferred-division","zeroes","wide-mul"] }
|
||||||
linear_ops = { version = "0.1.0", registry = "strafesnet", features = ["deferred-division","named-fields"] }
|
linear_ops = { git = "https://git.itzana.me/StrafesNET/fixed_wide_vectors", rev = "438d0ec6ec4ae97d13d950ea317ce324dd205e10", features = ["deferred-division","named-fields"] }
|
||||||
ratio_ops = { version = "0.1.0", registry = "strafesnet" }
|
ratio_ops = { git = "https://git.itzana.me/StrafesNET/fixed_wide_vectors", rev = "438d0ec6ec4ae97d13d950ea317ce324dd205e10" }
|
||||||
glam = "0.29.0"
|
glam = "0.28.0"
|
||||||
id = { version = "0.1.0", registry = "strafesnet" }
|
id = { version = "0.1.0", registry = "strafesnet" }
|
||||||
|
@ -525,7 +525,6 @@ impl TryFrom<[f32;3]> for Unit32Vec3{
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
pub type Planar64TryFromFloatError=fixed_wide::fixed::FixedFromFloatError;
|
|
||||||
pub type Planar64=fixed_wide::types::I32F32;
|
pub type Planar64=fixed_wide::types::I32F32;
|
||||||
pub type Planar64Vec3=linear_ops::types::Vector3<Planar64>;
|
pub type Planar64Vec3=linear_ops::types::Vector3<Planar64>;
|
||||||
pub type Planar64Mat3=linear_ops::types::Matrix3<Planar64>;
|
pub type Planar64Mat3=linear_ops::types::Matrix3<Planar64>;
|
||||||
@ -544,52 +543,23 @@ pub mod vec3{
|
|||||||
pub const NEG_Y:Planar64Vec3=Planar64Vec3::new([Planar64::ZERO,Planar64::NEG_ONE,Planar64::ZERO]);
|
pub const NEG_Y:Planar64Vec3=Planar64Vec3::new([Planar64::ZERO,Planar64::NEG_ONE,Planar64::ZERO]);
|
||||||
pub const NEG_Z:Planar64Vec3=Planar64Vec3::new([Planar64::ZERO,Planar64::ZERO,Planar64::NEG_ONE]);
|
pub const NEG_Z:Planar64Vec3=Planar64Vec3::new([Planar64::ZERO,Planar64::ZERO,Planar64::NEG_ONE]);
|
||||||
pub const NEG_ONE:Planar64Vec3=Planar64Vec3::new([Planar64::NEG_ONE,Planar64::NEG_ONE,Planar64::NEG_ONE]);
|
pub const NEG_ONE:Planar64Vec3=Planar64Vec3::new([Planar64::NEG_ONE,Planar64::NEG_ONE,Planar64::NEG_ONE]);
|
||||||
#[inline]
|
pub fn int(x:i32,y:i32,z:i32)->Planar64Vec3{
|
||||||
pub const fn int(x:i32,y:i32,z:i32)->Planar64Vec3{
|
Planar64Vec3::new([Planar64::from(x),Planar64::from(y),Planar64::from(z)])
|
||||||
Planar64Vec3::new([Planar64::raw((x as i64)<<32),Planar64::raw((y as i64)<<32),Planar64::raw((z as i64)<<32)])
|
|
||||||
}
|
}
|
||||||
#[inline]
|
|
||||||
pub fn raw_array(array:[i64;3])->Planar64Vec3{
|
pub fn raw_array(array:[i64;3])->Planar64Vec3{
|
||||||
Planar64Vec3::new(array.map(Planar64::raw))
|
Planar64Vec3::new(array.map(Planar64::raw))
|
||||||
}
|
}
|
||||||
#[inline]
|
|
||||||
pub fn raw_xyz(x:i64,y:i64,z:i64)->Planar64Vec3{
|
pub fn raw_xyz(x:i64,y:i64,z:i64)->Planar64Vec3{
|
||||||
Planar64Vec3::new([Planar64::raw(x),Planar64::raw(y),Planar64::raw(z)])
|
Planar64Vec3::new([Planar64::raw(x),Planar64::raw(y),Planar64::raw(z)])
|
||||||
}
|
}
|
||||||
#[inline]
|
|
||||||
pub fn try_from_f32_array([x,y,z]:[f32;3])->Result<Planar64Vec3,Planar64TryFromFloatError>{
|
|
||||||
Ok(Planar64Vec3::new([
|
|
||||||
try_from_f32(x)?,
|
|
||||||
try_from_f32(y)?,
|
|
||||||
try_from_f32(z)?,
|
|
||||||
]))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn int(value:i32)->Planar64{
|
pub fn int(value:i32)->Planar64{
|
||||||
Planar64::from(value)
|
Planar64::from(value)
|
||||||
}
|
}
|
||||||
#[inline]
|
|
||||||
pub fn try_from_f32(value:f32)->Result<Planar64,Planar64TryFromFloatError>{
|
|
||||||
let result:Result<Planar64,_>=value.try_into();
|
|
||||||
match result{
|
|
||||||
Ok(ok)=>Ok(ok),
|
|
||||||
Err(e)=>e.underflow_to_zero(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub mod mat3{
|
pub mod mat3{
|
||||||
use super::*;
|
use super::*;
|
||||||
pub use linear_ops::types::Matrix3;
|
pub use linear_ops::types::Matrix3;
|
||||||
#[inline]
|
|
||||||
pub const fn identity()->Planar64Mat3{
|
|
||||||
Planar64Mat3::new([
|
|
||||||
[Planar64::ONE,Planar64::ZERO,Planar64::ZERO],
|
|
||||||
[Planar64::ZERO,Planar64::ONE,Planar64::ZERO],
|
|
||||||
[Planar64::ZERO,Planar64::ZERO,Planar64::ONE],
|
|
||||||
])
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
pub fn from_diagonal(diag:Planar64Vec3)->Planar64Mat3{
|
pub fn from_diagonal(diag:Planar64Vec3)->Planar64Mat3{
|
||||||
Planar64Mat3::new([
|
Planar64Mat3::new([
|
||||||
[diag.x,Planar64::ZERO,Planar64::ZERO],
|
[diag.x,Planar64::ZERO,Planar64::ZERO],
|
||||||
@ -616,14 +586,6 @@ pub mod mat3{
|
|||||||
Planar64Vec3::new([s,Planar64::ZERO,c]),
|
Planar64Vec3::new([s,Planar64::ZERO,c]),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
#[inline]
|
|
||||||
pub fn try_from_f32_array_2d([x_axis,y_axis,z_axis]:[[f32;3];3])->Result<Planar64Mat3,Planar64TryFromFloatError>{
|
|
||||||
Ok(Planar64Mat3::new([
|
|
||||||
vec3::try_from_f32_array(x_axis)?.to_array(),
|
|
||||||
vec3::try_from_f32_array(y_axis)?.to_array(),
|
|
||||||
vec3::try_from_f32_array(z_axis)?.to_array(),
|
|
||||||
]))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone,Copy,Default,Hash,Eq,PartialEq)]
|
#[derive(Clone,Copy,Default,Hash,Eq,PartialEq)]
|
||||||
|
Loading…
Reference in New Issue
Block a user