3IMPACT C++ FUNCTIONS REFERENCE
(USE INDEX BELOW OR PRESS CTRL+F TO SEARCH THIS DOCUMENT FOR SPECIFIC INFORMATION)


QUICK-START TUTORIAL IS HERE
ONLINE COMMUNITY IS HERE
DOCUMENTATION HOME PAGE IS HERE


OVERVIEW
MAIN FUNCTIONS - DLL VERSION ONLY
 i3ImpactOpen()
 i3ImpactSettings()
 i3ImpactMain()
 i3ImpactInitBegin()
 i3ImpactInitEnd()
 i3ImpactRunBegin()
 i3ImpactRunEnd()
 i3ImpactRender()
 i3ImpactExitBegin()
 i3ImpactExitEnd()
 i3ImpactClose()
 i3ImpactIsRendering()
 i3ImpactIsActive()
 i3ImpactIsReady()
 i3ImpactIsExecuting()
 i3ImpactIsInitializing()
 i3ImpactIsSkippingRunPhase()
 i3ImpactIsSkippingRenderPhase()
 i3ImpactErrorFlag()
 i3ImpactIsRenderingSet()
 i3ImpactIsActiveSet()
 i3ImpactIsReadySet()
 i3ImpactIsExecutingSet()
 i3ImpactIsInitializingSet()
 i3ImpactIsSkippingRunPhaseSet()
 i3ImpactIsSkippingRenderPhaseSet()
 i3ImpactErrorFlagSet()
 i3ImpactPreRenderCallbackSet()
CAMERA
 iCameraCreate()
 iCameraDestroy()
 iCameraHide()
 iCameraShow()
 iCameraSet()
 iCameraFovSet()
 iCameraFov()
 iCameraClipDistanceSet()
 iCameraLookAt()
 iCameraEulerOrientationSet()
 iCameraOrientationSet()
 iCameraOrientation()
 iCameraLocationSet()
 iCameraLocation()
 iCameraAutoWipeSet()
 iCameraSpritesOnlySet()
 iCameraMirrorEnable()
 iCameraPreRenderCallbackEnable()
 iCameraVelocitySet()
 iCameraEffectCreate()
 iCameraEffectDestroy()
 iCameraEffectSet()
 iCameraEffectValueSet()
 iCameraEffectTextureSet()
LIGHT
 iLightDirectionalSet()
 iLightLocalLocationSet()
 iLightDirectionalColor()
 iLightLocalColorSet()
SKYBOX
 iSkyBoxCreate()
 iSkyBoxDestroy()
 iSkyBoxHide()
 iSkyBoxShow()
 iSkyBoxColorSet()
 iSkyBoxEnvMapCasterAdd()
 iSkyBoxEnvMapCasterRemove()
BODY
 iBodyCreate()
 iBodyCreateFromMemory()
 iBodySGCreate()
 iBodySGCreateFromMemory()
 iBodySphereCreate()
 iBodyDestroy()
 iBodyDisable()
 iBodyEnable()
 iBodyStatus()
 iBodyMeshCreate()
 iBodyMeshPartCreate()
 iBodyMeshCreateFromMemory()
 iBodyMeshPartCreateFromMemory()
 iBodySkinMeshCreate()
 iBodySkinMeshCreateFromMemory()
 iBodyMeshBumpCreate()
 iBodyMeshBumpCreateFromMemory()
 iBodyMassModelSet()
 iBodyMassSet()
 iBodySurfaceStickinessSet()
 iBodySurfaceDriveSet()
 iBodyEulerOrientationSet()
 iBodyOrientationSet()
 iBodyOrientationSeek()
 iBodyOrientation()
 iBodyYaw()
 iBodyPitch()
 iBodyRoll()
 iBodyEulerOrientationAdd()
 iBodyOrientationAdd()
 iBodyLocationSet()
 iBodyLocationCMSet()
 iBodyLocation()
 iBodyPreviousLocation()
 iBodyLocationCM()
 iBodyLocationAdd()
 iBodyCMOffset()
 iBodySpinSet()
 iBodySpin()
 iBodyVelocitySet()
 iBodyVelocity()
 iBodyKmh()
 iBodyPointVelocity()
 iBodyDampingSet()
 iBodyDamping2Set()
 iBodyDirectionalAngularDampingSet()
 iBodyDirectionalLinearDampingSet()
 iBodyTorqueApply()
 iBodyAngularAccelerationApply()
 iBodyForceApply()
 iBodyAccelerationApply()
 iBodyPhysicsReset()
 iBodySphereCount()
 iBodySphere()
 iBodySphereCenter()
 iBodySphereRadius()
 iBodyScan()
 iBodyEnteringMesh()
 iBodyExitingMesh()
BODYBODY
 iBodyBodyCreate()
 iBodyBodyDestroy()
 iBodyBodyEnable()
 iBodyBodyCollisionResponseEnable()
 iBodyBodyRestitutionSet()
 iBodyBodyFrictionSet()
 iBodyBodyFrictionModelSet()
 iBodyBodySplitFrictionSet()
 iBodyBodySubpartRestitutionSet()
 iBodyBodySubpartFrictionSet()
 iBodyBodySubpartFrictionModelSet()
 iBodyBodySubpartSplitFrictionSet()
 iBodyBodyFeedbackEnable()
 iBodyBodyFeedback()
JOINTS
 iJointBallCreate()
 iJointHingeCreate()
 iJointSliderCreate()
 iJointDestroy()
 iJointBallXStopsSet()
 iJointBallYStopsSet()
 iJointBallZStopsSet()
 iJointBallXAMotorSet()
 iJointBallYAMotorSet()
 iJointBallZAMotorSet()
 iJointBallOrientationSet()
 iJointBallLocation()
 iJointHingeStopsSet()
 iJointHingeAMotorSet()
 iJointSliderStopsSet()
 iJointSliderForceSet()
 iJointFeedbackEnable()
 iJointFeedback()
 iWheelCreate()
 iWheelDestroy()
 iWheelSteeringAngleSet()
 iWheelSpinSet()
 iWheelPowerSet()
 iWheelSuspensionSet()
REPLAY
 iReplayDataCreate()
 iReplayDataDestroy()
 iReplayDataRecord()
 iReplayDataPlay()
 iReplayDataRecordReset()
 iReplayDataPlayReset()
 iReplayDataPlayPosition()
 iReplayDataPlayPositionSet()
 iReplayDataWrite()
 iReplayDataRead()
 iReplayDataTime()
MESH
 iMeshCreate()
 iMeshPartCreate()
 iMeshCreateFromMemory()
 iMeshPartCreateFromMemory()
 iMeshBumpCreate()
 iMeshBumpCreateFromMemory()
 iMeshPartCount()
 iMeshPartCountFromMemory()
 iMeshDestroy()
 iMeshHide()
 iMeshShow()
 iMeshEulerOrientationSet()
 iMeshOrientationSet()
 iMeshOrientation()
 iMeshOrientationAdd()
 iMeshLocationSet()
 iMeshLocation()
 iMeshScaleSet()
 iMeshRenderPrioritySet()
 iMeshRenderModeSet()
 iMeshZBiasSet()
 iMeshSpecularSet()
 iMeshAlphaSet()
 iMeshEmissiveSet()
 iMeshFogSet()
 iMeshWireframeEnable()
 iMeshSecondaryTextureSet()
 iMeshSecondaryTextureSetFast()
 iMeshLocalLightsEnable()
 iMeshBumpAmbientColorSet()
 iMeshMirrorMake()
 iMeshVisible()
 iMeshPicked()
 iMeshRayCheck()
 iMeshBoundingSphereRayCheck()
 iMeshBoundingSphere()
 iMeshStretchToSegment()
 iMeshTextureSet()
 iMeshTextureReset()
 iMeshBumpTextureSet()
 iMeshBumpTextureReset()
 iMeshTextureSwap()
 iMeshBumpTextureSwap()
 iMeshTextureChange()
 iMeshAlphaTextureChange()
 iMeshTexturePath()
 iMeshTextureModeSet()
 iMeshTextureMipMapLodSet()
 iMeshTextureSharingSet()
 iMeshBuffersSharingSet()
 iMeshEnvMapReceiverAdd()
 iMeshEnvMapBlendSet()
 iMeshEnvMapGlassSet()
 iMeshEnvMapCasterAdd()
 iMeshEnvMapCasterRemove()
 iMeshTransfer()
MESH-BUFFERS
 iMeshVertexBufferDynamicMake()
 iMeshVertexBufferOpen()
 iMeshVertexBufferClose()
 iMeshVertexBufferSize()
 iMeshVertexBufferSizeSet()
 iMeshVertexBufferOriginal()
 iMeshFaceBufferDynamicMake()
 iMeshFaceBufferOpen()
 iMeshFaceBufferClose()
 iMeshFaceBufferSize()
 iMeshFaceBufferSizeSet()
 iMeshFaceBufferOriginal()
