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.


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)
The unsupported parameters will be addressed in an update. rev.1.0.4

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.


Regarding registration limits and reserved variables »

Maximum Number of Registrations Allowed

The maximum number of instances that can be registered in one motion group is 255. A motion group can register up to 255 groups per motion type.

Type Max Groups Max Instances (Per Group) Total Instances (Per Motion Type)
Null 255 255 255 x 255 = 65,025
Flp | Wrp 255 255 255 x 255 = 65,025
Flp | Wrp::SineWave 255 255 255 x 255 = 65,025
Orbital 255 255 255 x 255 = 65,025
MoveTowards 255 255 255 x 255 = 65,025

The above values are theoretical and exceed the processing capability of CF25, so operation will always be conducted below the maximum values.

Practically, it is assumed that all registered motions will operate with a total number of instances below 100.


About Reserved Variables

From the object instance variables, the reserved variables are as follows:

  1. Alt Variable[0] = Spread ID

  2. Alt Variable[1] = Motion ID

The above variables are used.

Alt Variable[0]

Sequential number. The last object instance created on the frame editor is assigned 0, and then each instance is assigned a value incremented by +1 in order. It is safe to overwrite with any value.

Alt Variable[1]

Motion type. Values ranging from 0 to 4 are assigned according to the motion type at the time of registration. It is a magic number to speed up database searches. If changed, the controller will not be able to search correctly, which is dangerous.

From rev.0.9.x onward, a method of not using Alt Variable[1] has been tested, and it is not used now, but it may be reverted, so please treat Alt Variable[1] as a reserved variable.


MoveTowards: Swap Tgt demonstration example