-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider impl Into<PointX<_>>
in kiss3d API
#237
Comments
I tried once the run the tests. It does not work with borrowed types Though using more complex trait bounds can solve this issue, we could add |
Would it suffice, if you'd write a wrapper function for that? I wrote a wrapper around the kiss3d framework to adapt the window Would look something like this: fn Wrapper::add_jerrys_line(input: &JerryInput, window: &mut Window) {
// first convert JerryInput into something-nalgebra like
// call Window::add_line_...
} |
It's definitely a good idea. Writing a wrapper with I opened this issue for a mild suggestion to make the API more handy. I dived into the impl and realized that we need both |
A series of
From
traits are defined onPoint
type (doc). We could combine it withimpl Into<PointX<_>>
to help user to write more compact syntax.For example, the Window::draw_line receives a pair of point and color. We can turn it to the following.
In this way, we can call by
window.draw_line([0.0, 0.0, 0.0], [0.8, 0.8, 0.8], [1.0, 1.0, 1.0])
instead ofPoint3::new()
everywhere.The text was updated successfully, but these errors were encountered: