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
  Disable rebuild of meshes in dynamic mode Zilk1 1 8 10-04-2023, 09:50 AM
Last Post: _Aka_
  I have a question about curvySpline haifeng.huang 12 32 07-14-2023, 09:34 AM
Last Post: _Aka_
  "Deadloop in CurvySPline.Refresh" spam Valkymaera 3 11 05-30-2023, 10:56 AM
Last Post: _Aka_
  Is curvyspline a good solution for a 2D rail grinding game? bazz_boyy1 2 8 03-01-2022, 11:49 AM
Last Post: _Aka_

Forum Jump: