📄 engine.pkg
字号:
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 );
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 {
//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 ) = 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 {
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 {
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 {
const real getRadius( void ) const;
void setSphere( real newRadius );
};
class ccylinderProxy : public proxy {
const real getRadius( void ) const;
const real getLength( void ) const;
void setCCylinder( real newRadius, real newLength );
};
//oasisMass.h
class mass {
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 resource {
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 {
static physicsSystem &get( void );
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;
//public pool
void clearPool( void );
const string &getPoolName( void ) const;
bool setPoolSize( uint16 newSize );
const uint16 getPoolSize( void ) const;
const string &getNextUniqueName( void );
};
//Sound
//todo
class mixer {
};
//oasisSound.h
class sound : public poolable {
void setVolume( const real newVolume );
const real getVolume( void ) const;
void setLooping( const bool newLooping );
const bool getLooping( void ) const;
// void setPosition( const vector3 &newPosition );
void play( void );
void stop( void );
const bool isPlaying( void ) const;
};
//oasisSoundResource.h
class soundResource {
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 {
static soundSystem &get( void );
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,
const vector3 &up);
//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 soundSystem &getSoundSystem @ soundSystem::get();
//oasisObject.h
class object {
//***LACK OF MULTIPLE INHERITANCE HURTS HERE!!
//(as you can tell by the all-caps screaming.)
//public 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 );
//public audio
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 );
//public physical
void enablePhysics( bool usePhysics );
void setPhysics( physics *physicsToUse );
physics *setPhysics( const string &templateName );
physics *getPhysics( void ) const;
void removePhysics( void );
void removeAndDestroyPhysics( void );
//public movable ( inherited from physical )
//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;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -