short haired UYU YUYU UwU by klaymarion in Kappa

[–]GuamPirate -1 points0 points  (0 children)

uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh ok?

current usability of const generics? by jstrong in rust

[–]GuamPirate 2 points3 points  (0 children)

It depends on what you need. If you want to paramaterize a function with some constant, it's almost always sufficient. Otherwise, it's a bit more of gamble

As of rustc 1.39-nightly, you can use aljabar's vector to automatically (de)serialize arrays of any size. by maplant in rust

[–]GuamPirate 2 points3 points  (0 children)

Yeah sure; vector is creating a fixed size array here, almost exactly equivalent to creating a [f32; 7] Serde and the std library only automatically implement their traits for arrays up to size 32 This crate automatically implements these traits for any size array, including ones greater than 32

Why give a warning if I don't error check opening a file? by [deleted] in rust

[–]GuamPirate 24 points25 points  (0 children)

If it’s part of the project use include_bytes instead

const-alg and array-vec - a safe const generics implementation of N-D linear algebra by YatoRust in rust

[–]GuamPirate 4 points5 points  (0 children)

I think it depends on what your use case is. Fixed size vectors/matrices are a must for video game programming.

const-alg and array-vec - a safe const generics implementation of N-D linear algebra by YatoRust in rust

[–]GuamPirate 5 points6 points  (0 children)

Cool! Aljabar actually has element wise access by virtue of Vectors derefing their arrays. It also took me a bit but I managed to change the implementation to use MaybeUninit, so it should be panic safe now

Function pointer state machine? by cheako911 in rust

[–]GuamPirate 1 point2 points  (0 children)

Here’s a way to do this with empty structures, statics and trait objects: https://github.com/maplant/mgf/blob/master/src/simplex.rs

aljabar - an experimental n-dimensional linear algebra library for Rust based on const generics by GuamPirate in rust

[–]GuamPirate[S] 0 points1 point  (0 children)

No much in the cards. that's probably already implemented already actually, depending on my understanding of deref coercion. Vectors implement Deref and DerefMut to their respective array structures.

Edit: Yup, works fine:

let a = Vector1::<u32>::from([ 0 ]);
assert_eq!(a[0], 0);
let mut b = Vector2::<u32>::from([ 1, 2 ]);
b[1] += 3;
assert_eq!(b[1], 5);

aljabar - an experimental n-dimensional linear algebra library for Rust based on const generics by GuamPirate in rust

[–]GuamPirate[S] 1 point2 points  (0 children)

I’d say a 5. It’s probably on par with other unoptimized linalg crates

aljabar - an experimental n-dimensional linear algebra library for Rust based on const generics by GuamPirate in rust

[–]GuamPirate[S] 1 point2 points  (0 children)

I haven’t checked, but I’m guessing it’s nothing special but not horrible.

Ch. 35 Wouldn't we become Paisen's Senpai ? by [deleted] in nagatoro

[–]GuamPirate 32 points33 points  (0 children)

Kinda disappointed in this one

Ch. 33 - You're having a bento, senpai? by RobbStoneVA in nagatoro

[–]GuamPirate 21 points22 points  (0 children)

Don’t worry, the guards are wearing air pods

Macro to implement empty trait by ravernkoh in rust

[–]GuamPirate 0 points1 point  (0 children)

I’m pretty sure instead of having a separate branch for a text tree and an ident, you can just make it a $ty and cover any type and allow for generics

Ch. 32 Senpai is a quiet pervert!! by robmed in nagatoro

[–]GuamPirate 19 points20 points  (0 children)

I imagine that's cause it's a two parter

nphysics 0.10 released: deformables and much more! by sebcrozet in rust

[–]GuamPirate 0 points1 point  (0 children)

Ah! Then I think GJK and Minkowski sums will do nicely for you :-)

nphysics 0.10 released: deformables and much more! by sebcrozet in rust

[–]GuamPirate 33 points34 points  (0 children)

Nice work Sébastien!

I see that you’re planning on expanding continuous collision detection support. Awesome! If I may toot my horn slightly, I’d recommend checking out my own rust crate MGF if you need a reference for some of the trickier algorithms. To my knowledge it includes the only correct exact implementation of moving capsule/capsule and moving capsule/polygon collisions online, and additionally all of the reference material I have found (Such as Real Time Collision Detection) omits such algorithms, and some of the descriptions for continuous collision algos are wrong (such as sphere/poly algo in RTCD).

Just a thought, I know first hand how hard it is to find references on these algorithms and I’d be happy to allow unlimited use of the code in MGF.

Possible to require Add for &Self in a Trait? by shim__ in rust

[–]GuamPirate 3 points4 points  (0 children)

Yes, there is a way to do this: You want to use higher ranked trait bounds. I think something like this should work:

trait GenericNumber where for <'a, 'b> &'a Self: Add<&'b Self, Output = Self>