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

📄 engine.pkg

📁 使用stl技术,(还没看,是听说的)
💻 PKG
📖 第 1 页 / 共 2 页
字号:
//This is a tolua package.
//http://www.tecgraf.puc-rio.br/~celes/tolua/
//Author: Gaw (garcia@cs.ttu.edu)

//Note from author:
//Some parts of this are ghastly because of what seems to be 
//tolua++'s lack of support for multiple inheritance

$#include "oasisCommon.h"
$#include "oasisVector3.h"
$#include "oasisQuaternion.h"
$#include "oasisColour.h"
$#include "oasisFrameListener.h"
$#include "oasisResource.h"
$#include "oasisResourceManager.h"
$#include "oasisSystem.h"
$#include "oasisMovable.h"
$#include "oasisSingleton.h"
$#include "oasisPool.h"
$#include "oasisPoolable.h"
$#include "oasisAudible.h"
$#include "oasisPhysical.h"
$#include "oasisVisible.h"
$#include "oasisCameraSystem.h"
$#include "oasisFrameListenerSystem.h"
$#include "oasisGraphicsSystem.h"
$#include "oasisObjectResource.h"
$#include "oasisObjectSystem.h"
$#include "oasisPhysics.h"
$#include "oasisJoint.h"
$#include "oasisJoints.h"
$#include "oasisProxy.h"
$#include "oasisProxies.h"
$#include "oasisPhysicsResource.h"
$#include "oasisMass.h"
$#include "oasisPhysicsSystem.h"
$#include "oasisSound.h"
$#include "oasisSoundResource.h"
$#include "oasisSoundSystem.h"
$#include "oasisObject.h"
$#include "oasisEntity.h"

$using namespace Oasis;

  
  typedef float real;
  typedef unsigned char uint8;
  typedef char int8;
  typedef unsigned short uint16;
  typedef short int16;
  typedef unsigned long uint32;
  typedef long int32;
  
  typedef time_t timestamp;
  typedef uint32 size;

  //oasisVector3
  class vector3 {
    real x;
    real y;
    real z;
    vector3( real fx, real fy, real fz );
    vector3( );
    vector3 operator + ( const vector3& rkVector );
    vector3 operator - ( const vector3& rkVector );
    vector3 operator - ( );
    vector3 operator * ( real fScalar );
    vector3 operator * ( const vector3& rhs);
    vector3 operator / ( real fScalar );
    /*vector3& operator += ( const vector3& rkVector ); 
    vector3& operator -= ( const vector3& rkVector );
    vector3& operator *= ( real fScalar );
    vector3& operator /= ( real fScalar );*/
    static const vector3 ZERO;
    static const vector3 UNITX;
    static const vector3 UNITY;
    static const vector3 UNITZ;
    static const vector3 UNITSCALE;
  };

  //oasisQuaternion
  class quaternion {
    real w;
    real x;
    real y;
    real z;
    quaternion( );
    quaternion( real fw, real fx, real fy, real fz);
    static const quaternion ZERO;
    static const quaternion IDENTITY;

  };
 
  //oasisResource.h
  class resource {
  };

  //oasisFrameListener.h
  class frameListener {
  };
 
  //oasisResourceManager.h
  class resourceManager {
  };

  //oasisColour.h
  class colour {
    real red;
    real green;
    real blue;
    real alpha;
    colour( real r, real g, real b, real a );
    colour( );
  };
  
  //oasisSystem.h
  class system {
  };
  
  //oasisMovable.h
  class movable {
    void setPosition( real x, real y, real z );
    virtual void setPosition( const vector3 &position );
    const vector3 &getPosition( void ) const;

    void move( real x, real y, real z );
    void move( const vector3 &moveVector );
    void moveRelative( real x, real y, real z );
    void moveRelative( const vector3 &moveVector );

    void rotate( real x, real y, real z, real degrees );
    void rotate( const vector3 &axis, real degrees );
    void rotate( const quaternion &rotation );

    virtual void setOrientation( const quaternion &newOrientation );
    const quaternion &getOrientation( void ) const;
    vector3 getDirection( void ) const;    
  };

  //oasisScriptable.h -- Todo: obsolete
  class scriptable {
  };
  
  //oasisSingleton.h
