A small contribution: Lina

Hello everyone,

I wanted something more complex than a Line, so I created something new: a LineString. I put this on gitHub as a library. Here’s the link: GitHub - MisterCavespider/Lina: This is is a library for jMonkeyEngine3. It adds support for different kind of lines, which make it easy to trace objects.

##Wait, what?
Lina is a library for complex lines in jMonkeyEngine (3.1).
It’s open-source, meaning you can alter it to your own interests.
The library isn’t finshed yet, I will probably add some extra things, like templates, later.
##How do I use it?
Lina is easy to use, just do the following:

  1. Construct a LineString.
  2. add waypoints using .addPoint(Vector3f point);
  3. attach the node, which you can get through .getLineNode() to the preferred Node.
    Done!
    ##Why would I need this?
    Well, for many things, but mainly for debugging. You could track every object by simply putting it’s position as a new waypoint. You can also use it for the trajectory of planets.
    ##What will you add?
    I was thinking about adding templates - this way you could just request a circle and give it the amount of samples and the radius and BAM! You got yourself a perfect circle!
    ##It looks small
    It is.

I would really appreciate some feedback or suggestions. Also, I haven’t seen this anywhere. If you did, please inform me.

3 Likes

Neat! I’m thinking of using this as trails maybe, is it possible to update the points on the fly?

Edit: I see it uses a map, so yes it is :stuck_out_tongue:

One thing though…

public Node getAttach() {
    return lineNode;
}

Why is this better than say, extending Node? That’d be a lot less of a hassle.

Well, I was first thinking to make it extend a mesh or a spatial, but I guess extending a Node is better. Maybe I will do that today.
Thanks for the feedback.

Looks cool!

Just a few notes if you care to improve it:
I agree with your original inclination to make this extend Mesh like all of the other mesh variants. In my own code I’ve implemented a Lines mesh a couple times and it’s always a Mesh extension.

…that way you can avoid all of the extra nodes, geometry, etc… just one mesh of lines. It would be way more flexible, too. You can also avoid recreating the buffers all the time if the points just move.