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
-
ASTER :: Action :: MotionControl :: MoveTowards: RefVec
-
ASTER :: Action :: MotionControl :: MoveTowards: Re.Cyclic
-
ASTER :: Action :: MotionControl :: MoveTowards: TgtArr
-
ASTER :: Conditions :: MotionControl :: EvD: MvU: BEGIN moving moment
-
ASTER :: Conditions :: MotionControl :: EvD: MvU: CLOSE moving moment
-
ASTER :: Expressions::MotionControl :: EvD: MvU: Retrieve CF25 animation dir based on movement dirs
-
ASTER :: Action :: JSON :: MvtUtil: Creat a JSON array exported from the Reference Vector
Differences from MoveTowards: TgtArr
MoveTowards: RefVec uses a C++ sequential container, the double-ended queue (std::deque), to achieve fast and lightweight processing.
The nlohmann/json library used by ASTER is not very efficient when handling JSON arrays.
| Motion Template | mvt.Target | Data Structure |
|---|---|---|
| MoveTowards: TgtArr | JSON Array | JSON 2D Array |
| MoveTowards: RefVec | Reference Vector | C++ std::deque (Container) |
Details
The reference vector is faster and more efficient than MoveTowards: TgtArr, which uses a JSON array as its target.
MoveTowards: TgtArr can be easily integrated with JSON, but when dealing with a large number of instances, it is recommended to use MoveTowards: RefVec to improve processing speed and reduce computational load.
Parameter
Select the object instance. Only the "Active (sprite) Object" Type can be registered to the controller.
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.