Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shortest route to world position
Hi, and thank you for a great library!

I was wondering if anyone could help me find the most optimal way of taking the shortest route to a world position over a set of paths using Curvy.

I'm thinking about writing an extension method to Curvy which is not dependent upon tags for handling connections, but can instead automatically choose the shortest route when passing over them.

This extension method would go something like this:
MoveByShortestRoute(ref currentSpline, ref tf, ref direction, speed, curvyClamping, targetPosition, connections), where targetPosition is a Vector3 dependent upon GetNearestPointTF() to get the exact TF on the path nearest to it.
This method would then calculate and choose the shortest path using the connections you supply to it.

I don't know Curvy too well yet so I'm basicly just wondering if this would be a good way of doing this and if anyone got any thought out ideas on how to solve it technically while still preserving the feature set of Curvy.

I think this is a feature that many devs would benefit from. Maybe someone even solved this earlier?

Any help is appreciated, thanks!

we call this featureset "Spline Network". Build a network map based on (connected) spline segments and apply any logic on this map instead of the splines itself. I have some basic prototype code (and much more ideas) floating around, but nothing you really can start messing around with. Developing this feature is on halt until 2.0 is released, but it's definitely in the pipeline.

There are several problems to be solved before this will work properly (properly add metadata "can move to, can't move to etc..", synchronize map with spline when editing etc...) and some solutions are already prepared in the 2.0 codebase (like adding marker type connections, much more events).

Okay, thanks for the response, Jake.

I'll just pull some quick temporary solution customized more or less for my specific needs at the moment then. =)

Keep it up, lat0rz!

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting Distance from a World Point zorksox 3 5 04-16-2024, 07:30 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
  How could I get position in spline from "From" value in BuildRasterizedPath? Chanon 1 8 02-12-2024, 09:54 PM
Last Post: _Aka_

Forum Jump: