MvtUtil: Create RefVec: Current coords of obj instances


ASTER::ACTION::MotionControl::MvtUtil: Create a reference vector using XY positions with respect to Object Instances

Collect target XY coordinates data and generate the Reference Vector for MoveTowards:RefVec.

MoveTowards:RefVec, one of the motion templates, utilizes the Reference Vector, which is the coordinate data that object instances selected as mvt.Pursuer refer to as target coordinates for movement.


Reference Vector is not a function for aligning instances but a function for calculating the coordinates & collecting the results that instances will ultimately reach using the given parameters.

In ASTER’s MoveTowards, mvt.Target is defined as coordinate data rather than object instances, so the Reference Vector can be registered as the target coordinates for moving mvt.Pursuer.


Relevant URL

Differences from MoveTowards: TgtArr

MoveTowards: RefVec uses std::deque (double-ended queue), a C++ sequential container, to achieve faster and lighter processing.

Motion Template mvt.Target Data Structure
MoveTowards: TgtArr JSON Array JSON 2D array
MoveTowards: RefVec Reference Vector c++ std::deque (Container)

Reference Vector is expected to be faster and more efficient than MoveTowards: TgtArr, which uses JSON Array as the target. JSON Array suffers from generally slow processing due to the specifications of the nlohmann/json library used by ASTER.

Details

MoveTowards: TgtArr can be easily integrated with JSON, while MoveTowards: RefVec is preferable when handling a larger number of instances requiring increased processing speed and reduced computational load.


Parameter

Select the object instance. Only the "Active (sprite) Object" Type can be registered to the controller.

Description of the image

If "The Active Object" is not specified, an error will be displayed when executing the action from the event, and the registration process will be aborted.