SKINMESH
 iSkinMeshCreate()
 iSkinMeshCreateFromMemory()
 iSkinMeshTexturesCount()
 iSkinMeshDestroy()
 iSkinMeshHide()
 iSkinMeshShow()
 iSkinMeshEulerOrientationSet()
 iSkinMeshOrientationSet()
 iSkinMeshOrientation()
 iSkinMeshOrientationAdd()
 iSkinMeshLocationSet()
 iSkinMeshLocation()
 iSkinMeshScaleSet()
 iSkinMeshPicked()
 iSkinMeshRayCheck()
 iSkinMeshAnimationSpeedSet()
 iSkinMeshAnimationTimeSet()
 iSkinMeshAnimationTime()
 iSkinMeshAnimationLength()
 iSkinMeshAnimationSetCount()
 iSkinMeshAnimationSet()
 iSkinMeshAnimationSetSet()
 iSkinMeshAnimationDataCompress()
 iSkinMeshRenderModeSet()
 iSkinMeshRenderPrioritySet()
 iSkinMeshTextureMipMapLodSet()
 iSkinMeshEnvMapCasterAdd()
 iSkinMeshEnvMapCasterRemove()
 iSkinMeshVisible()
 iSkinMeshBoundingSphereRayCheck()
 iSkinMeshBoundingSphere()
 iSkinMeshTransfer()
 iSkinMeshBonesCount()
 iSkinMeshBoneCreate()
 iSkinMeshBoneCreateByName()
 iSkinMeshBoneDestroy()
 iSkinMeshBoneChildFind()
 iSkinMeshBoneParentFind()
 iSkinMeshBoneOrientation()
 iSkinMeshBoneOrientationSet()
 iSkinMeshBoneLookAt()
 iSkinMeshBoneLocation()
 iSkinMeshBoneLocationSet()
 iSkinMeshBoneScaling()
 iSkinMeshBoneScalingSet()
 iSkinMeshBoneName()
 iSkinMeshEffectEnvTextureSet()
 iSkinMeshEffectCreate()
 iSkinMeshEffectDestroy()
 iSkinMeshEffectSet()
 iSkinMeshEffectValueSet()
 iSkinMeshEffectTextureSet()
 iSkinMeshEffectDefaultEnable()
SHADOW
 iMeshShadowCasterCreate()
 iMeshShadowCasterCreateFromMemory()
 iMeshBodyShadowCasterCreate()
 iMeshBodyShadowCasterCreateFromMemory()
 iMeshShadowCasterExtrusionSet()
 iMeshShadowCasterNormalsRecompute()
ENVIRONMENT-MAP
 iEnvMapCreate()
 iEnvMapCreateFromMemory()
 iEnvMapDestroy()
 iEnvMapFocusSet()
 iEnvMapUpdateRateSet()
SPRITE
 iSpriteCreate()
 iSpriteCreateFromMemory()
 iSpriteDestroy()
 iSpriteHide()
 iSpriteShow()
 iSpriteSet()
 iSpriteCameraSet()
 iSpriteOrientationSet()
 iSpriteLocationSet()
 iSpriteLocation()
 iSpriteScaleSet()
 iSpritePrioritySet()
 iSpriteRenderPrioritySet()
 iSpriteRenderModeSet()
 iSpriteColorSet()
 iSpriteTextureSet()
 iSpriteTextureReset()
 iSpriteTextureSwap()
 iSpriteTextureChange()
 iSpriteAlphaTextureChange()
 iSpriteMipFilterModeSet()
 iSpriteTextureModeSet()
 iSpritePicked()
 iSpriteRender()
PARTICLE
 iParticleCreate()
 iParticleCreateFromMemory()
 iParticleDestroy()
 iParticleHide()
 iParticleShow()
 iParticleRenderModeSet()
 iParticleTextureSet()
 iParticleTextureReset()
 iParticleLifeTimeSet()
 iParticleAirResistanceSet()
 iParticleGravitySet()
 iParticleColorSet()
 iParticleReset()
 iParticleEmitterCreate()
 iParticleEmitterDestroy()
 iParticleEmitterEmit()
 iParticleEmitterLocationSet()
 iParticleEmitterDirectionSet()
 iParticleEmitterSpeedSet()
 iParticleEmitterScaleSet()
 iParticleEnvMapCasterAdd()
 iParticleEnvMapCasterRemove()
TRAIL
 iTrailCreate()
 iTrailCreateFromMemory()
 iTrailDestroy()
 iTrailHide()
 iTrailShow()
 iTrailRenderModeSet()
 iTrailTextureSet()
 iTrailTextureReset()
 iTrailLifeTimeSet()
 iTrailColorSet()
 iTrailReset()
 iTrailEmitterCreate()
 iTrailEmitterDestroy()
 iTrailEmitterEmit()
 iTrailEmitterLocationSet()
 iTrailEmitterScaleSet()
 iTrailEmitterCut()
 iTrailEmitterOrientationSet()
 iTrailEnvMapCasterAdd()
 iTrailEnvMapCasterRemove()
TEXTURES
 iTextureCreate()
 iTextureCreateFromMemory()
 iTextureDestroy()
 iTextureToNormalMap()
 iTextureMipLevelsSet()
 iTextureMipFilterSet()
INPUT-KEYBOARD
 iKeyDown()
 iKeyClick()
 iKeyUpWait()
 iTypedChar()
INPUT-MOUSE
 iMouseResolutionSet()
 iMouseWinModeSet()
 iMouseButtonDown()
 iMouseButtonClick()
 iMouseButtonUpWait()
 iMouseX()
 iMouseY()
 iMouseZ()
 iWindowsMouseHide()
 iMouseReset()
 iMouseZSet()
INPUT-JOYSTICK-GAMEPAD
 iJoyCount()
 iJoyName()
 iJoyButtonDown()
 iJoyButtonClick()
 iJoyButtonUpWait()
 iJoyAverageCenterWait()
 iJoyX()
 iJoyY()
 iJoyZ()
 iJoyXAverage()
 iJoyYAverage()
 iJoyZAverage()
 iJoyState()
 iJoyForceSet()
TEXTS
 iFontCreate()
 iFontCreateFromMemory()
 iFontDestroy()
 iFontCameraSet()
 iPrint()
 iPrintCentered()
 iPrintWidth()
 iPrintColorSet()
 iPrintsHide()
SPRINGS
 iSpringCreate()
 iSpringDestroy()
 iSpringDisable()
 iSpringEnable()
 iSpringBodySet()
 iSpringTargetBodySet()
 iSpringSet()
 iSpringDampingSet()
SOUND
 iAudioIsAvailable()
 iListenerCameraSet()
 iListenerDopplerSet()
 iSoundCreate()
 iSoundOggCreate()
 iSoundOggCreateFromMemory()
 iSoundDestroy()
 iSoundPlay()
 iSoundPlayNow()
 iSoundPlaying()
 iSoundStop()
 iSoundLocationSet()
 iSoundVelocitySet()
 iSoundFrequencySet()
 iSoundFrequency()
 iSoundVolumeSet()
NETWORK
 iNetServerStart()
 iNetClientStart()
 iNetStop()
 iNetClientDisconnect()
 iNetBodySyncCreate()
 iNetBodySyncDestroy()
 iNetFloatSyncCreate()
 iNetFloatSyncUpdate()
 iNetFloatSyncDestroy()
 iNetClientReset()
 iNetServerSendFrqSet()
 iNetClientSendFrqSet()
 iNetSessionTerminated()
 iNetClientSync()
 iNetPlayersChanged()
 iNetPlayersCount()
 iNetPlayerMachine()
 iNetLocalPlayerMachine()
 iNetPlayerId()
 iNetPlayerName()
 iNetDataSend()
 iNetData()
 iNetDataDiscard()
 iNetLag()
 iNetMinimumLag()
 iNetBPS()
 iNetBytesSent()
 iNetBytesReceived()
 iNetIgnoreContacts()
MATH
 iVectorBodyToWorldTransform()
 iVectorBodyToWorldRotate()
 iVectorMeshToWorldTransform()
 iVectorMeshToWorldRotate()
 iVectorSkinMeshToWorldTransform()
 iVectorSkinMeshToWorldRotate()
 iVectorWorldToBodyTransform()
 iVectorWorldToBodyRotate()
 iVectorWorldToMeshTransform()
 iVectorWorldToMeshRotate()
 iVectorWorldToSkinMeshTransform()
 iVectorWorldToSkinMeshRotate()
 iVectorModelToBodyTransform()
 iVectorBodyToModelTransform()
 iVectorRotate()
 iVectorEulerRotate()
 iVectorsAngleToQuaternion()
 iVectorsAngle()
 iVectorLength()
 iVectorLengthSq()
 iVectorLengthSet()
 iVectorDot()
 iVectorCross()
 iQuaternionFromAxisAngle()
 iQuaternionToAxisAngle()
 iQuaternionFromEulerAngles()
 iQuaternionToEulerAngles()
 iQuaternionInterpolate()
 iQuaternionSpline()
 iQuaternionLookAt()
 iQuaternionMultiply()
 iPlaneFromPointNormal()
 iPlaneFromPoints()
 iPlaneLineIntersection()
 iFloatTendTo()
 iFloatClamp()
 iIntClamp()
 iFloatAdd()
 iFloatAbs()
 iFloatRand()
 iIntRand()
 iSignRand()
 iFloatInterpolate()
DIALOG-BOXES
 iGDISurfaceShow()
 iGDISurfaceHide()
 iFileOpenDialog()
 iFileOpenDialogNameExtract()
 iFileSaveDialog()
 iFolderSelectDialog()
 iFileDialogSizeSet()
 iFileDialogPositionSet()
 iFileDialogViewModeSet()
 iMessageBox()
 iMessageBoxYesNo()
