Compare commits

..

51 Commits
master ... temp

Author SHA1 Message Date
d3bc8e0e85 how does it know what to do 2024-09-27 14:50:53 -07:00
b4406522f5 plumb one power of m through to the finish line 2024-09-27 13:37:03 -07:00
4e111df791 fix walk calculations 2024-09-27 13:32:33 -07:00
def5497ec1 fix is_slope_walkable 2024-09-27 12:34:12 -07:00
ba6a2bd670 column major 2024-09-26 15:06:38 -07:00
b879b09369 vec3::{MIN,MAX} 2024-09-26 14:37:03 -07:00
e7a881ddc0 fix aabb blunder 2024-09-25 14:26:34 -07:00
f4767a1a3e dep 2024-09-25 10:12:38 -07:00
22087c53b3 mat3 from_rotation_yx + from_rotation_y 2024-09-18 15:22:21 -07:00
759648ebfb wacky angle sin cos test 2024-09-18 15:22:05 -07:00
f4903abd33 angle sin cos 2024-09-18 15:21:54 -07:00
83b948200c actually test timer scale 2024-09-18 15:15:29 -07:00
7d89eb6d0c associate const 2024-09-18 15:15:16 -07:00
9ae1c3505d add Time tests 2024-09-18 11:33:13 -07:00
43e1f8a173 add Time*i64 2024-09-18 11:33:08 -07:00
5790863111 fix Time from Planar64 2024-09-18 11:32:52 -07:00
c48b9d63bd vec3::raw_array 2024-09-16 15:47:57 -07:00
980db44c9d Fixed<1,_>::to_raw 2024-09-16 15:47:35 -07:00
af1939a576 impl Into<glam::Mat4> for Planar64Affine3 2024-09-16 15:02:03 -07:00
8bccc2fe66 Time assign operators 2024-09-16 14:06:37 -07:00
0d8ab36031 Time from ratio 2024-09-16 14:06:30 -07:00
daa86f7228 reexport stupid trait 2024-09-16 14:06:19 -07:00
406448dcca reexport Divide trait 2024-09-16 11:46:24 -07:00
734be35937 Time::to_ratio 2024-09-13 13:59:28 -07:00
4bd5815184 more vec3 consts 2024-09-13 13:59:18 -07:00
1a5a48d303 dedicated affine type means less math 2024-09-13 13:22:00 -07:00
aae9ba5e80 define more functions 2024-09-12 12:16:19 -07:00
b9f280f94b use new convenience functions 2024-09-12 10:57:54 -07:00
e8a6f4dab3 write the whole thing 2024-09-11 15:14:56 -07:00
aaad5d5c22 integer: tweak Time 2024-09-11 14:30:03 -07:00
5c059ed17d huge 2024-09-11 14:29:45 -07:00
bd72b50db6 iterate 2024-09-11 13:15:23 -07:00
5b5ed4f38e ratio ops 2024-09-11 13:01:39 -07:00
e845ce246a wip 2024-09-10 14:41:47 -07:00
18fdbb9a99 vector shift implemented 2024-09-10 14:41:18 -07:00
5bb4491e0f ops rewrite 2024-09-10 13:46:34 -07:00
ab6c5d583d array-backed rewrite 2024-09-06 13:26:07 -07:00
dc79b4011d no-traits rewrite 2024-09-06 13:26:07 -07:00
bd6b7ff217 move zeroes to fixed_wide 2024-09-06 13:26:04 -07:00
74afcf457d built in calculation 2024-08-30 22:11:42 -07:00
7881a090c3 it is a matrix 2024-08-30 22:11:24 -07:00
1f29021d4a affine deleted 2024-08-30 12:33:00 -07:00
b8714fbbc8 wip gameplay_style 2024-08-29 17:23:13 -07:00
d9a95e9284 reexport traits 2024-08-29 17:23:10 -07:00
3b54bc8326 bvec 2024-08-28 13:29:42 -07:00
0db0f2854e cordic 2024-08-28 12:32:17 -07:00
40799945ce wip 2024-08-28 12:32:17 -07:00
3bb280a787 ruin zeroes 2024-08-28 12:32:17 -07:00
76b1e6af54 aabb 2024-08-28 12:31:16 -07:00
8a13307d98 the replacement of all time 2024-08-27 14:26:51 -07:00
585d6c8a92 add deps 2024-08-27 13:51:27 -07:00
3 changed files with 20 additions and 61 deletions

29
Cargo.lock generated
View File

