[ Maverik Level 1 functions ]


mav_viewParamsAnimateToObject

Summary

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


Syntax

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


Description

This function animates the view parameters vp so that object o is 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 o 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.