RENDERING-ENGINE
 iRenderingDevice()
 iWindow()
 iWindowTitleSet()
 iWindowCenter()
 iDisplayMode()
 iDisplayData(RECT)
 iRender()
 iScreenWipe()
 iFrameRate()
 iBackgroundColorSet()
 iFogColorSet()
 iShadowColorSet()
 iShadowDisplacementSet()
 iGammaSet()
 iBoundingSphereFrustumCheckSet()
 iVertexShaderVersion()
 iPixelShaderVersion()
 iPixelShadersSupported()
 iEnvMapsSupported()
 iDynamicEnvMapsSupported()
 iMirrorPlaneSet()
 iMirrorShadowsSet()
 iRenderingEnable()
 iRenderingDisable()
 i3DPointVisible()
 i3DLocationToScreen()
 iScreenRay()
 iPickPoint()
 iScreenShot()
 iMovieSaveStart()
 iMovieSaveStop()
PROCESSING
 iExit()
 iEscEnable()
 iSettingsPanelSkip()
 iFrq()
 iFrqSet()
 iSimulationFrqSet()
 iPhysicsAccuracySet()
 iSystemTimer()
 iTic()
 iEdgeCollisionCheckSet()
 iBoundingSphereCollisionCheckSet()
 iReset()
 iCleanResetEnable()
 iProcessMessages()
FILES
 iDLLFile()
 iCommandLineFile()
 iGlobalPathMake()
 iChangeExtension()
 iFileExists()
 iFileImageSize()
 iFilePathOnly()
 iFileNameOnly()
 iFileExtOnly()
CONVERSION FUNCTIONS
 iXToPlyPolConvert()
 iXToSpgConvert()
 iXToSkyConvert()
MAXIMUM-NUMBER-OF-ALLOWED-OBJECTS


OVERVIEW


3Impact engine uses a left-handed coordinate system. X and Z axes define an horizontal
plane. When looking from the origin toward +Z, +Y points upward and +X to your right.

For clarity, we have named all functions adopting the following rules:
* function name starts with 'i'
* the first word (or words) after the 'i' is the object the function refers to. For
   example, in 'iCameraCreate', 'Camera' is the object of the function.
* the subsequent word (or words) is the action performed on the object. For
   example, in 'iCameraCreate', 'Create' is the action performed on the camera.
   If no action word is provided, it's very likely that the function will just return
   some information regarding the object, like for example iCameraLocation().

Some functions require quantities to be passed as parameters. Keep in mind as follows:
* time is in seconds.
* linear quantities are in meters.
   In particular, velocity is in meters-per-second, acceleration is in
   meters-per-(seconds^2).
* angular quantities are in degrees.
   In particular, spin is in degrees-per-minute, angular acceleration is in
   degrees-per-(seconds^2).

File paths are local. For example "sprites\\cursor.x" refers to a file named 'cursor.x'
stored inside a folder named 'sprites', which is inside the current folder.
However, you can specify absolute paths like "C:\\myfolder\\myfile.ext" if needed.
Paths like "..\\myfolder\\myfile.ext" are also valid.

Some function parameters are marked as 'Return data' in this reference. It means that the
parameter is a pointer to a structure (data memory block) that you are supposed to provide,
and that the associated memory block will be filled with return data when the function
returns after the call.

When making your own 3d models, keep in mind that:
* the world center in your modeler will be the so called 'source-model-center' when the 3d
   model is imported to 3Impact space. It is used as a reference by many functions, like for
   example iBodyLocationSet().
* the so called 'center-of-mass' is automatically assigned by the engine on body creation.
   It is another reference point used by some functions, like for example iBodyLocationCMSet().


MAIN FUNCTIONS - DLL VERSION ONLY


BOOL i3ImpactOpen(HWND,HWND)
   Initialize the game engine.
   Return TRUE if the engine was successfully initialized, FALSE otherwise.
   HWND = rendering window (windowed mode), or NULL to use default rendering window.
   HWND = rendering window (fullscreen mode), or NULL to use default fullscreen rendering window.

BOOL i3ImpactSettings(ISETTINGS*)
   Display startup configuration dialog.
   Return FALSE if the dialog was canceled by the user, TRUE otherwise.
   ISETTINGS* = pointer to a data structure defining default display settings.
                If this parameter is null, pre-defined default settings are used.
                Structure data members are as follows:
                DWORD dwAdapter = undefined behavior. Use zero.
                DWORD dwDevice = undefined behavior. Use zero.
                DWORD dwMode = display mode. For example, use 1024*768*32 to set
                               a 1024 x 768 pixels display mode. Note that this
                               setting is only used when bFullScreen is TRUE.
                DWORD MultiSampleType = undefined behavior. Use zero.
                BOOL bFullScreen = whether to set fullscreen mode (TRUE) or not (FALSE).
                BOOL bDoNotShow = whether to display the startup dialog (TRUE) or not (FALSE).
                                  If FALSE, the specified display settings are applied without
                                  allowing the user to change them.

i3ImpactMain()
   Initialize current frame processing and rendering

i3ImpactInitBegin()
   Initialize data structures and internal flags before calling
   user-defined initialization function, typically named Init().

i3ImpactInitEnd()
   Release data structures and set internal flags after calling
   user-defined initialization function, typically named Init().

i3ImpactRunBegin()
   Initialize data structures and internal flags before calling
   user-defined main loop function, typically named Run().

i3ImpactRunEnd()
   Release data structures and set internal flags after calling
   user-defined main loop function, typically named Run().

i3ImpactRender()
   Render the scene. Do not call this function from within your own
   Init() or Run() functions. Use iRender() instead.

i3ImpactExitBegin()
   Initialize data structures and internal flags before calling
   user-defined exit function, typically named Exit().

i3ImpactExitEnd()
   Release data structures and set internal flags after calling
   user-defined exit function, typically named Exit().

i3ImpactClose()
   Free all resources and quit the engine.

BOOL i3ImpactIsRendering()
   Return TRUE if the engine has been successfully initialized and is fully operational.
   This function may temporarily return FALSE under various circumstances. Make sure
   you never call engine's main functions while i3ImpactIsRendering() is FALSE.

BOOL i3ImpactIsActive()
   Return TRUE if the engine has been successfully initialized and is fully operational.
   This function may temporarily return FALSE while the rendering widow is moved or
   resized. Make sure you don't call i3ImpactRender() while i3ImpactIsActive() is FALSE.

BOOL i3ImpactIsReady()
   Return TRUE if the engine has been successfully initialized and is fully operational.
   This function may temporarily return FALSE while the rendering window is processing certain
   messages. Make sure you don't call i3ImpactRender() while i3ImpactIsReady() is FALSE.

BOOL i3ImpactIsExecuting()
   Return TRUE if the engine has been successfully initialized and is fully operational.
   This function will only return FALSE when the rendering window is closed.

BOOL i3ImpactIsInitializing()
   Return TRUE when the engine is in user-defined initialization phase.

BOOL i3ImpactIsSkippingRunPhase()
   Return TRUE if the engine can skip the user-defined main loop phase. This
   happens when processing speed is fast enough and some calls to the user's Run()
   function have to be skipped, to make sure that they aren't called more than 75
   times per second.

BOOL i3ImpactIsSkippingRenderPhase()
   Return TRUE if the engine cannot process rendering (refresh the display). This
   happens when overall processing/rendring speed isn't fast enough and some calls
   to i3ImpactRender() must be skipped to keep general loop frequency at 75 Hz.

BOOL i3ImpactErrorFlag()
   Return TRUE if the engine has detected an internal error and is about to exit.
   Note that the engine may take up to 3 processing loops to actually close and
   exit after an error is detected.

i3ImpactIsRenderingSet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactIsActiveSet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactIsReadySet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactIsExecutingSet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactIsInitializingSet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactIsSkippingRunPhaseSet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactIsSkippingRenderPhaseSet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactErrorFlagSet(BOOL)
   Force the internal flag to the specified TRUE or FALSE condition.