@ -22,9 +22,8 @@ checksum = "50202def95bf36cb7d1d7a7962cea1c36a3f8ad42425e5d2b71d7acb8041b5b8"
[[package]]
name = "fixed_wide"
version = "0.1.1"
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
checksum = "d9c2cf115b3785ede870fada07e8b1aeba3378345b4ca86fe3c772ecabc05c0f"
version = "0.1.0"
source = "git+https://git.itzana.me/StrafesNET/fixed_wide_vectors?rev=438d0ec6ec4ae97d13d950ea317ce324dd205e10#438d0ec6ec4ae97d13d950ea317ce324dd205e10"
dependencies = [
"arrayvec",
"bnum",
@ -34,9 +33,9 @@ dependencies = [
[[package]]
name = "glam"
version = "0.29.0"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28091a37a5d09b555cb6628fd954da299b536433834f5b8e59eba78e0cbbf8a"
checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94"
[[package]]
name = "id"
@ -52,8 +51,7 @@ dependencies = [
[[package]]
name = "linear_ops"
version = "0.1.0"
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
checksum = "b2e6977ac24f47086d8a7a2d4ae1c720e86dfdc8407cf5e34c18bfa01053c456"
source = "git+https://git.itzana.me/StrafesNET/fixed_wide_vectors?rev=438d0ec6ec4ae97d13d950ea317ce324dd205e10#438d0ec6ec4ae97d13d950ea317ce324dd205e10"
dependencies = [
"fixed_wide",
"paste",
@ -77,9 +75,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.37"
version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [
"proc-macro2",
]
@ -87,12 +85,11 @@ dependencies = [
[[package]]
name = "ratio_ops"
version = "0.1.0"
source = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
checksum = "01239195d6afe0509e7e3511b716c0540251dfe7ece0a9a5a27116afb766c42c"
source = "git+https://git.itzana.me/StrafesNET/fixed_wide_vectors?rev=438d0ec6ec4ae97d13d950ea317ce324dd205e10#438d0ec6ec4ae97d13d950ea317ce324dd205e10"
[[package]]
name = "strafesnet_common"
version = "0.5.2"
version = "0.4.1"
dependencies = [
"arrayvec",
"bitflags",
@ -105,9 +102,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.79"
version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590"
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
@ -116,6 +113,6 @@ dependencies = [
[[package]]
name = "unicode-ident"
version = "1.0.13"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"

View File

@ -1,6 +1,6 @@
[package]
name = "strafesnet_common"
version = "0.5.2"
version = "0.4.1"
edition = "2021"
repository = "https://git.itzana.me/StrafesNET/common"
license = "MIT OR Apache-2.0"
@ -12,8 +12,8 @@ authors = ["Rhys Lloyd <krakow20@gmail.com>"]
[dependencies]
arrayvec = "0.7.4"
bitflags = "2.6.0"
fixed_wide = { version = "0.1.1", registry = "strafesnet", features = ["deferred-division","zeroes","wide-mul"] }
linear_ops = { version = "0.1.0", registry = "strafesnet", features = ["deferred-division","named-fields"] }
ratio_ops = { version = "0.1.0", registry = "strafesnet" }
glam = "0.29.0"
fixed_wide = { git = "https://git.itzana.me/StrafesNET/fixed_wide_vectors", rev = "438d0ec6ec4ae97d13d950ea317ce324dd205e10", features = ["deferred-division","zeroes","wide-mul"] }
linear_ops = { git = "https://git.itzana.me/StrafesNET/fixed_wide_vectors", rev = "438d0ec6ec4ae97d13d950ea317ce324dd205e10", features = ["deferred-division","named-fields"] }
ratio_ops = { git = "https://git.itzana.me/StrafesNET/fixed_wide_vectors", rev = "438d0ec6ec4ae97d13d950ea317ce324dd205e10" }
glam = "0.28.0"
id = { version = "0.1.0", registry = "strafesnet" }

View File

@ -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 Planar64Vec3=linear_ops::types::Vector3<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_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]);
#[inline]
pub const fn int(x:i32,y:i32,z:i32)->Planar64Vec3{
Planar64Vec3::new([Planar64::raw((x as i64)<<32),Planar64::raw((y as i64)<<32),Planar64::raw((z as i64)<<32)])
pub fn int(x:i32,y:i32,z:i32)->Planar64Vec3{
Planar64Vec3::new([Planar64::from(x),Planar64::from(y),Planar64::from(z)])
}
#[inline]
pub fn raw_array(array:[i64;3])->Planar64Vec3{
Planar64Vec3::new(array.map(Planar64::raw))
}
#[inline]
pub fn raw_xyz(x:i64,y:i64,z:i64)->Planar64Vec3{
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{
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{
use super::*;
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{
Planar64Mat3::new([
[diag.x,Planar64::ZERO,Planar64::ZERO],
@ -616,14 +586,6 @@ pub mod mat3{
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)]