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

📄 oasisproxy.h

📁 使用stl技术,(还没看,是听说的)
💻 H
字号:
/******************************************************************************

 * This source file is part of Bad Camel Gaming

 * Copyright (C) 2003  Zephie Greyvenstein

 * See Readme.html for acknowledgements

 *

 * This library is free software; you can redistribute it and/or

 * modify it under the terms of the GNU Lesser General Public

 * License as published by the Free Software Foundation; either

 * version 2.1 of the License, or (at your option) any later version.

 *

 * This library is distributed in the hope that it will be useful,

 * but WITHOUT ANY WARRANTY; without even the implied warranty of

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

 * Lesser General Public License for more details.

 *

 * You should have received a copy of the GNU Lesser General Public

 * License along with this library; if not, write to the Free Software

 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 *****************************************************************************/



/******************************************************************************

 * FILENAME    : oasisProxy.h

 * DESCRIPTION : A collision proxy

 * AUTHOR      : Zephie Greyvenstein

 *****************************************************************************/



/// Avoid double inclusion

#ifndef __PROXY_H__

#define __PROXY_H__



/// Include common stuff

#include "oasisCommon.h"

/// Include the rest of the needed oasis stuff

#include "oasisVector3.h"



/// Forward declare ODE stuff

class dGeom;



namespace Oasis {

  /// This is a collision proxy

  class _oasisExport proxy {

    /// Physics needs to control this object

    friend class physics;

  public:

    /// Proxy types

    enum ProxyType {

      /// Box proxy

      PT_BOX        = 0,

      /// Sphere proxy

      PT_SPHERE     = 1,

      /// Capped cylinder proxy

      PT_CCYLINDER  = 2

    };

    

    /// Destructor

    virtual ~proxy( );



    /// Get the type of proxy this is

    const ProxyType getType( void ) const;



    /// Get the offset of the proxy

    const vector3 &getOffset( void ) const;

    /// Set the offset

    void setOffset( real x, real y, real z, bool holdOffUpdate = false );

    /// Set the offset

    void setOffset( const vector3 &newOffset, bool holdOffUpdate = false );



    /// Enable this proxy

    void setEnabled( bool newState );

    /// Get enabled state of this proxy

    const bool getEnabled( void ) const;



  protected:

    /// Constructor

    proxy( ProxyType thisType );

   

    /// Enabled state of the proxy

    bool enabled;

    /// The collision proxy

    dGeom *odeProxy;

    /// The physics parent

    physics *thisParent;

    /// This type of proxy

    ProxyType type;

    /// The offset of the proxy

    vector3 offset;



    /// Allows the physics to update the position of the proxy

    void setPosition( const vector3 &newPosition );

    /// Allows the physics to update the orientation of the proxy

    void setOrientation( const quaternion &newOrientation );



    /// Set the parent data ( for collision )

    void setParent( physics *parent );

  };    

};



#endif

⌨️ 快捷键说明

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