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

📄 engine.i

📁 使用stl技术,(还没看,是听说的)
💻 I
📖 第 1 页 / 共 2 页
字号:

    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( );
  };
  //%name(getGraphicsSystem) graphicsSystem::get();  

  
  //oasisObjectResource.h
  class objectResource {
  public:
    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 : 
                public pool
                //public singleton< objectSystem > 
    {
  public:
    void reset( void );
    objectResource *getObjectTemplate( const string name );
    objectResource *createObjectTemplate( const string name ); 
    void removeObject( object *oldObject );
    void removeObject( const string objectName );
    object *createObject( const string objectName, 
                          const string templateName );

    object *getObject( const string objectName );
    static objectSystem &get( );
  };
  //%name(getObjectSystem) objectSystem::get();

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

    void setDynamicsEnabled( bool newState, bool newReenable = true );
    const bool getDynamicsEnabled( void ) const;
    
    void setCollisionEnabled( bool newState );
    const bool getCollisionEnabled( void ) const;
    mass *getMass( void ) const;

    boxProxy *addBoxProxy( real width, real height, real depth );
    sphereProxy *addSphereProxy( real radius );
    ccylinderProxy *addCCylinderProxy( real radius, real length );    

    void removeProxy( uint8 index );
    void removeProxy( proxy *oldProxy );
    void removeAllProxies( void );

    void setSoftness( const real newSoftness );
    const real getSoftness( void ) const;

    void setFriction( const real newFriction );   
    const real getFriction( void ) const;

    void setGravity( bool newState );
    const bool getGravity( void ) const;

    void setBounce( const real coEff, const real velThresh );
    const real getBounceCoEff( void ) const;
    const real getBounceVelThreshold( void ) const;    

    void setLinearVelocity( real x, real y, real z );
    void setLinearVelocity( const vector3 &velocity );
    const vector3 &getLinearVelocity( void ) const;

    void setAngularVelocity( real x, real y, real z );
    void setAngularVelocity( const vector3 &velocity );
    const vector3 &getAngularVelocity( void ) const;

    void addForce( real x, real y, real z, 
		   real rx = 0, real ry = 0, real rz = 0 );
    void addForceWorld( real x, real y, real z, real rx, real ry, real rz );   
    void addForce( const vector3 &force, 
		   const vector3 &position = vector3::ZERO );
    void addForceWorld( const vector3 &force, const vector3 &worldPos );

    void addTorque( real x, real y, real z );
    void addTorque( const vector3 &torque );
    void addTorqueWorld( real x, real y, real z );
    void addTorqueWorld( const vector3 &torque );
  };

  //oasisJoint.h
  class joint {
  public:
    //enums
    enum JointAxis {
      JA_PRIMARY    = 0,
      JA_SECONDARY  = 1
    };
    enum JointType {
      JT_BALL       = 0,
      JT_SLIDER     = 1,
      JT_HINGE      = 2,
      JT_HINGE2     = 3,
      JT_UNIVERSAL  = 4
    };
    /// Joint parameters
    enum JointParam {
      JP_LOSTOP        = 0,
      JP_HISTOP        = 1,
      JP_VELOCITY      = 2,
      JP_VELOCITY2     = 3,
      JP_FMAX          = 4,
      JP_FMAX2         = 5,
      JP_SUSPENSIONERP = 6,
      JP_SUSPENSIONCFM = 7
    };     
    //the rest

    const JointType getType( void ) const;

    void setAnchorPosition( real x, real y, real z );
    virtual void setAnchorPosition( const vector3 &origin ) = 0;
    virtual const vector3 &getAnchorPosition( void ) const;
    
    virtual void setAxes( const vector3 &primary, 
			  const vector3 &secondary = vector3::ZERO ) = 0;
    
    virtual void setParameter( JointParam param, real value ) = 0;
    virtual const real getParameter( JointParam param ) = 0;
    
    virtual const real getAxisAngle( JointAxis axis ) const = 0;
  };
  //oasisJoints.h
  class ballJoint : public joint {
  };
  class sliderJoint : public joint {
  };
  class hingeJoint : public joint {
  };
  class hinge2Joint : public joint {
  };
  class universalJoint : public joint {
  };

  //oasisProxy.h
  class proxy {
  public:
    enum ProxyType {
      PT_BOX        = 0,
      PT_SPHERE     = 1,
      PT_CCYLINDER  = 2
    };
    const ProxyType getType( void ) const;
    const vector3 &getOffset( void ) const;
    void setOffset( real x, real y, real z, bool holdOffUpdate = false );
    void setOffset( const vector3 &newOffset, bool holdOffUpdate = false );
    void setEnabled( bool newState );
    const bool getEnabled( void ) const;
  };
 
  //oasisProxies.h
  class boxProxy : public proxy {
  public:
    const real getLength( void ) const;
    const real getHeight( void ) const;
    const real getDepth( void ) const;
    void setBox( real newLength, real newHeight, real newDepth );
  };
  class sphereProxy : public proxy {
  public:
    const real getRadius( void ) const;
    void setSphere( real newRadius );
  };
  class ccylinderProxy : public proxy {
  public:
    const real getRadius( void ) const;
    const real getLength( void ) const;
    void setCCylinder( real newRadius, real newLength );
  };

  //oasisMass.h
  class mass {
  public:
    enum MassType {
      /// Box mass
      MT_BOX        = 0,
      /// Sphere mass
      MT_SPHERE     = 1,
      /// Capped cylinder mass
      MT_CCYLINDER  = 2,
      /// Cylinder mass
      MT_CYLINDER   = 3
    };
    
    void setBox( real newDensity, 
		 real newLength,
		 real newHeight,
		 real newDepth );
    void setSphere( real newDensity, real newRadius );
    void setCCylinder( real newDensity, real newRadius, real newLength );
    void setCylinder( real newDensity, real newRadius, real newLength );
    
    const MassType getType( void ) const;
    
    const real getDensity( void ) const;
    const real getLength( void ) const;
    const real getHeight( void ) const;
    const real getDepth( void ) const;
    const real getRadius( void ) const;
  };

  //oasisPhysicsResource.h
  class physicsResource {
  public:
    mass *getMass( void ) const;
    boxProxy *addBoxProxy( real width, real height, real depth );
    sphereProxy *addSphereProxy( real radius );
    ccylinderProxy *addCCylinderProxy( real radius, real length );    
    void removeProxy( uint8 index );
    void removeProxy( proxy *oldProxy );
    void removeAllProxies( void );

    void setSoftness( const real newSoftness );
    const real getSoftness( void ) const;
    
    void setFriction( const real newFriction );   
    const real getFriction( void ) const;
    
    void setGravity( bool newState );
    const bool getGravity( void ) const;

    void setBounce( const real coEff, const real velThresh );
    const real getBounceCoEff( void ) const;
    const real getBounceVelThreshold( void ) const;    
  };

  //oasisPhysicsSystem.h
  class physicsSystem : 
                public pool,
                public frameListener
                //public singleton< physicsSystem > 
    {
  public:
    void reset( void );
    physicsResource *getPhysicsTemplate( const string name );
    physicsResource *createPhysicsTemplate( const string name );    
    physics *createPhysics( const string physicsName, 
			    const string templateName );
    void removePhysics( physics *oldPhysics );
    void removePhysics( const string physicsName );
    physics *getPhysics( const string physicsName );

    joint *createJoint( joint::JointType type,
			const string name,
			physics *first, 
			physics *second );
    
    joint *getJoint( const string name );
    void removeJoint( const string name );
    void removeAllJoints( void );

    void setGravity( real x, real y, real z );
    void setGravity( const vector3 &newGravity );
    const vector3 &getGravity( void ) const;

    void setStepSize( const real newSize );
    const real getStepSize( void ) const;
    
    void setERP( const real newERP );
    const real getERP( void ) const;
    
    void setCFM( const real newCFM );
    const real getCFM( void ) const;
    static physicsSystem &get( );
  };
  
  //Sound
  //todo
  class mixer {
  };
  //oasisSound.h
  class sound {
    
  public:
    void setVolume( const real newVolume );
    const real getVolume( void ) const;

    void setLooping( const bool newLooping );
    const bool getLooping( void ) const;

    void play( void );
    void stop( void );
  
    const bool isPlaying( void ) const;

    protected:
    void setPosition( const vector3 &newPosition );
  };
  
  //oasisSoundResource.h
  class soundResource {
  public:
    void setFileName( const string name );
    const string getFileName( void ) const;
    
    void setVolume( const real newVolume );
    const real getVolume( void ) const;

    void setLooping( const bool newLooping );
    const bool getLooping( void ) const;

    void setAttenuationMax( real newMax );
    const real getAttenuationMax( void ) const;
  };

  //oasisSoundSystem.h
  class soundSystem : 
            public mixer,
            public pool
            //public singleton< soundSystem > 
    {
  public:
    void reset( void );
    soundResource *getSoundTemplate( const string name );
    soundResource *createSoundTemplate( const string name );    
    sound *createSound( const string soundName,
			              const string templateName );

    void removeSound( sound *oldSound );
    void removeSound( const string soundName );
    void stopAllSounds( void );
    
    void setListenerPosition( const vector3 &pos, 
			      const vector3 &forward = vector3::UNITZ,
			      const vector3 &up = vector3::UNITY ); 
    static soundSystem &get( );
  };
  //%name(getSoundSystem) soundSystem::get();

  //oasisObject.h
  class object : 
          public audible,
          public physical,
          public visible {
  public:
  };
}

⌨️ 快捷键说明

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