Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
NodeObject.h
Package: g.rar [view]
Upload User: laitongbao
Upload Date: 2021-02-20
Package Size: 8176k
Code Size: 3k
Category:
Shot Game
Development Platform:
Visual C++
- #pragma once
- #include "CGLApplication.h"
- #include "VECTOR.h"
- #include "CGLDEF.h"
- /*********************************************************************************
- 节点类,所有网格物体的基础类,包含很多共有的基本函数
- *********************************************************************************/
- class NodeObject
- {
- friend class TransitionController;
- friend class ShaderController;
- friend class FileController;
- friend class SceneTree;
- friend class AnimationController;
- friend class Force;
- friend class P_Force;
- friend class Resistance;
- friend class P_Resistance;
- friend class CollisionDetector;
- public:
- NodeObject(NodeObject &obj);
- NodeObject(TCHAR* name, VECTOR3 pos);
- virtual ~NodeObject() ;
- void SetName(TCHAR* name);
- TCHAR* GetName()const;
- void SetVisible(bool visible){m_visible=visible;};
- void SetMass(float mass){this->mass = mass;};
- float GetMass(){return mass;};
- void SetVelocity(VECTOR3 vel);
- VECTOR3 GetVelocity();
- void SetRotateVelocity(VECTOR3 vel);
- VECTOR3 GetRotateVelocity();
- virtual void CleanUp(){};
- OBJ_TYPE GetType()const{return m_type;}
- inline NodeObject* GetParent()const{return m_pParent;}
- inline NodeObject* GetChild()const{return m_pChild;}
- inline NodeObject* GetNext()const{return m_pNext;}
- inline NodeObject* GetPrev()const{return m_pPrev;}
- virtual void DrawObject(){}; //用于绘制虚拟物体线框(如摄像机,灯光,离子发射器)
- virtual void PreDraw(){}; //用于设置网格以外物体的渲染状态(网格及其贴图的渲染状态由ShaderController设置)
- VECTOR3 GetWorldPos(){return gpos;}
- VECTOR3 GetWorldVel(){return gvel;}
- protected:
- NodeObject* FindObject( TCHAR* strName);
- TCHAR* m_strName; //物体名字
- OBJ_TYPE m_type; //物体种类
- NodeObject *m_pChild; //子物体
- NodeObject *m_pParent; //父物体
- NodeObject *m_pNext; //下一个物体
- NodeObject *m_pPrev; //上一个物体
- bool m_visible; //物体可见性
- VECTOR3 pos; //局部位置
- VECTOR3 gpos; //全局位置
- VECTOR3 rot; //局部旋转
- VECTOR3 scale; //局部缩放
- VECTOR3 vel; //物体速度
- VECTOR3 gvel; //全局速度
- VECTOR3 rot_vel; //物体旋转速度
- D3DXMATRIX matrix; //转换矩阵
- float mass; //质量
- public:
- float angle;//旋转时用到的角度
- };