1 /* xscreensaver, Copyright (c) 1998-2002 Jamie Zawinski <jwz@jwz.org>
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
15 typedef struct rotator rotator;
17 /* Returns a rotator object, which encapsulates rotation and motion state.
19 spin_[xyz]_speed indicates the relative speed of rotation.
20 Specify 0 if you don't want any rotation around that axis.
22 spin_accel specifies a scaling factor for the acceleration that is
23 randomly applied to spin: if you want the speed to change faster,
26 wander_speed indicates the relative speed through space.
28 If randomize_initial_state_p is true, then the initial position and
29 rotation will be randomized (even if the spin speeds are 0.) If it
30 is false, then all values will be initially zeroed.
32 extern rotator *make_rotator (double spin_x_speed,
37 int randomize_initial_state_p);
39 /* Rotates one step, and returns the new rotation values.
40 x, y, and z range from 0.0-1.0, the fraction through the circle
41 (*not* radians or degrees!)
42 If `update_p' is non-zero, then (maybe) rotate first.
44 extern void get_rotation (rotator *rot,
45 double *x_ret, double *y_ret, double *z_ret,
48 /* Moves one step, and returns the new position values.
49 x, y, and z range from 0.0-1.0, the fraction through space:
50 scale those values as needed.
51 If `update_p' is non-zero, then (maybe) move first.
53 extern void get_position (rotator *rot,
54 double *x_ret, double *y_ret, double *z_ret,
57 /* Destroys and frees a `rotator' object. */
58 extern void free_rotator (rotator *r);
60 #endif /* __ROTATOR_H__ */