/*
 GNU Maverik - a system for managing display and interaction in 
               Virtual Environment applications.
 Copyright (C) 1999 Advanced Interfaces Group

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA


 The authors can be contacted via:
 www   - http://aig.cs.man.ac.uk
 email - maverik@aig.cs.man.ac.uk
 mail  - Advanced Interfaces Group, Room 2.90, Computer Science Building, 
         University of Manchester, Manchester, M13 9PL, UK
*/


#include "maverik.h"
#include "mavlib_avatar.h"
#include <stdlib.h>

MAVLIB_avatarCurves *mavlib_avatarCurve1;



/* Routines to initialise the module */

char *mav_avatarModuleID(void)
{
  return "Avatar";
}

int mav_avatarModuleInit(void)
{
  /* Add the new module */
  mav_moduleNew(mav_avatarModuleID);

  /* Create new object class and set callbacks */
  mav_class_avatar= mav_classNew();
  mav_callbackDrawSet(mav_win_all, mav_class_avatar, mav_avatarDraw);
  mav_callbackBBSet(mav_win_all, mav_class_avatar, mav_avatarBB2);
  mav_callbackIntersectSet(mav_win_all, mav_class_avatar, mav_avatarIntersect);
  mav_callbackIDSet(mav_win_all, mav_class_avatar, mav_avatarID);
  mav_callbackGetUserdefSet(mav_win_all, mav_class_avatar, mav_avatarGetUserdef);
  mav_callbackGetMatrixSet(mav_win_all, mav_class_avatar, mav_avatarGetMatrix);
  mav_callbackGetSurfaceParamsSet(mav_win_all, mav_class_avatar, mav_avatarGetSurfaceParams);
  mav_callbackDumpSet(mav_win_all, mav_class_avatar, mav_avatarDump);
  
  /* Read in avatar animation curves */
  mavlib_avatarCurve1= mavlib_avatarReadCurves("walking.cset");
  if (!mavlib_avatarCurve1) exit(1);

  return 1;
}



