ATTACH.CPP
资源名称:tc3d.zip [点击查看]
上传用户:abcdshs
上传日期:2007-01-07
资源大小:1858k
文件大小:1k
源码类别:
游戏
开发平台:
Visual C++
- // (C) Copyright 1996 by Anthony J. Carin. All Rights Reserved.
- #include "stdafx.h"
- #include "attach.h"
- attachment::attachment(coordinate& offset)
- {
- m_offset = offset;
- m_attachedto = 0;
- }
- void attachment::setto(view& c)
- {
- point tmpp;
- tmpp.setto(m_offset);
- view tmpc;
- tmpp.xrotate(c.xdirection()+xoff);
- tmpp.zrotate(c.zdirection()+zoff);
- tmpp.yrotate(c.ydirection()+yoff);
- tmpc = c;
- tmpc += tmpp;
- tmpc.setxdir(tmpc.xdirection()+xoff);
- tmpc.setydir(tmpc.ydirection()+yoff);
- tmpc.setzdir(tmpc.zdirection()+zoff);
- if (m_attachedto)
- m_attachedto->setto(tmpc);
- }
- void attachment::draw()
- {
- if (m_attachedto)
- m_attachedto->draw();
- }