i3ImpactPreRenderCallbackSet(TYPE_3impactDLLPreRender)
   Specify the custom function to be used as PreRender callback.
   See iCameraPreRenderCallbackEnable() function for details.
   TYPE_3impactDLLPreRender = pointer to a user-defined function which must be of
                              type 'void __stdcall', wanting one parameter of type CAMERA*
                              as input. For example:
                              void __stdcall PreRender(CAMERA* camera){//your code here}.


CAMERA


CAMERA* iCameraCreate(float,float,float,float)
   Add a point of view. A 3d project always needs at least one camera.
   Basically, a camera is a rendering window opened on the screen.
   Return camera object.
   float,float = location of top/left corner of camera window, on the screen.
                 The two coordinates must be between 0.0f and 1.0f, where 0.0f,0.0f
                 is top/left screen corner and 1.0f,1.0f is bottom/right screen corner.
   float,float = width and height of camera window.
                 Both parameters must be between >0.0f and 1.0f, where 1.0f means
                 full width/height.
   Note: see iCameraFovSet() for info about enabling orthogonal camera mode.
   Note: unlike all other objects, camera objects are shown (active) when they are created.

iCameraDestroy(CAMERA*)
   CAMERA* = camera object to destroy.
             Note that destroying camera objects is not necessary because the engine will
             do it automatically on exit.
   NOTE: you should not destroy a camera before also destroying any sprite or font using
   it as a rendering target. See iSpriteCreate() and iFontCreate() for details.
   If you need to disable rendering for a camera, call iCameraHide().

iCameraHide(CAMERA*)
   Disable the specified rendering window.
   CAMERA* = camera object
   NOTE: if disabling the camera leaves any part of the screen 'uncovered' by rendering,
   garbage may fill that part of the screen on some systems.

iCameraShow(CAMERA*)
   CAMERA* = camera object

iCameraSet(CAMERA*,float,float,float,float)
   Change specified camera window position and size, on the screen.
   CAMERA* = camera object.
   See iCameraCreate() for other parameters meaning.

iCameraFovSet(CAMERA*,float)
   CAMERA* = camera object
   float = field of view (FOV), in degrees. Default 60.0f.
           Fov is basically the zoom effect. The smaller the fov angle, the bigger
           the zoom effect.
   NOTE: specify a negative FOV value to switch the camera to orthogonal projection mode.
   Keep in mind that, in orthogonal projection mode, no perspective is applied and
   view width (zooming) is defined by the absolute value of FOV. For example, set
   FOV = -5.0f to set a 5.0f meter wide view.
   Also note that orthogonal projection cannot render the fixed background,
   therefore skyboxes should not be used or should be hidden.
   Finally make sure the camera is properly located. Objects too far or too
   close or behind the camera are not rendered! See iCameraClipDistanceSet().

float iCameraFov(CAMERA*)
   Return specified camera field of view, in degrees.
   CAMERA* = camera object

iCameraClipDistanceSet(CAMERA*,float)
   CAMERA* = camera object
   float = clip distance. Default 10000.0f.
           Objects farther than the clip distance will not be rendered.

iCameraLookAt(CAMERA*,D3DXVECTOR3*,float)
   CAMERA* = camera object
   D3DXVECTOR3* = 3d location, in meters.
                  The camera is smoothly orientated toward the specified 3d location.
                  NOTE: this function will not work properly if this vector is perfectly
                  vertical. If so, instead of calling this function, you should compute
                  the final orientation with iQuaternionLookAt() and then apply it to
                  the camera with iCameraOrientationSet().
   float = camera quickness factor, from 0.0f to 1.0f (instant orientation).

iCameraEulerOrientationSet(CAMERA*,float,float,float,char*)
   CAMERA* = camera object
   float = first rotation. See character string below.
   float = second rotation.
   float = third rotation.
   char* = 3-character string specifying the axes and the order in which to apply
           the rotations.
           For example, "xyz" (apply first rotation about X axis, then second rotation about
           Y axis and then third rotation about Z axis), "xzx" and "xzy" are valid strings.

iCameraOrientationSet(CAMERA*,D3DXQUATERNION*)
   CAMERA* = camera object
   D3DXQUATERNION* = quaternion specifying an orientation.

iCameraOrientation(CAMERA*,D3DXQUATERNION*)
   CAMERA* = camera object
   D3DXQUATERNION* = orientation. Return data.

iCameraLocationSet(CAMERA*,D3DXVECTOR3*)
   CAMERA* = camera object
   D3DXVECTOR3* = 3d location

iCameraLocation(CAMERA*,D3DXVECTOR3*)
   CAMERA* = camera object
   D3DXVECTOR3* = 3d location. Return data.

iCameraAutoWipeSet(CAMERA*,int)
   Set automatic wipe mode of camera window before the rendering of every frame.
   CAMERA* = camera object
   int = wipe mode
         0 = wipe nothing
         1 = wipe graphics only
         2 = wipe depth-buffer only
         3 = wipe both graphics and depth-buffer (default)

iCameraSpritesOnlySet(CAMERA*,BOOL)
   CAMERA* = camera object
   BOOL = whether to exclude from rendering all objects except sprites and texts.
          TRUE enables sprite-text-only mode. Default is FALSE.
          
iCameraMirrorEnable(CAMERA*,BOOL)
   CAMERA* = camera object
   BOOL = whether to render the scene mirrored (TRUE) or not. Default is FALSE.
          
iCameraPreRenderCallbackEnable(CAMERA*,BOOL)
   Enable/disable the pre-rendering callback for the specified camera.
   Pre-rendering callback is typically used with multiple simultaneous cameras
   to allow your DLL code to change mesh location, orientation and rendering
   parameters before processing each single camera view.
   See the sample code named PreRenderCallback for a simple pre-rendering callback
   implementation.
   CAMERA* = camera object
   BOOL = whether to enable (TRUE) or disable (FALSE) the pre rendering callback
          Default is FALSE.
   NOTE: see i3ImpactPreRenderCallbackSet() if you want to use this functionality
   with the DLL version of 3Impact game engine.

iCameraVelocitySet(CAMERA*,D3DXVECTOR3*)
   CAMERA* = camera object
   D3DXVECTOR3* = camera velocity.
   NOTE: camera velocity is used only to compute Doppler effect. You don't have to
   update camera velocity by calling this function, if Doppler factor is 0.0f.
   See iListenerDopplerSet() for more.

DWORD iCameraEffectCreate(char*)
   Return a pointer to the compiled post-process pixel-shader effect to be used as parameter for
   functions like iCameraEffectSet() and iCameraEffectDestroy().
   char* = source shader effect file name (.fx/.fxo format).
           The specified effect determine the post-process rendering technique to use for the
           camera. If this parameter is NULL, a default post-process rendering technique is used.
   NOTE: the engine doesn't automatically destroy the effect created with this function.
         Make sure you call iCameraEffectDestroy() before terminating the application.

iCameraEffectDestroy(DWORD)
   Destroy the specified post-process effect. See iCameraEffectCreate() for details.
   DWORD = pointer to the shader effect

iCameraEffectSet(CAMERA*,DWORD)
   Assign the specified post-process effect to the specified camera.
   CAMERA* = camera object
   DWORD = pointer to the effect

iCameraEffectValueSet(CAMERA*,char*,VOID*,UINT)
   Set constant data for the post-process pixel-shader associated with the specified camera.
   CAMERA* = camera object
   char* = constant data name, as declared in the .fx file
   VOID* = pointer to the constant data buffer
   UINT = length of constant data buffer, in bytes

iCameraEffectTextureSet(CAMERA*,char*,TEXTURE*)
   Set a texture to be used by the post-process pixel-shader associated with the specified camera.
   CAMERA* = camera object
   char* = texture name, as declared in the .fx file
   TEXTURE* = free texture object. See iTextureCreate().


LIGHT


iLightDirectionalSet(D3DXVECTOR3*,D3DXVECTOR4*)
   D3DXVECTOR3* = light direction. Default is (0.0f,-1.0f,0.0f).
   D3DXVECTOR4* = pointer to a 4-vector structure specifying the light color.
                  The first 3 parameters are Red, Green and Blue components respectively.
                  The fourth parameter is the amount of minimal light. The minimal
                  light is the light reflected by the dark-side of the objects.
                  Zero minimal light causes dark-side of objects to be completely black.
                  1.0f minimal light causes them to be as bright as the illuminated side
                  of objects.
                  Default is (1.0f,1.0f,1.0f,0.3f).

iLightLocalLocationSet(int,D3DXVECTOR3*)
   int = light number (from 0 to 2).
         NOTE: only meshes enabled with iMeshLocalLightsEnable() will be affected by local lights.
   D3DXVECTOR3* = 3d location. Default is (0.0f,0.0f,0.0f).

iLightDirectionalColor(D3DXVECTOR4*)
   Return the current directional light color.

iLightLocalColorSet(int,D3DXVECTOR4*)
   Set local light properties.
   int = light number (from 0 to 2).
         NOTE: only meshes enabled with iMeshLocalLightsEnable() will be affected by local lights.
   D3DXVECTOR4* = pointer to a 4-vector structure specifying a the color of the light.
                  The first 3 parameters are Red, Green and Blue components respectively.
                  The fourth parameter is the rate of light intensity reduction. The bigger
                  the factor, the smaller the distance reached by the light.
                  Defaults are:
                  - light 0, (1.0f,0.0f,0.0f,1.0f)
                  - light 1, (0.0f,1.0f,0.0f,1.0f)
                  - light 2, (0.0f,0.0f,1.0f,1.0f)


SKYBOX


SKYBOX* iSkyBoxCreate(char*)
   Return skybox object.
   char* = source .sky file name. You can generate .sky files as follows:
           (1) in your modeler create a 2 meters wide cube.
           (2) center the model respect to world origin.
           (3) flip all faces inward so that they are visible from world origin.
           (4) you will need a special scene rendering software to generate so
               called 'skybox textures'. They are basically six different image
               files representing a scenery as seen from six 90-degrees-fov cameras
               placed at the origin and oriented respectively toward +X,-X,+Y,-Y,+Z,-Z.
           (5) Apply each texture to each cube face. +X texture to +X face, -X texture
               to -X face, +Y texture to +Y face, and so on.
           (6) save the model to six different .x files, so that each file contains only
               one face of the original cube.
               The file name of each model must be in the form 'name_XX.x', where XX can be
               'px' (positive X face), 'nx' (negative X face),
               'py' (positive Y face), 'ny' (negative Y face),
               'pz' (positive Z face), 'nz' (negative Z face).
           (7) run 3Impact Converter and select 'Generate skybox...' option.
           (8) select one of the 'name_XX.x' file and perform the conversion to generate
               a .sky file.
               NOTE: you can also use the iXToSkyConvert() function to do the conversion.
   NOTE: keep in mind that there is no need at all to make your own skybox model, unless
   you need to make a different skybox shape (i.e. sphere).
   You can actually just replace the textures we have made for the skybox01.sky file with
   your own .jpg textures. Each single texture can be any ^2 size (1, 2, 4, 8, 16, etc).
   The textures should be created by using a ray-tracing application (3d renderer). Each
   texture should be a 90 degree view (Field Of View = 90 degrees) toward the corresponding
   world axis direction. For example, skybox01_nx.jpg should be the picture obtained by
   rendering the scene with the camera looking toward -X world axis ('nx' means 'negative x').
   So skybox01_ny.jpg is the same but with the camera looking toward -Y world axis, and so on.
   NOTE: skyboxes are hidden when they are created. You can show them with iSkyBoxShow().

iSkyBoxDestroy(SKYBOX*)
   SKYBOX* = skybox object
             Note that destroying skybox objects is not necessary because the engine will
             do it automatically on exit.

iSkyBoxHide(SKYBOX*)
   SKYBOX* = skybox object

iSkyBoxShow(SKYBOX*)
   SKYBOX* = skybox object
   NOTE: you should never show more than one skybox at a time. Only one skybox is rendered.
   Any other 'shown' (visible) skybox is not rendered but still processed, thus wasting
   processing power.

iSkyBoxColorSet(SKYBOX*,float,float,float)
   SKYBOX* = skybox object
   float = red (0.0f to 1.0f)
   float = green (0.0f to 1.0f)
   float = blue (0.0f to 1.0f)

iSkyBoxEnvMapCasterAdd(SKYBOX*)
   SKYBOX* = skybox object to be added to the list of skyboxes that are reflected/refracted
             by dynamic environment surfaces. See iEnvMapUpdateRateSet() for more.

iSkyBoxEnvMapCasterRemove(SKYBOX*)
   SKYBOX* = skybox object to be removed from the list. See iSkyBoxEnvMapCasterAdd().


BODY


BODY* iBodyCreate(char*)
   Return polyhedron-based body object.
   char* = source .ply file name.
           The .ply is derived from polygonal geometry to be used as a reference when
           computing collision detection. Such a geometry is not rendered, however
           a texture mapped 3d model is typically associated to the body, in order
           to visualize it. There is no need for the invisible and the visible geometry to
           match, but you will typically model the invisible geometry so that it closely
           matches at least those parts of the visible mesh that are supposed to collide
           with other objects
           You can generate .ply (polyhedron-based, static body) files as follows:
           (1) in your modeler create a polygonal model with no textures.
           (2) if you plan to perform different restitution and friction effects, depending
               on what triangles of the model are involved in a collision, in your 3d modeler
               assign different materials to each part of the model. Each part will be seen
               as a sub-part (SUBPART*) by the engine.
           (3) save the model as an .x file with a name like 'name_R.x', where R is a
               value specifying a 'resolution' in meters. In order to speed up collision
               detection computation, the engine will 'split' the model to a number of parts,
               approximately the size of the specified resolution. As a general rule, resolution
               value should be about the size of an average sphere (dynamic bodies), among those
               involved in the collision. Examples of valid names are 'name_5.x', 'name_7.23.x'.
           (4) run 3Impact Converter and select 'Generate polyhedron-based body...' option.
           (5) select the source 'name_X.x' file and perform the conversion to generate
               a .ply file. note that a companion .pol file is generated along with it.
               NOTE: you can also use the iXToPlyPolConvert() function to do the conversion.
               In this case, you don't have to specify the grid resolution in the file name.
   NOTE: bodies are disabled when they are created. You can enable them with iBodyEnable().

BODY* iBodyCreateFromMemory(char*,int,char*,int)
   Return polyhedron-based body object.
   char* = pointer to the first byte of a .ply file previously loaded into memory.
   int = size of .ply file in memory, in bytes.
   char* = pointer to the first byte of a .pol file previously loaded into memory.
   int = size of .pol file in memory, in bytes.
   See also iBodyCreate().

BODY* iBodySGCreate(char*,float)
   Return sphere-group-based body object.
   char* = source .spg file name.
           The .spg file is derived from two meshes. The first one must be a group of
           polygonal spheres to be used as a reference when computing collision detection.
           The second must be a group of polygonal closed hulls to be used as a reference
           to compute mass distribution (mass properties) to properly process dynamics behavior.
           Both geometries are not rendered, however a texture mapped polygonal model is
           typically associated to the body, in order to visualize it.
           You can generate .spg (sphere-group-based, dynamic body) files as follows:
           (1) in your modeler create an object made of polygonal spheres only, with no textures.
               Note that processing time for collision detection is proportional to the number
               of spheres. The rule is trying to keep the number of spheres as small as possible.
               Also, note that the number of faces for this model must not exceed 65536.
           (2) save the model as an .x file with a name like 'name_.x'. An '_' (underscore)
               must precede the dot.
           (3) in your modeler create a polygonal object made of closed hulls, with no textures.
               Note that the number of vertices for this model must not exceed 10000.
           (4) save the model as an .x file with a name like 'name__.x'. Two '__' (underscores)
               must precede the dot. 'name' must be the same used for the previous .x file.
           (5) run 3Impact Converter and select 'Generate sphere-group-based body...' option.
           (6) select the source 'name_.x' file (the one with one single underscore) and
               perform the conversion to generate an .spg file.
               NOTE: you can also use the iXToSpgConvert() function to do the conversion.
   float = total mass. As a reference, total mass for one liter of water (1 kg or 2.2 pounds)
           is about 1.0f.
           Setting a total mass too small may cause unpredictable behaviors, including
           severe processing slowdown.
           NOTE: setting this value to -1.0f will create a static sphere-group-based body.
   NOTE: bodies are disabled when they are created. You can enable them with iBodyEnable().

BODY* iBodySGCreateFromMemory(char*,int,float)
   Return sphere-group-based body object.
   char* = pointer to the first byte of a .spg file previously loaded into memory.
   int = size of .spg file in memory, in bytes.
   float = total mass.
   See also iBodySGCreate().

BODY* iBodySphereCreate(float,D3DXVECTOR3*,float)
   Return sphere-group-based body object. It is a sphere group made of one
   single sphere with specified mass and radius.
   float = radius
   D3DXVECTOR3* = sphere center offset. It usually is &D3DXVECTOR3(0.0f,0.0f,0.0f)
   float = total mass. See iBodySGCreate()

iBodyDestroy(BODY*)
   BODY* = body object
           Note that destroying body objects is not necessary because the engine will
           do it automatically on exit.

iBodyDisable(BODY*)
   BODY* = body object
           Collision detection and dynamics is not processed for disabled bodies.

iBodyEnable(BODY*)
   BODY* = body object to re-enable. See iBodyDisable().

int iBodyStatus(BODY*)
   Return specified body status as follows:
   bit 0, TRUE for enabled, FALSE for disabled
   BODY* = body object
   
MESH* iBodyMeshCreate(char*,BODY*)
   Return mesh object.
   Bodies are 'solid' but invisible. Attaching meshes to them is usually necessary
   to show them. This function creates a mesh and attach it to the specified body.
   Multiple meshes can be created and attached to the same body by calling this
   function multiple times.
   char* = source .x file name.
           See iMeshCreate() to know how to generate proper .x files.
   BODY* = body to attach the mesh to.
           Destination body can be either polyhedron-based or sphere-group-based.
   NOTE: meshes are hidden when they are created. You can show them with iMeshShow().

MESH* iBodyMeshPartCreate(char*,int,BODY*)
   Identical to iBodyMeshCreate() except that it creates the mesh by only 'extracting'
   the geometry that is texture mapped with the specified texture ('int' parameter):
   See also iMeshPartCreate().

MESH* iBodyMeshCreateFromMemory(char*,int,char*,int,int,BODY*)
   See iMeshCreateFromMemory() for parameters meaning (except BODY*).

MESH* iBodyMeshPartCreateFromMemory(char*,int,char*,int,int,int,BODY*)
   Identical to iBodyMeshCreateFromMemory() except that it creates the mesh by only 'extracting'
   the geometry that is texture mapped with the specified texture (last 'int' parameter).
   See also iMeshPartCreate().

SKINMESH* iBodySkinMeshCreate(char*,char*,BODY*)
   Return skinmesh object.
   This function is like iBodyMeshCreate(), but it creates a skinmesh. See also iSkinMeshCreate().

SKINMESH* iBodySkinMeshCreateFromMemory(char*,int,char**,int*,char*,BODY*)
   See iSkinMeshCreateFromMemory() for parameters meaning.

MESH* iBodyMeshBumpCreate(char*,char*,BOOL,BODY*)
   Return mesh object.
   This function is like iBodyMeshCreate() but it creates a mesh with a
   bump-map assigned to it.
   char* = source .x file name. See iMeshCreate() for details.
   char* = source bump-map texture file name (bmp, dds, dib, jpg, png, tga).
           See iMeshBumpCreate().
   BOOL = whether to convert the image to a normal-map. See iMeshBumpCreate().
   BODY* = body to attach the mesh to. See iBodyMeshCreate().
   NOTE: meshes are hidden when they are created. You can show them with iMeshShow().

MESH* iBodyMeshBumpCreateFromMemory(char*,int,char*,int,int,char*,int,int,BOOL,BODY*)
   char* = pointer to .x file in memory.
   int = size of .x file in memory, in bytes.
   char* = pointer to texture file in memory.
   int = size of texture file in memory, in bytes.
   int = texture's unique identifier.
   char* = pointer to bumpmap image file in memory.
   int = size of bumpmap image file in memory, in bytes.
   int = bumpmap unique identifier.
   BOOL = whether to convert the source image. See iMeshBumpCreate().
   BODY* = body to attach the mesh to.
   See also iMeshBumpCreateFromMemory().

iBodyMassModelSet(BODY*,char*,float)
   Change the mass geometry for the specified body. This function also
   allows you to change a static, polyhedron-based body created with iBodyCreate()
   into a dynamic body.
   BODY* = body object. Can be either sphere-group based, originally created
           with iBodySGCreate() or static, created with iBodyCreate().
   char* = source .x file name, the 3d model to use as a reference to compute mass distribution.
           See iBodySGCreate() for more about mass model geometry.
   float = new total mass. If this parameter is bigger than zero, the specified body becomes dynamic.

iBodyMassSet(BODY*,float)
   Changes the total mass for the specified body.
   BODY* = body object.
   float = new total mass. Set this value to zero to make the specified body static.

iBodySurfaceStickinessSet(BODY*,float)
   BODY* = body object.
   float = stickiness factor. By default it is 0.001f, which produces a small force which
           keeps bodies together and prevents small-scale 'jittering' on continuous contacts,
           like resting on ground.

iBodySurfaceDriveSet(BODY*,float)
   BODY* = body object
   float = body surface drive, between 0.0f and 1.0f (but see note, below). Default is 0.0f.
           Bodies tend to overlap ('sink' one into the other) when strong forces are involved.
           Typical case, a very strong gravity pushing down a body resting on ground.
           This parameter allows you to add some 'drive' to the surfaces to counter-balance this effect.
           NOTE: because each body has it's own surface drive factor, the actual factor used on collisions
           is the biggest between the two surfaces involved.
           NOTE: if the factor is negative (between -1.0f, maximum drive, and 0.0f, no drive),
           a different, stronger algorithm is used to prevent body overlapping.

iBodyEulerOrientationSet(BODY*,float,float,float,char*,BOOL)
   BODY* = body object
   float = first rotation. See character string below.
   float = second rotation.
   float = third rotation.
   char* = 3-character string specifying the axes and the order in which to apply
           the rotations.
           For example, "xyz" (apply first rotation about X axis, then second rotation about
           Y axis and then third rotation about Z axis), "xzx" and "xzy" are valid strings.
   BOOL = TRUE to reset memorized previous orientation too (recommended).
   NOTE: if clean reset mode is enabled, any joint/wheel associated with the body
   must be destroyed before calling this function. See iCleanResetEnable() for more.

iBodyOrientationSet(BODY*,D3DXQUATERNION*,BOOL)
   BODY* = body object
   D3DXQUATERNION* = quaternion specifying an orientation.
   BOOL = TRUE to reset memorized previous orientation too (recommended).
   NOTE: if clean reset mode is enabled, any joint/wheel associated with the body
   must be destroyed before calling this function. See iCleanResetEnable() for more.

float iBodyOrientationSeek(BODY*,D3DXQUATERNION*,float)
   If executed at every Run() loop, apply torque to the specified body to progressively
   orient it and match the specified orientation.
   Return the angle between current orientation and target orientation.
   BODY* = body object
   D3DXQUATERNION* = quaternion specifying an orientation.
   float = intensity, a factor defining the amount of torque to apply.
   NOTE: it is recommended that the body has some rotational damping (see
   for example iBodyDampingSet() function), to avoid a 'bouncing' effect
   about the target orientation.

D3DXQUATERNION* iBodyOrientation(BODY*,D3DXQUATERNION*)
   BODY* = body object
   D3DXQUATERNION* = orientation. Return data.
   NOTE: this function returns a pointer to the orientation quaternion provided as parameter,
   so that this function can be directly used as a parameter for another function.

float iBodyYaw(BODY*)
   Return specified body yaw (about Y axis).
   BODY* = body object

float iBodyPitch(BODY*)
   Return specified body pitch (about X axis).
   BODY* = body object

float iBodyRoll(BODY*)
   Return specified body roll (about Z axis).
   BODY* = body object

iBodyEulerOrientationAdd(BODY*,float,float,float,char*,BOOL)
   BODY* = body object
   floats, char* = degrees to add to current body orientation for every second.
                   See iBodyEulerOrientationSet() for more on these parameters.
                   Note that this function should be executed at every Run() loop
                   to work properly.
   BOOL = TRUE to reset memorized previous orientation (recommended).
   NOTE: if clean reset mode is enabled, any joint/wheel associated with the body
   must be destroyed before calling this function. See iCleanResetEnable() for more.

iBodyOrientationAdd(BODY*,D3DXQUATERNION*,BOOL)
   BODY* = body object
   D3DXQUATERNION* = rotation to add to current body orientation for every second.
                     Note that this function should be executed at every Run() loop
                     to work properly.
   BOOL = TRUE to reset memorized previous orientation (recommended).
   NOTE: if clean reset mode is enabled, any joint/wheel associated with the body
   must be destroyed before calling this function. See iCleanResetEnable() for more.

iBodyLocationSet(BODY*,D3DXVECTOR3*,BOOL)
   BODY* = body object
   D3DXVECTOR3* = 3d location
   BOOL = TRUE to reset memorized previous location too (recommended).
   NOTE: the center of the source model is used as a reference, not the center of mass
   computed by the engine. The object center is the world-center in your 3d modeler,
   when the object is exported to an .x file.
   NOTE: because rotations are always performed about the center of mass instead,
   setting the body orientation FIRST, and its location THEN, is recommended.
   NOTE: if clean reset mode is enabled, any joint/wheel associated with the body
   must be destroyed before calling this function. See iCleanResetEnable() for more.

iBodyLocationCMSet(BODY*,D3DXVECTOR3*,BOOL)
   BODY* = body object
   D3DXVECTOR3* = 3d location
   BOOL = TRUE to reset memorized previous location too (recommended).
   NOTE: unlike iBodyLocationSet(), this function sets the location for the specified body
   using its center of mass as a reference. The center of mass is automatically computed by
   the engine.
   NOTE: if clean reset mode is enabled, any joint/wheel associated with the body
   must be destroyed before calling this function. See iCleanResetEnable() for more.

D3DXVECTOR3* iBodyLocation(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = location vector. Return data.
                  The vector is filled with the absolute location of the source-model-center,
                  for the specified body. See also iBodyLocationSet().
   NOTE: this function returns a pointer to the location vector provided as parameter,
   so that this function can be directly used as a parameter for another function.

D3DXVECTOR3* iBodyPreviousLocation(BODY*,D3DXVECTOR3*)
   Retrieve body location at previous Run() loop. See iBodyLocation() for more.

D3DXVECTOR3* iBodyLocationCM(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = location vector. Return data.
                  The vector is filled with the absolute location of center of mass for the
                  specified body. See also iBodyLocationCMSet().
   NOTE: this function returns a pointer to the location vector provided as parameter,
   so that this function can be directly used as a parameter for another function.

iBodyLocationAdd(BODY*,D3DXVECTOR3*,BOOL)
   BODY* = body object
   D3DXVECTOR3* = meters to add to current body location for every second.
                  Note that this function should be executed at every Run() loop
                  to work properly.
   BOOL = TRUE to reset memorized previous location (recommended).
   NOTE: if clean reset mode is enabled, any joint/wheel associated with the body
   must be destroyed before calling this function. See iCleanResetEnable() for more.

D3DXVECTOR3* iBodyCMOffset(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = offset vector. Return data.
                  The vector is filled with the center of mass offset for the
                  specified body, respect to its model-center.
   NOTE: this function returns a pointer to the location vector provided as parameter,
   so that this function can be directly used as a parameter for another function.

iBodySpinSet(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = spin vector.
                  The vector direction is the axis of rotation (absolute).
                  The length of the vector is the rotation speed (spin).

iBodySpin(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = spin vector. See also iBodySpinSet().

iBodyVelocitySet(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = velocity vector.

iBodyVelocity(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = velocity vector. Return data.

float iBodyKmh(BODY*)
   Return specified body speed, in kilometers per hour (KPH).
   BODY* = body object
   NOTE: you can compute miles per hour with MPH = KPH*0.6215

iBodyPointVelocity(BODY*,D3DXVECTOR3*,D3DXVECTOR3*)
   Return the velocity of a body point.
   BODY* = body object
   D3DXVECTOR3* = body point to compute velocity for. Source-model-center relative coordinates.
   D3DXVECTOR3* = velocity vector. Return data.

iBodyDampingSet(BODY*,float,float,float,float)
   Damping is a technique used to limit the 'energy' of a body (extremely high speed,
   extremely fast spinning, etc), in order to minimize improper simulation behaviors.
   Damping tend to disrupt simulation realism, so it's all about finding the balance
   between damping amount and simulation realism.
   BODY* = body object
   float = speed beyond which linear damping is applied.
   float = linear damping factor (reduction-per-second, between 0.0f and 1.0f).
           It is like multiplying the current amount by the specified factor, every second.
   float = spin beyond which angular damping is applied.
   float = angular damping factor (reduction-per-second, between 0.0f and 1.0f).
           It is like multiplying the current amount by the specified factor, every second.
   NOTE: if speed or spin are bigger than specified limits, they are multiplied by damping
   factors. It means that if damping factor is 1.0f, no damping is applied. If it is 0.0f,
   velocity and spin are immediately set to zero (the body stops immediately traveling or
   spinning as soon as the speed/spin limit is reached). Typical damping factor is 0.25f.
   By default, bodies perform no damping.

iBodyDamping2Set(BODY*,float,float,float,float)
   Set secondary damping factors that are independent from main damping enabled
   with iBodyDampingSet(). Typical usage of secondary damping is preventing very
   high speeds/spins while leaving the main damping system available for normal
   speeds/spins control. See iBodyDampingSet() for parameter meaning.

iBodyDirectionalAngularDampingSet(BODY*,float,float,float,float)
   BODY* = body object
   float = spin (in meters-per-second) beyond which linear damping is applied.
   float = angular damping factor (reduction-per-second, between 0.0f and 1.0f), X axis.
   float = angular damping factor (reduction-per-second, between 0.0f and 1.0f), Y axis.
   float = angular damping factor (reduction-per-second, between 0.0f and 1.0f), Z axis.
   NOTE: directional means that you can set a different damping factor for each body-relative
   axis of rotation (local XYZ).
   NOTE: setting angular directional damping excludes normal angular damping and vice-versa.

iBodyDirectionalLinearDampingSet(BODY*,float,float,float,float)
   BODY* = body object
   float = speed (in meters-per-second) beyond which linear damping is applied.
   float = linear damping factor (reduction-per-second, between 0.0f and 1.0f), X axis.
   float = linear damping factor (reduction-per-second, between 0.0f and 1.0f), Y axis.
   float = linear damping factor (reduction-per-second, between 0.0f and 1.0f), Z axis.
   NOTE: 'directional-linear' means that you can set a different damping factor for
   each body-relative axis (local XYZ).
   NOTE: setting linear directional damping excludes normal linear damping and vice-versa.

iBodyTorqueApply(BODY*,D3DXVECTOR3*)
   Apply an angular force (torque) to the specified body.
   BODY* = body object
   D3DXVECTOR3* = torque.
                  Vector direction is the axis of rotation (absolute).
                  Length of the vector is angular force (torque) intensity.
   NOTE: resulting angular velocity depends on total body mass.
   So, using iBodyAngularAccelerationApply() can be easier.

iBodyAngularAccelerationApply(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = angular acceleration, in degrees-per-second^2.
                  Vector direction is the axis of rotation (absolute).
                  Length of the vector is angular acceleration intensity.

iBodyForceApply(BODY*,D3DXVECTOR3*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = force.
   D3DXVECTOR3* = point the force is applied to.
                  Point coordinates are body-center-of-mass relative. If NULL, the
                  center of mass is assumed.
   NOTE: resulting acceleration depends on total body mass. For example, if you apply
   one-meter-long force-vector to a still body with mass=5, for one second,
   the body will travel 1/5 meters (0.2f). If you apply the same force to a body with
   mass=1, it will travel 1.0f meter instead.
   So, using iBodyAccelerationApply() is easier, if application point
   is the body center of mass.

iBodyAccelerationApply(BODY*,D3DXVECTOR3*)
   BODY* = body object
   D3DXVECTOR3* = acceleration, in meters-per-second^2.
                  The length of the vector is acceleration intensity.

iBodyPhysicsReset(BODY*)
   Completely stop (remove energy from) a body.
   BODY* = body object.
   NOTE: because calling this function also disables the collision detection system
   for the current Run() loop, executing this function at every loop is not recommended.

int iBodySphereCount(BODY*)
   Return total number of sub-parts (spheres) forming the specified body.
   BODY* = body object (must be sphere-group-based)

SUBPART* iBodySphere(BODY*,int)
   Return sub-part (sphere) object.
   BODY* = body object (must be sphere-group-based)
   int = sub-part (sphere) index.
         Defines the sphere object to return as sub-part object.
         The first sphere in the group has index = 0,
         the second = 1, and so on.

iBodySphereCenter(SUBPART*,D3DXVECTOR3*)
   SUBPART* sub-part (sphere) object
   D3DXVECTOR3* = sphere center location. Return data.
                  Note that the location is body-center-of-mass relative.
                  You can convert it to source-model-center relative with
                  iVectorBodyToModelTransform() function.
                  You can convert it to absolute coordinates with
                  iVectorBodyToWorldTransform() function.

float iBodySphereRadius(SUBPART*)
   Return radius of specified sub-part (sphere)
   SUBPART* sub-part (sphere) object

int iBodyScan(BODY*,D3DXVECTOR3*,D3DXVECTOR3*,float,D3DXVECTOR3*,D3DXVECTOR3*)
   Return subpart hit by the scan, or -1 if nothing is hit by the scan.
   BODY* = body object to scan
   D3DXVECTOR3* = scan origin
   D3DXVECTOR3* = scan direction. The length of this vector will be the length of the
                  scanning capsule.
   float = scan radius (capsule radius)
   D3DXVECTOR3* = contact point (absolute coordinates). Return data.
   D3DXVECTOR3* = contact normal (absolute orientation, outward from body surface). Return data.
   NOTE: the scan is performed checking the specified capsule against the specified body, for
   intersections. Only the intersection closer to origin is considered, in case the
   capsule intersects the body at two or more points.
   NOTE: a scan traversing a large number of polygons or dynamic body's spheres is
   computationally expensive. Furthermore, a scan traversing more than 100 polygons
   will miss some intersections.
   IMPORTANT: intersections within 'scan radius' from the 'scan origin' are not detected!
   Make sure your scan starts 'radius' meters before the possible intersection area.

BOOL iBodyEnteringMesh(BODY*,D3DXVECTOR3*,MESH*)
   Return TRUE if the specified body is entering (passing through the surface of) the
   specified mesh, FALSE otherwise.
   BODY* = body object
   D3DXVECTOR3* = reference body point. It is an offset from the source-model-center.
                  The function will return TRUE when the specified body's point
                  crosses the surface of the specified mesh.
   MESH* = mesh object

BOOL iBodyExitingMesh(BODY*,D3DXVECTOR3*,MESH*)
   Return TRUE if the specified body is exiting (passing through the surface of) the
   specified mesh, FALSE otherwise.
   BODY* = body object
   D3DXVECTOR3* = reference body point. It is an offset from the source-model-center.
                  The function will return TRUE when the specified body's point
                  crosses the surface of the specified mesh.
   MESH* = mesh object


BODYBODY


BODYBODY* iBodyBodyCreate(BODY*,BODY*)
   Return bodybody (collision couple) object.
   BODY* = first body object of the collision couple to enable. Must be sphere-group-based.
   BODY* = second body object of the collision couple to enable. Can be either
           sphere-group-based or polyhedron-based.
   NOTE: by default, the engine doesn't perform any collision detection. The two
   BODY* parameters of this function tell the engine what body couple should
   be checked for collision.
   NOTE: collision between two polyhedron-based bodies is not supported.
   NOTE: the body with bigger mass should be the second parameter.

iBodyBodyDestroy(BODYBODY*)
   BODYBODY* = bodybody object
   Disable collision detection/response for the specified collision couple.
   The collision couple can be re-enabled with iBodyBodyCreate().
   Note that destroying bodybody objects is not necessary because the engine will
   do it automatically on exit.

iBodyBodyEnable(BODYBODY*,BOOL)
   BODYBODY* = bodybody object
   BOOL = whether to enable (TRUE, default) or disable (FALSE) the specified
          collision couple.
   Dynamically enabling/disabling collision detection for specific bodies is
   usually necessary if large numbers of collision couples have been created.
   Typically, you will only enable those collision couples (bodybody objects)
   that can potentially collide (for example, they trajectories are meeting),
   thus minimizing collision detection computation and saving a lot of CPU work.
   NOTE: unlike iBodyBodyDestroy(), this function preserves bodybody properties
   like restitution, friction, etc.

iBodyBodyCollisionResponseEnable(BODYBODY*,BOOL)
   BODYBODY* = bodybody object
   BOOL = whether to enable (TRUE, default) or disable (FALSE) collision
          response for the specified collision couple.
   By default, the engine applies the forces generated by body collisions
   to perform proper contact response dynamics.
   By passing FALSE to this function you can disable collision response while
   keeping the collision detection system working. It means that, for example,
   two colliding balls will simply pass one through the other, but collision
   info can still be retrieved with iBodyBodyFeedback().

iBodyBodyRestitutionSet(BODYBODY*,float)
   BODYBODY* = bodybody object
   float = restitution (between 0.0f and 1.0f inclusive, default is 0.5f)
           It is the bounciness of the two bodies when colliding. The smaller the
           factor, the lower the bounciness.
   NOTE: restitution is set the same for all sub-parts forming the two bodies.
   You can set specific restitution for each sub-part with iBodyBodySubpartRestitutionSet().

iBodyBodyFrictionSet(BODYBODY*,float)
   BODYBODY* = bodybody object
   float = friction (greater than 0.0f, default is 0.0f)
           Zero means that there is no friction. Set a very high value for
           no-slipping friction (max is 3.402823466e+38f).
           The effect of this parameter changes, depending on friction model
           used. See iBodyBodyFrictionModelSet() for more.
   NOTE: friction is set the same for all sub-parts forming the two bodies.
   You can set specific friction for each sub-part with iBodyBodySubpartFrictionSet().

iBodyBodyFrictionModelSet(BODYBODY*,int)
   BODYBODY* = bodybody object
   int = friction model (0 = Coulomb (default), 1 = friction pyramid).
         When Coulomb friction model is used, the friction parameter set with
         ...FrictionSet() instructions resembles real-world friction constant.
         You can use 10.0f as typical value, but may vary greatly depending on
         body masses.
         When friction pyramid model is used, it represents a different friction
         constant, typically around 1.0f.
   NOTE: friction model is set the same for all sub-parts forming the two bodies. You can
   set specific friction model for each sub-part with iBodyBodySubpartFrictionModelSet().

iBodyBodySplitFrictionSet(BODYBODY*,float,float,float,float)
   Friction simulation is a complex issue that may require fine tuning. For example,
   to perfectly simulate wheel friction behavior, you may need to set different
   friction parameters for rolling and side directions.   
   BODYBODY* = bodybody object
   float = side friction when sliding along the X local axis of the first
   body (collision couple).
   float = side slip factor. Intermediate friction allows a certain amount of slipping,
           but you may need to tune this parameter as well to achieve accurate slip
           effects, especially for wheels.
   float = rolling-direction friction. Same as above, but for body rolling-direction.
   float = rolling direction slip factor. Same as above, but for body rolling-direction.
   NOTE: split friction parameters are set the same for all sub-parts forming the two bodies.
   You can set specific parameters for each sub-part with iBodyBodySubpartSplitFrictionSet().

iBodyBodySubpartRestitutionSet(BODYBODY*,int,int,float)
   BODYBODY* = bodybody object
   int =   index of first body sub-part. The first body is the body specified as first
           parameter for the iBodyBodyCreate() function.
           The sub-part index must be 0 for the first sub-part, 1 for the second, and so on.
   int =   index of second body sub-part. The second body is the body specified as second
           parameter for the iBodyBodyCreate() function.
   NOTE: see iBodyBodyRestitutionSet() for remaining parameter.

iBodyBodySubpartFrictionSet(BODYBODY*,int,int,float)
   BODYBODY* = bodybody object
   int =   index of first body sub-part. See iBodyBodySubpartRestitutionSet().
   int =   index of second body sub-part. See iBodyBodySubpartRestitutionSet().
   NOTE: see iBodyBodyFrictionSet() for remaining parameter.

iBodyBodySubpartFrictionModelSet(BODYBODY*,int,int,int)
   BODYBODY* = bodybody object
   int =   index of first body sub-part. See iBodyBodySubpartRestitutionSet().
   int =   index of second body sub-part. See iBodyBodySubpartRestitutionSet().
   NOTE: see iBodyBodyFrictionModelSet() for remaining parameter.

iBodyBodySubpartSplitFrictionSet(BODYBODY*,int,int,float,float,float,float)
   BODYBODY* = bodybody object
   int =   index of first body sub-part. See iBodyBodySubpartRestitutionSet().
   int =   index of second body sub-part. See iBodyBodySubpartRestitutionSet().
   NOTE: see iBodyBodySplitFrictionSet() for remaining parameters.

iBodyBodyFeedbackEnable(BODYBODY*,int,int,BOOL)
   BODYBODY* = bodybody object
   int =   index of first body sub-part. The first body is the body specified as first
           parameter for the iBodyBodyCreate() function.
           The sub-part index must be 0 for the first sub-part, 1 for the second, and so on.
           If this parameter is -1, feedback is enabled/disabled for all subparts of
           the first body.
   int =   index of second body sub-part. The second body is the body specified as second
           parameter for the iBodyBodyCreate() function.
           If this parameter is -1, feedback is enabled/disabled for all subparts of
           the second body.
   BOOL = whether to enable (TRUE) or disable (FALSE) contact feedback for the
          specified subpart (or subparts). See iBodyBodyFeedback()
   
BOOL iBodyBodyFeedback(BODYBODY*,int,int,D3DXVECTOR3*,D3DXVECTOR3*,D3DXVECTOR3*,D3DXVECTOR3*,D3DXVECTOR3*,D3DXVECTOR3*)
   Return TRUE if any collision contact was detected between the specified
   subpart (or subparts) of the first body and the specified subpart (or subparts)
   of the second body.
   BODYBODY* = bodybody object
   int =   index of first body sub-part.
           If this parameter is -1, this function returns TRUE if contact is detected
           for at least one subpart of the first body.
   int =   index of second body sub-part.
           If this parameter is -1, this function returns TRUE if contact is detected
           for at least one subpart of the second body.
   D3DXVECTOR3* = if not null, contact location (absolute). Return data.
   D3DXVECTOR3* = if not null, contact normal (absolute orientation). Return data.
   D3DXVECTOR3* = if not null, force (absolute orientation). Return data.
                  It is the force applied to the first body of the couple,
                  as a result of the collision.
   D3DXVECTOR3* = if not null, torque (absolute orientation). Return data.
                  It is the torque applied to the first body of the couple,
                  as a result of the collision.
   D3DXVECTOR3* = if not null, force, same as above but for second body. Return data.
   D3DXVECTOR3* = if not null, torque, same as above but for second body. Return data.
   NOTE: contact feedback must be enabled with iBodyBodyFeedbackEnable(), for the
   specified subpart (or subparts), before you can use this function to retrieve
   contact information.
   NOTE: if iBodyBodyCollisionResponseEnable() is FALSE for the specified bodybody object,
   collision location, normal, forces and torques are not computed and cannot be retrieved.
   As a consequence, the six D3DXVECTOR3* parameters are unused and should be set to NULL.
   

JOINTS


JOINT* iJointBallCreate(BODY*,BODY*,D3DXVECTOR3*)
   Create a joint that links two objects together by a point. Return joint object.
   BODY* = first body object
   BODY* = second body object
   D3DXVECTOR3* = joint (world-relative) location.
   Note: before creating the joint you must properly place the two objects. The joint
   location specifies a world-relative point that is supposed to match the desired
   connection point (anchor) for the two bodies at the time this function is called.

JOINT* iJointHingeCreate(BODY*,BODY*,D3DXVECTOR3*,D3DXVECTOR3*)
   Create a joint that links two objects together by a 'hinge', that is an axis
   about which the two bodies can rotate. Return joint object.
   BODY* = first body object
   BODY* = second body object
   D3DXVECTOR3* = joint axis (world-relative) location.
   D3DXVECTOR3* = joint axis (world-relative) direction.
   See also iJointBallCreate().

JOINT* iJointSliderCreate(BODY*,BODY*,D3DXVECTOR3*)
   Create a joint that links two objects together by a 'slider', that is a line
   along which the two bodies can move. Return joint object.
   BODY* = first body object
   BODY* = second body object
   D3DXVECTOR3* = joint axis (world-relative) direction.
   See also iJointBallCreate().

iJointDestroy(JOINT*)
   JOINT* = joint object to destroy
   Note that destroying joint objects is not necessary because the engine will
   do it automatically on exit.

iJointBallXStopsSet(JOINT*,float,float,float,float)
iJointBallYStopsSet(JOINT*,float,float,float,float)
iJointBallZStopsSet(JOINT*,float,float,float,float)
   Set XYZ rotational limits for the specified ball-type joint.
   JOINT* = joint object (must be ball type).
   float = lower angular limit for rotation about X (or Y, or Z) axis, in degrees.
           Setting this parameter to -180.0f or less actually removes the limit.
   float = higher angular limit for rotation about X (or Y, or Z) axis, in degrees.
           Setting this parameter to 180.0f or more actually removes the limit.
   float = rotational stop strength. The bigger the factor, the stronger the stop.
           A strong stop will resist torques more than a weak stop.
           By default, stop strength is 40000.0f (very strong).
           NOTE: to achieve soft stops you should set both strength and hardness (next
           parameter) to lower values, like for example 5.0f and 0.01f respectively.
   float = rotational stop hardness. The bigger the factor, the harder the stop.
           A soft stop will 'absorb' torques in a spongy way.
           By default, stop hardness is 1500000.0f (very hard).
   NOTE: rotational axes are joint-relative. Joint orientation is null when it is
   created. That is, its local axes orientation match world axes orientation.
   However the joint is linked to the first connected body (first iJointBallCreate()
   parameter). It means that its orientation changes when the first body orientation
   changes. See also iJointBallOrientationSet().
   NOTE: angular limits are specified as Euler angles. The math about Euler angles
   doesn't allow for all angle combinations. In practice it means that you should
   never allow Z-axis limits to be -90.0f or less and 90.0f or more, unless X-axis
   limits or Y-axis limits (or both) are 0.0f-0.0f. Failing to do so may severely
   disrupt the simulation and even crash the program.
   NOTE: rotational limits are not supported if one of the two linked bodies is static.

iJointBallXAMotorSet(JOINT*,float,float,float)
iJointBallYAMotorSet(JOINT*,float,float,float)
iJointBallZAMotorSet(JOINT*