VisualMoveTo(Visual, Vector3, SpeedProfile) Method |
Move to a new location relative to another visual.
An acceleration or deceleration of zero is handled as infinity, meaning the top speed is instantly reached, and movement is immediately stopped respectively.
Namespace: Demo3D.VisualsAssembly: Demo3D.Core (in Demo3D.Core.dll) Version: 19.00.00
Syntaxpublic void MoveTo(
Visual targetVisual,
Vector3 targetLocation,
SpeedProfile speedProfile
)
Parameters
- targetVisual Visual
- The MoveTo will be relative to this visual's initial position and coordinate space.
If the visual to be moved is passed in here the movement will be relative to it's initial position.
If null is passed in here the MoveTo will be relative to the scene.
- targetLocation Vector3
- Location to move to relative to the targetVisual's coordinate space.
- speedProfile SpeedProfile
- Speed profile to use whilst moving.
Example
[Auto] SimpleVisualPropertyValue<Visual> target;
[Auto("OnClick")]
void MoveToVV3Sp_OnClick(Visual sender, PickInfo pickInfo)
{
var speed = new SpeedProfile(5, 2, 2);
sender.MoveTo(target.Visual, new Vector3(0, 1, 0), speed);
}
See Also