MoveTowards: SWAP.TGT
ASTER::ACTION::MotionControl::MoveTowards: Swap pos of pair within mvt.Target
Based on the selection order of mvt.Tgt, a pair is created, and the positions of each instance are swapped within the time limit.
The “SWAP.TGT” in MoveTowards creates a 1-to-1 pair of instances selected as mvt.Target in order of selection and swaps the positions of the paired instances within a specified time limit.
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 Using
The action of creating a pair of instances and swapping their positions within a time limit is defined as
MoveTowards: Swap
.
There are two methods to create a Swap pair, and dedicated motion templates are prepared depending on the method of pair creation.
Definition of Pair | Motion Template Name | Description |
---|---|---|
mvt.Tgt only | Swap Tgt | Create a pair by selecting two instances |
mvt.Tgt and mvt.Prs | Swap EPs | Divide selection into target and pursuer to create a pair |
The selection of mvt.Target
and mvt.Pursuer
utilizes the tool MvtUtil designed for MoveTowards.
- Relevant URL : Tags.MvtUtil
Note
The selection order of mvt.Target and mvt.Pursuer is remembered, and pairs are created based on the selection order.
In the specifications of Swap Eps, if pairs are created and there is a remainder, the unpaired instances are skipped from processing.
In the specifications of Swap Tgt, exactly 2 instances must be selected; it will not function if the selection count is 0
, 1
, or 3
or more.
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: Swap Tgt demonstration example