[ Maverik Level 1 functions ]

#

mav_viewParamsAnimateToSMS

## Summary

Animate a set of view parameters so that an SMS is visible.

## Syntax

void mav_viewParamsAnimateToObject(MAV_window *w, MAV_viewParams *vp, MAV_SMS *sms, float dist, float len, int unit);

- MAV_window *w
  Window in which to calculate the view.

- MAV_viewParams *vp
  View parameters to manipulate or `NULL` to animate the view parameters of `w`.

- MAV_SMS *sms
  Target SMS.

- float dist
  Distance multiplier from SMS.

- float len
  Length of animation (see below).

- int unit
  Units of `len` (see below)

## Description

This function animates the view parameters `vp` so that the objects in SMS `sms` are in view in window `w` (`vp` can be set to `NULL` if they are the view parameters already associated with `w`). The view parameters are translated (no rotation occurs) to a point such that the bounding sphere of `sms` fills the view of `w`. `dist` can be used to further multiple the offset distance. `len` defines the length of animation and `unit` the units of `val`. `unit` can be set to `MAV_ANIMATE_TIME` (`len` is then the number of seconds over which to animate); `MAV_ANIMATE_FRAME` (`len` is then the number of frames over which to animate) or `MAV_ANIMATE_DISTANCE` (`len` is then the distance traveled in each step of the animation). `unit` can further be bit-wised OR'd with `MAV_ANIMATE_LINEAR` (the default) to give a linear animation where each step has an equal increment; or `MAV_ANIMATE_S` to give an S-shaped curve where the animation starts slow, speeds up and then slows down. If `len` is negative then the view parameters are updated immediately.

Back to the index page.