//  class singleton {
//    TEMPLATE_BIND( T, cameraSystem, frameListenerSystem, graphicsSystem, objectSystem, physicsSystem, soundSystem ) 
 //   static T &get( );
 // };
 //todo uint32 uint16... 
  //oasisPool.h
  class pool {
    void clearPool( void );
    const string &getPoolName( void ) const;
    bool setPoolSize( uint16 newSize );
    const uint16 getPoolSize( void ) const;
    const string &getNextUniqueName( void );
  };
  
  //oasisPoolable.h
  class poolable {
  };
  
  //oasisAudible.h
  class audible {
    sound *addSound( const string &name, const string &templateName );
    void addSound( const string &name, sound *soundObject );

    sound *getSound( const string &name );
    sound *playSound( const string &name );
    sound *stopSound( const string &name );
    void stopAllSounds( void );

    void removeAllSounds( void );
    void removeAndDestroyAllSounds( void );

    void removeSound( const string &name );
    void removeAndDestroySound( const string &name );    
  };
  
  //oasisPhysical.h
  class physical : public movable {
    void enablePhysics( bool usePhysics );

    void setPhysics( physics *physicsToUse );
    physics *setPhysics( const string &templateName );
    physics *getPhysics( void ) const;

    void removePhysics( void );
    void removeAndDestroyPhysics( void );
  };

  //oasisVisible.h
  class visible {
    void scale( real x, real y, real z );
    void scale( const vector3 &newscale );

    void setScale( real x, real y, real z );
    void setScale( const vector3 &newScale );
    const vector3 &getScale( void ) const;

    entity *setEntity( const string &entityToUse );
    void setEntity( entity *entityToUse );
    entity *getEntity( void ) const;

    void removeEntity( void );
    void removeAndDestroyEntity( void );

  };

  //oasisCameraSystem.h
  class cameraSystem {
   void reset( void );
   void setSoundListener( bool isListener );
   void setDirection( real x, real y, real z );
   void setDirection( const vector3 &newDirection );
   void lookAt( const object *target );
   void lookAt( real x, real y, real z ); 
   void lookAt( const vector3 &target );
   static cameraSystem &get( void );

  //public movable
    void setPosition( real x, real y, real z );
    void setPosition( const vector3 &position );
    const vector3 &getPosition( void ) const;

    void move( real x, real y, real z );
    void move( const vector3 &moveVector );
    void moveRelative( real x, real y, real z );
    void moveRelative( const vector3 &moveVector );

    void rotate( real x, real y, real z, real degrees );
    void rotate( const vector3 &axis, real degrees );
    void rotate( const quaternion &rotation );

    void setOrientation( const quaternion &newOrientation );
    const quaternion &getOrientation( void ) const;
    vector3 getDirection( void ) const;    
  };
//TODO FIX cameraSystem &getCameraSystem @ cameraSystem::get(); 
  
  //oasisFrameListenerSystem.h
  class frameListenerSystem {
    void reset( void ); 
    void setTimeScale( real scale );
    const real getTimeScale( void ) const;
    static frameListenerSystem &get( void );
  };
 //TODO FIX  frameListenerSystem &getFrameListenerSystem @ frameListenerSystem::get(); 
  
  class entity : public poolable {
    void setAllMaterials( const string &materialName );
  };

  //oasisGraphicsSystem.h
  class graphicsSystem {
                
    enum DetailLevel {
        DL_POINTS       = 0,
        DL_WIREFRAME    = 1,
        DL_SOLID        = 2
    }

    enum FogMode {
        FM_NONE     = 0,
        FM_EXP      = 1,
        FM_EXP2     = 2,
        FM_LINEAR   = 3
    }

    void reset( void );
    
    void setSkyBox( bool active,
            const string &material,
            real distance = 7000,
            bool drawFirst = true );

    void setFog( FogMode fogMode, 
            const colour &fogColour, 
            real  expDensity = 0.001,
            real linearStart = 0,
            real linearEnd = 1 );

    void setBackgroundColour( real r, real g, real b );
    void setBackgroundColour( const colour &newColour );

    void setAmbientLight( real r, real g, real b );
    void setAmbientLight( const colour &newColour );

    void takeShot( const string &filename );
    void takeShot( void );

    void setDetailLevel( const DetailLevel newLevel );
    
    entity *createEntity( const string &entityName,
            const string &meshname );

    void removeEntity( const string &entityName );
    entity *getEntity( const string &entityName );
    static graphicsSystem &get( void );
    
    //public pool
    void clearPool( void );
    const string &getPoolName( void ) const;
    bool setPoolSize( uint16 newSize );
    const uint16 getPoolSize( void ) const;
    const string &getNextUniqueName( void );

  };
//TODO FIX   graphicsSystem &getGraphicsSystem @ graphicsSystem::get();  

  
  //oasisObjectResource.h
  class objectResource {
    void setScale( real x, real y, real z );
    void setScale( const vector3 &newScale );
    const vector3 &getScale( void ) const;
    
    void setEntity( const string &newMesh );    
    const string &getEntity( void ) const;
    
    void addSound( const string &name, const string &templateName );
    void removeAllSounds( void );  
    void removeSound( const string &name );

    void setPhysics( const string &newPhysics );
    const string &getPhysics( void ) const;
    void removePhysics( void );
  };

  //oasisObjectSystem.h
  class objectSystem {
    void reset( void );
    objectResource *getObjectTemplate( const string &name );
    object *createObject( const string &objectName,
                        const string &templateName );
    objectResource *createObjectTemplate( const string &name ); 
    void removeObject( object *oldObject );
    void removeObject( const string &objectName );
    object *getObject( const string &objectName );
    static objectSystem &get( void );
    
    //multiple inheritance bug
    void clearPool( void );
    const string &getPoolName( void ) const;
    bool setPoolSize( uint16 newSize );
    const uint16 getPoolSize( void ) const;
    const string &getNextUniqueName( void );
  };
  static objectSystem &getObjectSystem( );
//TODO FIX   objectSystem &getObjectSystem @ objectSystem::get();

  //oasisPhysics.h: 
  class physics {
    void updateProxies( void );

⌨️ 快捷键说明

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