MoveTowards: TGTARR
ASTER::ACTION::MotionControl::MoveTowards: The mvt.Target is a JSON Array
MoveTowards: TgtArr is a motion template that uses XY coordinate data stored in an array as movement targets.
The object instance selected as mvt.Pursuer refers to the XY coordinates stored in the array and moves toward the target location.
Once the movement is completed, the motion group is automatically deregistered. Even after the motion group is deregistered, the selection information of instances chosen as mvt.Tgt or mvt.Prs remains.
Before Use:
Register the path referencing the JSON array containing XY coordinate data with ASTER.
Below is a sample JSON array containing XY coordinates
:
{
"xyCoords":[
[100,100],
[200,100],
[300,100],
[400,100]
]
}
Regarding the function that specifies the path to the JSON array for MoveTowards’s Group.A
(mvt.Target), the path is designated using JSON Pointer, but it is part of the Motion Control functionality rather than the JSON functionality.
A similar JSON functionality concept called “Targeted JSON Pointer” exists, but paths specified using Targeted JSON Pointer cannot be used in MoveTowards:TgtArr.
function | description |
---|---|
JSON :: JSON Pointer :: Set Targeted JSON Pointer | General-Purpose Use |
Motion&Control :: MvtUtil: Define an array path for MvT:TgtArr | Dedicated to MoveTowards:TgtArr |
Parameter.1
Enter the motion group name to register to the motion controller.
Even instances created from different objects can be grouped with the same motion group name and managed by the controller.
Instances already registered to the controller cannot be duplicately registered under a different group name.
Multibyte strings (such as Japanese) can also be used, but for practical purposes, short names in lowercase letters are recommended.
"test"
When using the name set to the active object as the motion group name for registration, send an empty string.
""
Parameter.2
8 parameters are serialized and transmitted.
" 60, +0, 0, 30, -1, false, 30, false "
argument | Name | type | descriptions |
---|---|---|---|
60 | timebound | unsigned int | Time until completion of operation, Frame Time |
0 | reserved.1 | int | Reserved area with no implementation (rev.1.0.x) |
0 | motion-type | unsigned int | Only 0 is implemented (rev.1.0.x) |
30 | Sleep Time | unsigned int | Time to pause via sleep, Frame Time |
-1 | Sleep Repetition | int | Number of sleep repetitions; -1 is infinite, 0 disables |
false | Sleep Begin Flag | boolean | Flag to enable sleep at the start of operation |
30 | Sleep Interval Value | unsigned int | Time until next sleep, Frame Time |
false | reserved.2 | boolean | Reserved area with no implementation (rev.1.0.x) |
Time Bound
unsigned int
Time required to complete movement, application frame time. In an application running at 60 FPS, 60
corresponds to approximately one second.
A value to determine movement per unit time based on distance. Movement speed increases or decreases depending on the given conditions.
The specification calculates movement based on the measured distance to the target coordinate and the set time limit, so negative values cannot be assigned to the time limit.
Assigning 0
will cancel the movement.
Reserved.1
int
Assign 0
. Reserved area, not implemented in ASTER rev.1.0.x. Will be supported in future updates.
Motion Type
unsigned int
Assign 0
. Select uniform linear motion.
MoveTowards sub-motion type setting. ASTER rev.1.0.x does not support values other than 0. Future updates will add support.
Sleep Time
unsigned int
Sets the duration of movement suspension, application frame time. In an application running at 60 FPS, 60
corresponds to approximately one second.
Negative values cannot be assigned.
Sleep Repetition
int
Sets the number of times sleep resumes after it finishes. If sleep is not needed, assign 0
.
-1
results in an infinite loop.
Sleep Begin Flag
boolean
Flag to determine whether movement starts with sleep enabled when MoveTowards is executed.
If true
, sleep occurs first, then movement begins after sleep finishes.
If false
, movement starts immediately and pauses when the time comes.
Sleep Interval
unsigned int
Sets the duration before the next sleep pause after sleep has ended. Application frame time.
Negative values cannot be assigned.
Reserved.2
boolean
Assign false
.
Reserved area, not implemented in ASTER rev.1.0.x. Will be supported in future updates.
MoveTowards:TgtArr demonstration example
The above demonstration example can be created in about 7 lines from the Event Editor of CF25.