ARM.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 "arm.h"
- arm::arm(personal *p) : baseobject(p->upperarm())
- {
- coordinate tmp(0.0f,-0.4f*p->hight(),0.0f);
- elbow = new attachment(tmp);
- m_forearm = new forearm(p);
- elbow->attachto(m_forearm);
- }
- arm::~arm()
- {
- delete elbow;
- delete m_forearm;
- }
- void arm::setcolor(COLORREF c)
- {
- baseobject::setcolor(c);
- m_forearm->setcolor(c);
- }
- void arm::setskincolor(COLORREF c)
- {
- m_forearm->setskincolor(c);
- }
- void arm::draw()
- {
- baseobject::draw();
- elbow->draw();
- }
- void arm::setto(view& c)
- {
- baseobject::setto(c);
- elbow->setxoff(xposition);
- elbow->setyoff(yposition);
- elbow->setzoff(zposition);
- elbow->setto(c);
- }
- forearm::forearm(personal *p) : baseobject(p->lowerarm())
- {
- coordinate tmp(0.0f,-0.57f*p->hight(),0.0f);
- wrist = new attachment(tmp);
- m_hand = new hand(p);
- wrist->attachto(m_hand);
- }
- forearm::~forearm()
- {
- delete wrist;
- delete m_hand;
- }
- void forearm::setcolor(COLORREF c)
- {
- baseobject::setcolor(c);
- }
- void forearm::draw()
- {
- baseobject::draw();
- wrist->draw();
- }
- void forearm::setto(view& c)
- {
- baseobject::setto(c);
- wrist->setxoff(xposition);
- wrist->setyoff(yposition);
- wrist->setzoff(zposition);
- wrist->setto(c);
- }
- void forearm::setskincolor(COLORREF c)
- {
- m_hand->setskincolor(c);
- }
- hand::hand(personal *p) : baseobject(p->hand())
- {
- setcolor(RGB(240,200,0));
- }
- hand::~hand()
- {
- }
- totalarm::totalarm(coordinate& offset, personal *p)
- {
- armjoint = new attachment(offset);
- m_arm = new arm(p);
- armjoint->attachto(m_arm);
- }
- totalarm::~totalarm()
- {
- delete m_arm;
- delete armjoint;
- }