⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arm.h

📁 一个三维打斗游戏
💻 H
字号:
// (C) Copyright 1996 by Anthony J. Carin.  All Rights Reserved.

#ifndef ARM_H
#define ARM_H

#include "baseobj.h"
#include "attach.h"
#include "personal.h"

class forearm;

class arm : public baseobject
{
public:

         arm(personal *p);
        ~arm();
void     setcolor(COLORREF c);
void     setskincolor(COLORREF c);
void     draw();
void     setto(view& c);
void     bendelbow(float v);
view&    handloc();

private:

attachment *elbow;
forearm    *m_forearm;

};

class hand;

class forearm : public baseobject
{
public:
         forearm(personal *p);
        ~forearm();
void     setcolor(COLORREF c);
void     setskincolor(COLORREF c);
void     draw();
void     setto(view& c);
view&    handloc();

private:

attachment *wrist;
hand       *m_hand;

};

class hand : public baseobject
{
public:
         hand(personal *p);
        ~hand();
void     setskincolor(COLORREF c) { setcolor(c); }

};

class totalarm
{
public:
         totalarm(coordinate& offset, personal *p);
        ~totalarm();
void     setto(view& c)       { armjoint->setto(c); }
void     setcolor(COLORREF c) { m_arm->setcolor(c); }
void     draw()               { armjoint->draw(); }
void     setskincolor(COLORREF c) { m_arm->setskincolor(c); }
void     raisefoward(float v);
void     raisebackward(float v);
void     raisesideward(float v);
void     bendelbow(float v);
view&    handloc()            { return m_arm->handloc(); }

private:
attachment *armjoint;
arm        *m_arm;
};

inline void totalarm::raisesideward(float v)
{
    m_arm->setzposition((direction) (TC_PI*v));
}

inline void arm::bendelbow(float v)
{
    m_forearm->setxposition((direction) (short)(-TC_PI*v));
}

inline void totalarm::raisefoward(float v)
{
    m_arm->setxposition((direction) (-TC_PI*v));
}

inline void totalarm::raisebackward(float v)
{
    m_arm->setxposition((direction) (TC_PI*v));
}

inline void totalarm::bendelbow(float v)
{
    m_arm->bendelbow(v);
}

inline view& arm::handloc()
{
   return m_forearm->handloc();
}

inline view& forearm::handloc()
{
   return m_hand->location();
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -