LEG.CPP
资源名称:tc3d.zip [点击查看]
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:2k
源码类别:
游戏
开发平台:
Visual C++
- // (C) Copyright 1996 by Anthony J. Carin. All Rights Reserved.
- #include "stdafx.h"
- #include "leg.h"
- leg::leg(personal *p) : baseobject(p->thigh())
- {
- coordinate tmp(0.0f,-0.5f*p->hight(),0.0f);
- knee = new attachment(tmp);
- m_shin = new shin(p);
- knee->attachto(m_shin);
- }
- leg::~leg()
- {
- delete knee;
- delete m_shin;
- }
- void leg::setcolor(COLORREF c)
- {
- baseobject::setcolor(c);
- m_shin->setcolor(c);
- }
- void leg::draw()
- {
- baseobject::draw();
- knee->draw();
- }
- void leg::setto(view& c)
- {
- baseobject::setto(c);
- knee->setxoff(xposition);
- knee->setyoff(yposition);
- knee->setzoff(zposition);
- knee->setto(c);
- }
- shin::shin(personal *p) : baseobject(p->lowerleg())
- {
- coordinate tmp(0.0f,-0.5f*p->hight(),0.0f);
- ankle = new attachment(tmp);
- m_foot = new foot(p);
- ankle->attachto(m_foot);
- }
- shin::~shin()
- {
- delete ankle;
- delete m_foot;
- }
- void shin::setcolor(COLORREF c)
- {
- baseobject::setcolor(c);
- }
- void shin::draw()
- {
- baseobject::draw();
- ankle->draw();
- }
- void shin::setto(view& c)
- {
- baseobject::setto(c);
- ankle->setxoff(xposition);
- ankle->setyoff(yposition);
- ankle->setzoff(zposition);
- ankle->setto(c);
- }
- foot::foot(personal *p) : baseobject(p->foot())
- {
- setcolor(RGB(10,10,10));
- }
- foot::~foot()
- {
- }
- totalleg::totalleg(coordinate& offset, personal *p)
- {
- legjoint = new attachment(offset);
- m_leg = new leg(p);
- legjoint->attachto(m_leg);
- }
- totalleg::~totalleg()
- {
- delete m_leg;
- delete legjoint;
- }