Open topic with navigation
<vizact>.goto
Create an action that will animate an object moving to the given position
<vizact>.goto( |
|
[x,y,z] |
value |
mode = SPEED |
rotate_mode = viz.NO_ROTATE |
pivot = [0,0,0] |
ori_mask = viz.HEAD_ORI |
) |
|
[x,y,z]
The absolute position to move the object to.
value
Depending on the given mode, this either specifies the velocity the object should move with or the amount of time it should take the object to reach its destination.
mode = SPEED
This can be either viz.SPEED or viz.TIME. If viz.SPEED is specified then the object will move at the velocity specified by 'value'. If viz.TIME is specified then the object will move to the location in the amount of time specified by 'value'
rotate_mode = viz.NO_ROTATE
Can be one of the following values:
viz.NO_ROTATE | While the viewpoint is moving it will not affect the rotation. |
viz.PIVOT_ROTATE | While the viewpoint is moving it will set the orientation to continuously look at the specified pivot point. |
viz.BLEND_ROTATE | While the viewpoint is moving it will blend the initial orientation to the final orientation(which will be looking at the pivot point). |
pivot = [0,0,0]
When applying the action to viewpoints and using a rotation mode, this controls the point for the view to look at.
ori_mask = viz.HEAD_ORI
When applying the action to viewpoints and using a rotation mode, this controls which transform to apply rotations to. Can be viz.HEAD_ORI or viz.BODY_ORI.
Remarks
After you have created the action you can add it to any object as many times as you want.
Return Value
An action that can be applied to any <node3d> object
Example
# Animate an object going to [0,0,20] at 5 meters per second.
action1 = vizact.goto(0,0,20,5)
# Animate an object going to [0,0,20] for 5 seconds.
action2 = vizact.goto(0,0,20,5,viz.TIME)