glo-gear

Name

glo-gear -- A 3D GLobject gear type.

Synopsis


#include <ogltk/gear.h>


struct      glo_gear;
GLobject*   glo_gear_new                    (gfloat inner_radius,
                                             gfloat outer_radius,
                                             gfloat width,
                                             gint teeth,
                                             gfloat tooth_depth);
gboolean    glo_gear_set_inner_radius       (glo_gear *gear,
                                             gfloat inner);
gboolean    glo_gear_set_outer_radius       (glo_gear *gear,
                                             gfloat outer);
gboolean    glo_gear_set_width              (glo_gear *gear,
                                             gfloat width);
gboolean    glo_gear_set_teeth              (glo_gear *gear,
                                             gint teeth);
gboolean    glo_gear_set_tooth_depth        (glo_gear *gear,
                                             gfloat depth);
gfloat      glo_gear_get_inner_radius       (glo_gear *gear);
gfloat      glo_gear_get_outer_radius       (glo_gear *gear);
gfloat      glo_gear_get_width              (glo_gear *gear);
gint        glo_gear_get_teeth              (glo_gear *gear);
gfloat      glo_gear_get_tooth_depth        (glo_gear *gear);

Description

Details

struct glo_gear

struct glo_gear {

    GLobject             parent_instance;

    /* Properties */
    gfloat              inner_radius;
    gfloat              outer_radius;
    gfloat              width;
    gint                teeth;
    gfloat              tooth_depth;    
};


glo_gear_new ()

GLobject*   glo_gear_new                    (gfloat inner_radius,
                                             gfloat outer_radius,
                                             gfloat width,
                                             gint teeth,
                                             gfloat tooth_depth);

Create an instance of a 3D gear object.

inner_radius :

Radius of the outer edge of the gear.

outer_radius :

Radius of the middle space of the gear.

width :

Width of the gear

teeth :

How many teeth (total) on the gear

tooth_depth :

How high is each tooth.

Returns :

Instance of a 3D gear as type GLobject.


glo_gear_set_inner_radius ()

gboolean    glo_gear_set_inner_radius       (glo_gear *gear,
                                             gfloat inner);

Set the space (hollow) in the middle part of the gear.

gear :

Gear GLobject

inner :

Inner Radius of the gear

Returns :

True if the inner radius was set.


glo_gear_set_outer_radius ()

gboolean    glo_gear_set_outer_radius       (glo_gear *gear,
                                             gfloat outer);

Set the radius of the entire wheel (not including) the size of the teeth

gear :

Gear GLobject

outer :

Total size of the gear

Returns :

True if the the outer radius has been set.


glo_gear_set_width ()

gboolean    glo_gear_set_width              (glo_gear *gear,
                                             gfloat width);

Set the thickness of the gear (wheel).

gear :

Gear GLobject

width :

The width of the gear.

Returns :

True if the width was set.


glo_gear_set_teeth ()

gboolean    glo_gear_set_teeth              (glo_gear *gear,
                                             gint teeth);

Set the total number of teeth which will circle the outter edge of the gear.

gear :

Gear GLobject

teeth :

Number of teeth for the gear.

Returns :


glo_gear_set_tooth_depth ()

gboolean    glo_gear_set_tooth_depth        (glo_gear *gear,
                                             gfloat depth);

Set the height of each tooth on the gear.

gear :

Gear GLobject

depth :

Height of each tooth.

Returns :

True if the depth was set.


glo_gear_get_inner_radius ()

gfloat      glo_gear_get_inner_radius       (glo_gear *gear);

Get the inner radius size of the gear.

gear :

Gear GLobject

Returns :

The inner radius as a float


glo_gear_get_outer_radius ()

gfloat      glo_gear_get_outer_radius       (glo_gear *gear);

Get the outer radius size of the gear.

gear :

Gear GLobject

Returns :

The outer radius as a float


glo_gear_get_width ()

gfloat      glo_gear_get_width              (glo_gear *gear);

Get the width size of the gear.

gear :

Gear GLobject

Returns :

The width as a float


glo_gear_get_teeth ()

gint        glo_gear_get_teeth              (glo_gear *gear);

Get the number of teeth on the gear.

gear :

Gear GLobject

Returns :

The number of teeth as an signed integer.


glo_gear_get_tooth_depth ()

gfloat      glo_gear_get_tooth_depth        (glo_gear *gear);

Get the depth of each tooth on the gear.

gear :

Gear GLobject

Returns :

The size a a float.