LEG.H
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:2k
- // (C) Copyright 1996 by Anthony J. Carin. All Rights Reserved.
- #ifndef LEG_H
- #define LEG_H
- #include "baseobj.h"
- #include "attach.h"
- #include "personal.h"
- class shin;
- class leg : public baseobject
- {
- public:
- leg(personal *p);
- ~leg();
- void setcolor(COLORREF c);
- void draw();
- void setto(view& c);
- void bendknee(float v);
- private:
- attachment *knee;
- shin *m_shin;
- };
- class foot;
- class shin : public baseobject
- {
- public:
- shin(personal *p);
- ~shin();
- void setcolor(COLORREF c);
- void draw();
- void setto(view& c);
- private:
- attachment *ankle;
- foot *m_foot;
- };
- class foot : public baseobject
- {
- public:
- foot(personal *p);
- ~foot();
- };
- class totalleg
- {
- public:
- totalleg(coordinate& offset, personal *p);
- ~totalleg();
- void setto(view& c) { legjoint->setto(c); }
- void setcolor(COLORREF c) { m_leg->setcolor(c); }
- void draw() { legjoint->draw(); }
- void raisefoward(float v);
- void raisebackward(float v);
- void raisesideward(float v);
- void bendknee(float v);
- private:
- attachment *legjoint;
- leg *m_leg;
- };
- inline void leg::bendknee(float v)
- {
- m_shin->setxposition((direction) (short)(TC_PI*v));
- }
- inline void totalleg::raisefoward(float v)
- {
- m_leg->setxposition((direction) (-TC_PI*v));
- }
- inline void totalleg::raisebackward(float v)
- {
- m_leg->setxposition((direction) (TC_PI*v));
- }
- inline void totalleg::raisesideward(float v)
- {
- m_leg->setzposition((direction) (TC_PI*v));
- }
- inline void totalleg::bendknee(float v)
- {
- m_leg->bendknee(v);
- }
- #endif