cbox.h

来自「游戏编程精华02-含有几十个游戏编程例子」· C头文件 代码 · 共 76 行

H
76
字号
/* Copyright (C) Steven Woodcock, 2001. 
 * All rights reserved worldwide.
 *
 * This software is provided "as is" without express or implied
 * warranties. You may freely copy and compile this source into
 * applications you distribute provided that the copyright text
 * below is included in the resulting source code, for example:
 * "Portions Copyright (C) Steven Woodcock, 2001"
 */
//*********************************************************************
// Name:     CBox.h: 
// Purpose:  Class definitions and prototypes for the CBox class.
//*********************************************************************

#ifndef _CBOX_H
#define _CBOX_H

class CBox  
{

public:

   ///////////////////
   // static variables
   ///////////////////

   static CBox * WorldPtr;

   ///////////////////////////////
   // constructors and destructors
   ///////////////////////////////
   
   // Constructor #1.
   // Creates a Box with default values of 50 meters on any side 
   // not specified.

	CBox (float lv=50.0, float wv=50.0, float hv=50.0);

   // Destructor

   virtual ~CBox();

   ////////////////////
   // rendering methods
   ////////////////////

   void Draw (void);

   //////////////////////////
   // miscellaneous functions
   //////////////////////////

   // GetBoxLength.
   // Returns the length of the Box, in meters.

   float GetBoxLength (void);

   // GetBoxWidth..
   // Returns the width of the Box, in meters.

   float GetBoxWidth (void);

   // GetBoxHeight.
   // Returns the height of the Box, in meters.

   float GetBoxHeight (void);

private:

   float m_Length;
   float m_Width;
   float m_Height;

};

#endif

⌨️ 快捷键说明

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