Skip to content

Conversation

@dhontecillas
Copy link
Contributor

  • Added a function to find the minimum distance from a boundvec to a point (can be used to calculate the distance from a platform represented as a boundvec to a target point)
  • Added the base class for a tfunction : a base class that for each t value returns a value
    • Added line as a function of t (althought that could be redundant with a more generic representation of a boundvec2 , that can be a line, a segment, or a ray, it uses the same interface than 'function' and you can get the inverse through the solve function)
    • Added tquadratic as function of t (inot used the parabola term, as it will be used for curves )
    • Added tcubic function (not fully tested and not implemented the solve method)
  • Added the tcurve2 class : for each provided value of t it returns a vec2.
    • Added the implementation of a parabola, that is the composition of a line in x axis, and a cubic function for the y axis.

The parabolic curve has been fully tested in a project of mine, however, at some point I expect to put some tests.

@Kazade
Copy link
Owner

Kazade commented May 22, 2015

Hi! This looks really awesome, the only reason I haven't merged it yet is that I'd prefer if the C++ classes were implemented in terms of C functions, for both consistency, but also because the C library gets more use than the C++ headers (because it's more portable) and so it would benefit more people that way.

I'm obviously not expecting you to do that, when I find some time I'll move the code around. Hope that's OK!

Thanks!

@dhontecillas
Copy link
Contributor Author

Hi! That code has been around in my disk for a while. I wanted to do some
reorganization before making a pull request ... but, since that was good
for me, never found the time to move the stuff to C functions. I made the
pull request, so perhaps someone can take advantge of if.

Let's do something: send me a line before you want to start moving the
stuff, so if have something else to commit I will do it.

About using it in headers, is more about the 'inline' capabilities of the
compiler. But I'm not sure if it is going to be a big difference between
having the code in the headers or having it in C , and calling it from C++
. But I completely agree that for consistency it should be placed in the C
part of the repo.

On Fri, May 22, 2015 at 9:59 AM, Luke Benstead notifications@github.com
wrote:

Hi! This looks really awesome, the only reason I haven't merged it yet is
that I'd prefer if the C++ classes were implemented in terms of C
functions, for both consistency, but also because the C library gets more
use than the C++ headers (because it's more portable) and so it would
benefit more people that way.

I'm obviously not expecting you to do that, when I find some time I'll
move the code around. Hope that's OK!

Thanks!


Reply to this email directly or view it on GitHub
#34 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants