Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic CurvySpline and memory allocation
#1
Hi Jake, 

I am using CurvySpline to plot a character travel path.
Ie: When player touch the screen, the character will move to that location along the spline.

I wanted to avoid any in game memory allocation whenever possible. 
Looking at the CurvySplineSegment.Add(CurvySplineSegment, bool), the first thing it does is new GameObject()

Do you have any suggestion what I can do to avoid that?

The distance the character can travel is limited.
So I can pre-allocate 10 or 20 control points at GameObject.Start().
When a spline is require, I just bring-in (or enable) the number of control points and set their position and up-vector.  
When the character has reach his destination, I'll just reparent (or disable) the control points.
The game is targeted on mobile devices.  



kimc.

 

 
Reply


Messages In This Thread
Dynamic CurvySpline and memory allocation - by kimc - 11-27-2014, 11:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Destroying curvyspline instances jmh1804 5 2,985 09-18-2024, 07:52 AM
Last Post: _Aka_
  Scene 51: Dynamic track between two points wallflower6 3 2,463 08-19-2024, 08:18 AM
Last Post: _Aka_
  CurvySpline Optimize Candy 1 1,438 08-02-2024, 08:35 AM
Last Post: _Aka_
  Disable rebuild of meshes in dynamic mode Zilk1 3 2,233 05-27-2024, 08:14 AM
Last Post: _Aka_

Forum Jump: