JPAnimation

JPAnimation

Magic tool to animate everything you want in your game.
Version : 6.0
Price : $50
State : Out

Changelog

v6.0

  • Now compatible with ShiVa 2.0.
  • Plugin API compiled for Mac and Linux in addition to Windows : it will provide API completion in the Script module in ShiVa Editor for each of these operating systems.
  • Now uses a user token instead of an email to activate

v5.0

  • Is now able to animate HUD component for all the local users, not only the main one (requires JPExtendedAPI 4.0)
  • Now able to send callbacks to any local user, by giving leaveAnimationMode the nUserID in place of the hObjectDelegate parameter)
  • Fixed a bug with animations with a zero duration

v4.4

  • Optimized for ShiVa 1.9.2

v4.3

  • New function:
    • bYes = isInAnimationMode ( )

v4.2

  • Added the compatibility with JPAnimation.callFunction/callFunctionWithDelay/callFunctionOverTime with the following functions:
    • hud.callAction
    • hud.destroyTemplateInstance
    • hud.finishAction
    • hud.killFocus
    • hud.pauseSound
    • hud.playSound
    • hud.resumeSound
    • hud.setSoundBank
    • hud.setSoundVolume
    • hud.stopAllSounds
    • hud.stopSound
    • hud.forceCursorShape
    • hud.setCursorPosition
    • hud.setCursorVisible
    • hud.newTemplateInstance
    • hud.setDefaultFont
    • hud.setDefaultTextShadowColor

v4.1

  • New function to call a non animated function over the animation duration:

    • JPAnimation.callFunctionOverTime ( nParamCount, sApiDotFunction, vParam0, vParam1, ... )
  • Fixed a bug with delay and callFunctionWithDelay.

  • New functions of the JPExtendedAPI pack are supported:

    • application.setGlobalSoundsVolumeCoef ( nCoef )
    • hud.translate ( hComponent, nTx, nTy )
    • sound.setVolume ( hObject, nSoundIndex, nVolume )

v4.0

  • Parameter changed for:
    • JPAnimation.setDefaultLookAtMode ( kLookAtMode )
    • JPAnimation.setLoopMode ( kLoopMode )
  • New constants:
    • JPAnimation.kLoopModeOnce
    • JPAnimation.kLoopModeOnceReversed
    • JPAnimation.kLoopModeLoop
    • JPAnimation.kLoopModeLoopReversed
    • JPAnimation.kLoopModePingPong
  • New functions to change animation parameters on the fly:
    • JPAnimation.changeAnimationLoopMode ( sAnimationID, kLoopMode )
    • JPAnimation.changeAnimationTime ( sAnimationID, nTime )
    • JPAnimation.changeAnimationTimeFactor ( sAnimationID, nTimeFactor )
  • New global functions:
    • nTimeFactor = JPAnimation.getGlobalTimeFactor ( )
    • JPAnimation.setGlobalTimeFactor ( nTimeFactor )
  • New set functions:
    • JPAnimation.setTimeFactor ( nTimeFactor )
    • JPAnimation.setDefaultTimeFactor ( nTimeFactor )
  • New get functions
    • nDuration = JPAnimation.getAnimationDuration ( sAnimationID )
    • kLoopMode = JPAnimation.getAnimationLoopMode ( sAnimationID )
    • nTime = JPAnimation.getAnimationTime ( sAnimationID )
    • nTimeFactor = JPAnimation.getAnimationTimeFactor ( sAnimationID )

v3.4

  • Bug fixes and improvements

v3.3

New feature: loop mode. You can now define a looping animation without having to use callbacks:

  • JPAnimation.setLoopMode ( bLoop )
  • JPAnimation.setDefaultLoopMode ( bLoop )

New function to set several parameters at once:

  • JPAnimation.setParameters ( sAnimation, nDuration, nDelay, bLoop, bUseTargetInsteadOfCurrentValues, bWaitUntilDone )

leaveAnimationMode now returns the total duration of the animation you've just created:

  • nTotalDuration = JPAnimation.leaveAnimationMode ( )

Parameters order changed for the following function, in order to make it more readable:

  • JPAnimation.addFunction ( sAPI, sSetFunction, nSetParamsCount, tGetReturnsIndexes, sGetFunction, tGetParamsIndexes )

v3.2

  • Now possible to not interpolate all the values of a function by setting nil values instead (eg: object.setTranslation ( hObject, nil, nil, 50, object.kGlobalSpace )). Works for all the functions that have a equivalent get function plus object.translate and object.rotateTo. Functions like object.lookAt, object.rotateAround are not supported.

  • If a function is missing, you can add it yourself to the pack thanks to the new function: JPAnimation.addFunction

  • it is now possible to pass additional parameters to the JPAnimation.setAnimation function. It is useful for instance to send parameters to the JPTweener curves.

  • Fixed a bug with JPAnimation.callFunction for HUDs

  • application.setOption is now supported

  • JPAnimation process optimized.

  • Pack size greatly reduced

v3.1

Fixed a bug with JPAnimation.sendValueToUser, was instant instead of animated.

Function JPAnimation.useInstantFeature ( ) removed, this feature is now activated by default. This feature allows to force a function to not be animated in an animation bloc by prefixing it with 'instant.' or 'inst.', for instance: inst.object.setRotation ( hObject, 0, 45, 0, object.kGlobalSpace )

New functions:

  • JPAnimation.setLookAtMode ( kLookAtMode )
  • JPAnimation.setDefaultLookAtMode ( kLookAtMode )

New constants:

  • JPAnimation.kLookAtModeStartPosition
  • JPAnimation.kLookAtModeUpdatedPositionProgressiveFactor
  • JPAnimation.kLookAtModeUpdatedPositionFullFactor

Removed the setAllowClosestRotations and setDefaultAllowClosestRotations functions. Here's the new rotation functions behaviour:

  • Always rotate in the closest side: object.lookAt, object.lookAtWithUp, object.rotateTo, object.rotateToAxisAngle, object.rotateToQuaternion, object.rotateToYPR, object.setRotation, object.setRotationYPR, object.setRotationAxisAngle, object.setRotationQuaternion.
  • Never rotate in the closest side: object.rotateYPR, object.rotateAxisAngle, object.rotateQuaternion.

v3.0

  • Fixed the function object.rotateAround, was not working properly.

  • The following functions always rotate in the closest side: object.lookAt, object.lookAtWithUp, object.rotateTo, object.rotateToAxisAngle, object.rotateToQuaternion, object.rotateToYPR.

  • The following functions never rotate in the closest side: object.rotate, object.rotateYPR, object.rotateAxisAngle, object.rotateQuaternion.

  • For the following functions, you can choose to rotate in the closest side: object.setRotation, object.setRotationYPR, object.setRotationAxisAngle, object.setRotationQuaternion.

  • To choose, use the following functions: JPAnimation.setAllowClosestRotations ( bAllow ) JPAnimation.setDefaultAllowClosestRotations ( bAllow )

v2.4

  • Rotations now are always animated in the closest side.

v2.3

  • JPAnimation.enableJPExtendedAPIFunctions removed, not needed anymore to get the JPExtendedAPI functions working with JPAnimation.

  • All of the functions impacting the objects rotation now share the same start parameters (UseTargetInsteadOfCurrentValues mode)

  • All of the functions impacting the objects translation now share the same start parameters (UseTargetInsteadOfCurrentValues mode)

  • All of the functions impacting the HUDs positions now share the same start parameters (UseTargetInsteadOfCurrentValues mode)

  • New functions: object.lookAt object.lookAtWithUp object.matchRotation object.matchTranslation object.resetRotation object.resetTranslation object.rotate object.rotateAround object.rotateAxisAngle object.rotateQuaternion object.rotateTo object.rotateToAxisAngle object.rotateToQuaternion object.rotateToYPR object.rotateYPR object.setRotationAxisAngle object.setRotationYPR object.translate object.translateTo

v2.2

  • New functions: JPAnimation.pause ( sAnimationID ) JPAnimation.pauseAll ( ) JPAnimation.resume ( sAnimationID ) JPAnimation.resumeAll ( ) bPaused = JPAnimation.isPaused ( sAnimationID )

  • JPAnimation is now compatible with the JPExtendedAPI functions. Call JPAnimation.enableJPExtendedAPIFunctions ( ) to link these functions with JPAnimation. The following functions are supported: hud.setComponentScreenSpaceBottomLeftCorner ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceBottomRightCorner ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceCenter ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceTopLeftCorner ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceTopRightCorner ( hComponent, nPositionX, nPositionY )

  • Optimizations (up to 20%)

  • You can now force a function to be called instantly while in an animation bloc. You just have to prefix the function with "instant.", for instance: instant.object.setRotation ( hObject, 0, 90, 0, object.kGlobalSpace ) You can also prefix with "inst."

  • JPAnimation.callFunction and JPAnimation.callFunctionWithDelay can now call any function, even those that are not in the base ShiVa's API.

v2.1

  • Internal modifications to prevent eventual conflicts between packs.

v2.0

  • It is now possible to add a delay after the call of the last function in an animation block, using JPAnimation.setDelay ( nDelay )
  • You can now add the declaration of any function in an animation block, to get it called at right time in your animation timeline, by using JPAnimation.callFunction ( nParamCount, sAPIDotFunction, vParam0, vParam1, ... )
  • You can now delay the call of any function without having to declare an animation block, by using JPAnimation.callFunctionWithDelay ( nDelay, nParamCount, sApiDotFunction, vParam0, vParam1, ... )
  • Fixed an issue with the default delay (was always 0), for instance JPAnimation.callFunctionWithDelay ( 5, 1, "log.warning", "This is a test" ) will result in a warning message appearing after a delay of 5 seconds.
  • Fixed an issue with hud_setComponentPosition, hud_setListColumnWidthAt, scene_setOceanNormalMapScrollingSpeed and sfx_setParticleEmitterOpacityAt which were throwing a "bad argument count" error message.
  • Code optimizations (up to 40% less CPU consumption)

v1.4

  • New functions are supported: dynamics.setBounce dynamics.setLinearVelocity dynamics.setAngularSpeedLimit dynamics.setLinearSpeedLimit dynamics.setBounceThreshold dynamics.setFriction dynamics.setAngularVelocity dynamics.setOffset dynamics.setMass mesh.setSubsetIndexValue mesh.setSubsetVertexTexCoord pixelmap.setPixel shape.overrideSkeletonJointRotation shape.overrideSkeletonJointTranslation shape.setSkeletonJointRotation shape.setSkeletonJointTranslation

v1.3

  • Fixed a random issue blocking the activation of the pack

v1.2

  • Error messages now are easier to understand.

v1.1

  • Fixed an issue with light.setColor
  • Many new functions are supported:

--hud hud.setComponentZOrder ( hComponent, nZOrder ) hud.setDefaultTextShadowColor ( hUser, nRed, nGreen, nBlue, nAlpha ) hud.setEditTextDisplayRange ( hComponent, nRangeMin, nRangeMax ) hud.setEditTextMaxLength ( hComponent, nLength ) hud.setLabelTextDisplayRange ( hComponent, nRangeMin, nRangeMax ) hud.setListFingerScrollingInertia ( hComponent, nInertia ) hud.setListItemsForegroundColorSelected ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setListVerticalScrollPos ( hComponent, nValue )

--light light.setDynamicShadowsViewSpaceClipRectangle ( hObject, nMinX, nMinY, nMaxX, nMaxY )

--mesh mesh.setSubsetVertexNormal ( hObject, nCurveIndex, nPointIndex, x, y, z ) mesh.setSubsetVertexPosition ( hMesh, nSubset, nVertex, x, y, z )

--microphone microphone.setSpectrumWidth ( nWidth )

--navigation navigation.setWaitTimeout ( hObject, nTimeout ) navigation.setPathMaxLength ( hObject, nMaxLength )

--object object.setRotationQuaternion ( hObject, nQuatX, nQuatY, nQuatZ, nQuatW, kSpace )

--scene scene.setAnimationsFrameTimeFactor ( hScene, nFactor ) scene.setColorGradingFadeTime ( hScene, nFadeTime ) scene.setColorLevels ( hScene, r, g, b, nFactor ) scene.setColorSaturation ( hScene, r, g, b, nFactor ) scene.setDynamicsFrameTimeFactor ( hScene, nFactor ) scene.setDynamicsIterationsPerStep ( hScene, nIterations ) scene.setDynamicsTimeStep ( hScene, nTimeStep ) scene.setOceanReflectorBias ( hScene, nBias ) scene.setOceanRefractionNoiseScale ( hScene, nScale ) scene.setParticlesFrameTimeFactor ( hScene, nFactor ) scene.setTrailsFrameTimeFactor ( hScene, nFactor )

--shape shape.setCurveEndColor ( hObject, nCurveIndex, nRed, nGreen, nBlue ) shape.setCurvePoint ( hMesh, nSubset, nVertex, x, y, z ) shape.setCurveStartColor ( hObject, nCurveIndex, nRed, nGreen, nBlue ) shape.setMeshOpacity ( hObject, nOpacity ) shape.setMeshSubsetMaterialEffectMap0AdditionalUVOffset ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetMaterialEffectMap0AdditionalUVRotation ( hObject, nSubsetIndex, nCenterU, nCenterV, nAngle ) shape.setMeshSubsetMaterialEffectMap0AdditionalUVScale ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetMaterialEffectMap1AdditionalUVOffset ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetMaterialEffectMap1AdditionalUVRotation ( hObject, nSubsetIndex, nCenterU, nCenterV, nAngle ) shape.setMeshSubsetMaterialEffectMap1AdditionalUVScale ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetVertexColor ( hObject, nSubset, nVertex, r, g, b, a )

--user user.setRenderPriority ( hUser, nPriority )

--sfx sfx.setParticleEmitterOpacityAt ( hObject, nIndex, nOpacity ) sfx.setTrailOpacityAt ( hObject, nIndex, nOpacity )

API

--JPAnimation API JPAnimation.activate ( sUserToken, sActivationKey ) --Animation mode sAnimationID = JPAnimation.enterAnimationMode ( bOptResetParameters ) nTotalDuration = JPAnimation.leaveAnimationMode ( hOptCompletionObject, sOptCompletionAIModel, sOptCompletionHandler, vOptParam0, vOptParam1, vOptParam2, vOptParam3, vOptParam4, vOptParam5, vOptParam6, vOptParam7, vOptParam8, vOptParam9 ) bYes = JPAnimation.isInAnimationMode ( ) --If you want a function to not be animated in an animation bloc, prefix it with 'instant.' or 'inst.'. For instance, instant.object.setRotation ( hObject, 0, 90, 0, object.kGlobalSpace ) will never be animated. --Animation handling JPAnimation.cancel ( sAnimationID ) JPAnimation.cancelAll ( ) bAlive = JPAnimation.isAlive ( sAnimationID ) JPAnimation.pause ( sAnimationID ) JPAnimation.pauseAll ( ) JPAnimation.resume ( sAnimationID ) JPAnimation.resumeAll ( ) bPaused = JPAnimation.isPaused ( sAnimationID ) bYes = JPAnimation.respondToFunction ( sApiDotFunction ) --Set values --Several at once JPAnimation.setParameters ( sAnimation, nDuration, nDelay, kLoopMode, bUseTargetInsteadOfCurrentValues, bWaitUntilDone ) --One by one JPAnimation.setAnimation ( sAnimation, vParam0, vParam1, vParam2, vParam3, vParam4 ) JPAnimation.setDelay ( nDelay ) JPAnimation.setDuration ( nDuration ) JPAnimation.setLookAtMode ( kLookAtMode ) JPAnimation.kLookAtModeStartPosition JPAnimation.kLookAtModeUpdatedPositionProgressiveFactor JPAnimation.kLookAtModeUpdatedPositionFullFactor JPAnimation.setLoopMode ( kLoopMode ) JPAnimation.kLoopModeOnce JPAnimation.kLoopModeOnceReversed JPAnimation.kLoopModeLoop JPAnimation.kLoopModeLoopReversed JPAnimation.kLoopModePingPong JPAnimation.setTimeFactor ( nTimeFactor ) JPAnimation.setUseTargetInsteadOfCurrentValues ( bUseTargetInsteadOfCurrentValues ) JPAnimation.setWaitUntilDone ( bWaitUntilDone ) --Define default values, used when calling JPAnimation.enterAnimationMode ( true ). JPAnimation.resetToDefaultParameters ( ) JPAnimation.setDefaultAnimation ( sAnimation, vParam0, vParam1, vParam2, vParam3, vParam4 ) JPAnimation.setDefaultDelay ( nDelay ) JPAnimation.setDefaultDuration ( nDuration ) JPAnimation.setDefaultLookAtMode ( kLookAtMode ) JPAnimation.setDefaultLoopMode ( kLoopMode ) JPAnimation.setDefaultTimeFactor ( nTimeFactor ) JPAnimation.setDefaultUseTargetInsteadOfCurrentValues ( bUseTargetInsteadOfCurrentValues ) JPAnimation.setDefaultWaitUntilDone ( bWaitUntilDone ) --Animation parameters that can be changed on the fly JPAnimation.changeAnimationLoopMode ( sAnimationID, kLoopMode ) JPAnimation.changeAnimationTime ( sAnimationID, nTime ) JPAnimation.changeAnimationTimeFactor ( sAnimationID, nTimeFactor ) --Get functions nDuration = JPAnimation.getAnimationDuration ( sAnimationID ) kLoopMode = JPAnimation.getAnimationLoopMode ( sAnimationID ) nTime = JPAnimation.getAnimationTime ( sAnimationID ) nTimeFactor = JPAnimation.getAnimationTimeFactor ( sAnimationID ) --Global parameters nTimeFactor = JPAnimation.getGlobalTimeFactor ( ) JPAnimation.setGlobalTimeFactor ( nTimeFactor ) --Interpolate a value JPAnimation.sendValueToObject ( hObject, sAIModel, sHandler, nStartValue, nEndValue ) JPAnimation.sendValueToUser ( hUser, sAIModel, sHandler, nStartValue, nEndValue ) --Call of any function JPAnimation.callFunction ( nParamCount, sApiDotFunction, vParam0, vParam1, ... ) JPAnimation.callFunctionWithDelay ( nDelay, nParamCount, sApiDotFunction, vParam0, vParam1, ... ) JPAnimation.callFunctionOverTime ( nParamCount, sApiDotFunction, vParam0, vParam1, vParam2, vParam3, vParam4, vParam5, vParam6, vParam7, vParam8, vParam9, vParam10, vParam11, vParam12, vParam13, vParam14, vParam15 ) --Add an unsupported function yourself JPAnimation.addFunction ( sAPI, sSetFunction, nSetParamsCount, tGetReturnsIndexes, sGetFunction, tGetParamsIndexes ) --What are tGetReturnsIndexes and tGetParamsIndexes? They are the parameters index of the set function, for the parameters and return values of the get function. --Example: --JPAnimation.addFunction ( "object", "setTranslation", 5, {1,2,3}, "getTranslation", {0,4} ) -- --Here are the 5 params for the set function: object.setTranslation ( hObject, nTx, nTy, nTz, kSpace ) -- #0 #1 #2 #3 #4 --Here are the params for the get function: nTx, nTy, nTz = object.getTranslation ( hObject, kSpace ) --tGetReturnsIndexes is {1,2,3} -> nTx, nTy and nTz were params #1, #2 and #3 for the setTranslation function --tGetReturnsIndexes is {0,4} -> hObject and kSpace were params #0 and #4 for the setTranslation function -- --To summurize, you can read it like that: --Function definition: JPAnimation.addFunction ( "object", "setTranslation", 5, {1,2,3}, "getTranslation", {0,4} ) --Params index from set to get function: object.setTranslation ( #0, #1, #2, #3, #4 ) #1, #2, #3 = object.getTranslation ( #0, #4 ) --SUPPORTED FUNCTIONS --JPExtendedAPI application.setGlobalSoundsVolumeCoef ( nCoef ) hud.setComponentScreenSpaceBottomLeftCorner ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceBottomRightCorner ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceCenter ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceTopLeftCorner ( hComponent, nPositionX, nPositionY ) hud.setComponentScreenSpaceTopRightCorner ( hComponent, nPositionX, nPositionY ) hud.translate ( hComponent, nTx, nTy ) sound.setVolume ( hObject, nSoundIndex, nVolume ) --animation animation.setPlaybackCursor ( hObject, nBlendLayer, nValue ) animation.setPlaybackLevel ( hObject, nBlendLayer, nValue ) animation.setPlaybackSpeed ( hObject, nBlendLayer, nValue ) animation.setSkeletonScale ( hObject, nBlendLayer, nValue ) --application application.setCurrentUserAIVariable ( sAIModel, sVariable, vValue ) application.setCurrentUserEnvironmentVariable ( sName, vValue ) application.setFrameTimeFactor ( nValue ) application.setOption ( kOption, nValue ) --camera camera.setAspectRatioScale ( hObject, nValue ) camera.setDepthBlurFactor ( hObject, nValue ) camera.setChromaticAberrationAmplitude ( hObject, nValue ) camera.setChromaticAberrationFactor ( hObject, nValue ) camera.setDepthBlurFocusRangeMax ( hObject, nValue ) camera.setDepthBlurFocusRangeMin ( hObject, nValue ) camera.setDistortionAmplitude ( hObject, nValue ) camera.setDistortionFactor ( hObject, nValue ) camera.setDistortionFrequency ( hObject, nValue ) camera.setDistortionMapAmplitude ( hObject, nValue ) camera.setDistortionMapFactor ( hObject, nValue ) camera.setDistortionMapUVOffset ( hObject, u, v ) camera.setDistortionMapUVScale ( hObject, u, v ) camera.setDistortionTiling ( hObject, nValue ) camera.setFieldOfView ( hObject, nValue ) camera.setMaxViewDistance ( hObject, nValue ) camera.setMinViewDistance ( hObject, nValue ) camera.setMotionBlurFactor ( hObject, nValue ) camera.setVelocityBlurFactor ( hObject, nValue ) --dynamics dynamics.setAngularDamping ( hObject, nCoef ) dynamics.setAngularSpeedLimit ( hObject, nLimit ) dynamics.setAngularVelocity ( hObject, x, y, z, kSpace ) dynamics.setBounce ( hObject, nCoef ) dynamics.setBounceThreshold ( hObject, nThreshold ) dynamics.setFriction ( hObject, nCoef ) dynamics.setLinearDamping ( hObject, nCoef ) dynamics.setLinearSpeedLimit ( hObject, nLimit ) dynamics.setLinearVelocity ( hObject, x, y, z, kSpace ) dynamics.setMass ( hObject, nMass ) dynamics.setOffset ( hObject, x, y, z ) --hud hud.setButtonTextHeight ( hComponent, nValue ) hud.setButtonTextLetterSpacing ( hComponent, nValue ) hud.setButtonTextLineSpacing ( hComponent, nValue ) hud.setCheckTextHeight ( hComponent, nValue ) hud.setCheckTextLetterSpacing ( hComponent, nValue ) hud.setCheckTextLineSpacing ( hComponent, nValue ) hud.setComponentBackgroundColor ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setComponentBackgroundImageUVOffset ( hComponent, nOffsetU, nOffsetV ) hud.setComponentBackgroundImageUVScale ( hComponent, nScaleU, nScaleV ) hud.setComponentBorderColor ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setComponentForegroundColor ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setComponentOpacity ( hComponent, nValue ) hud.setComponentPosition ( hComponent, nPositionX, nPositionY ) hud.setComponentRotation ( hComponent, nValue ) hud.setComponentShapeEllipseMaxAngle ( hComponent, nValue ) hud.setComponentShapeEllipseMinAngle ( hComponent, nValue ) hud.setComponentShapeRoundRectangleCornerRadius ( hComponent, nValue ) hud.setComponentSize ( hComponent, nSizeX, nSizeY ) hud.setComponentZOrder ( hComponent, nZOrder ) hud.setCursorPosition ( hComponent, nPosX, nPosY ) hud.setDefaultTextShadowColor ( hUser, nRed, nGreen, nBlue, nAlpha ) hud.setEditTextHeight ( hComponent, nValue ) hud.setEditTextLetterSpacing ( hComponent, nValue ) hud.setEditTextLineSpacing ( hComponent, nValue ) hud.setEditTextDisplayRange ( hComponent, nRangeMin, nRangeMax ) hud.setEditTextMaxLength ( hComponent, nLength ) hud.setLabelTextHeight ( hComponent, nValue ) hud.setLabelTextLetterSpacing ( hComponent, nValue ) hud.setLabelTextDisplayRange ( hComponent, nRangeMin, nRangeMax ) hud.setLabelTextLineSpacing ( hComponent, nValue ) hud.setListColumnWidthAt ( hComponent, nColumn, nWidth ) hud.setListItemsBackgroundColorEven ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setListItemsBackgroundColorOdd ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setListItemsBackgroundColorSelected ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setListItemsHeight ( hComponent, nValue ) hud.setListTextHeight ( hComponent, nValue ) hud.setListTextLeftMargin ( hComponent, nValue ) hud.setListTextLetterSpacing ( hComponent, nValue ) hud.setListTextLineSpacing ( hComponent, nValue ) hud.setListTextRightMargin ( hComponent, nValue ) hud.setListFingerScrollingInertia ( hComponent, nInertia ) hud.setListItemsForegroundColorSelected ( hComponent, nRed, nGreen, nBlue, nAlpha ) hud.setListVerticalScrollPos ( hComponent, nValue ) hud.setMoviePlaybackProgress ( hComponent, nProgress ) hud.setPixelMapUVOffset ( hComponent, nOffsetU, nOffsetV ) hud.setProgressValue ( hComponent, nValue ) hud.setSliderValue ( hComponent, nValue ) --light light.setColor ( hObject, nRed, nGreen, nBlue ) light.setDynamicShadowsViewSpaceClipRectangle ( hObject, nMinX, nMinY, nMaxX, nMaxY ) --mesh mesh.setSubsetIndexValue ( hMesh, nSubset, nLOD, nIndex, nValue ) mesh.setSubsetVertexNormal ( hObject, nCurveIndex, nPointIndex, x, y, z ) mesh.setSubsetVertexPosition ( hMesh, nSubset, nVertex, x, y, z ) mesh.setSubsetVertexTexCoord ( hMesh, nSubset, nVertex, nSet, u, v ) --microphone microphone.setSpectrumWidth ( nWidth ) --navigation navigation.setAcceleration ( hObject, nValue ) navigation.setHeightOffset ( hObject, nValue ) navigation.setPathMaxLength ( hObject, nMaxLength ) navigation.setSpeedLimit ( hObject, nValue ) navigation.setWaitTimeout ( hObject, nTimeout ) --object object.lookAt ( hObject, nPx, nPy, nPz, kSpace, nFactor ) object.lookAtWithUp ( hObject, nPx, nPy, nPz, nUx, nUy, nUz, kSpace, nFactor ) object.matchRotation ( hObject, hOtherObject, kSpace ) object.matchTranslation ( hObject, hOtherObject, kSpace ) object.resetRotation ( hObject, kSpace ) object.resetTranslation ( hObject, kSpace ) object.rotate ( hObject, nRx, nRy, nRz, kSpace ) object.rotateAround ( hObject, nPx, nPy, nPz, nRx, nRy, nRz, kSpace ) object.rotateAxisAngle ( hObject, nAxisX, nAxisY, nAxisZ, nAngle, kSpace ) object.rotateQuaternion ( hObject, nQuatX, nQuatY, nQuatZ, nQuatW, kSpace ) object.rotateTo ( hObject, nRx, nRy, nRz, kSpace, nFactor ) object.rotateToAxisAngle ( hObject, nAxisX, nAxisY, nAxisZ, nAngle, kSpace, nFactor ) object.rotateToQuaternion ( hObject, nQuatX, nQuatY, nQuatZ, nQuatW, kSpace, nFactor ) object.rotateToYPR ( hObject, nYaw, nPitch, nRoll, kSpace, nFactor ) object.rotateYPR ( hObject, nYaw, nPitch, nRoll, kSpace ) object.setAIVariable ( hObject, sAIModel, sVariable, vValue ) object.setRotation ( hObject, nRx, nRy, nRz, kSpace ) object.setRotationAxisAngle ( hObject, nAxisX, nAxisY, nAxisZ, nAngle, kSpace ) object.setRotationQuaternion ( hObject, nQuatX, nQuatY, nQuatZ, nQuatW, kSpace ) object.setRotationYPR ( hObject, nYaw, nPitch, nRoll, kSpace ) object.setScale ( hObject, nSx, nSy, nSz ) object.setTranslation ( hObject, nTx, nTy, nTz, kSpace ) object.setUniformScale ( hObject, nScale ) object.translate ( hObject, nTx, nTy, nTz, kSpace ) object.translateTo ( hObject, nTx, nTy, nTz, kSpace, nFactor ) --pixelmap pixelmap.setBrushOrigin ( hPixelMap, sBrush, x, y ) pixelmap.setPixel ( hPixelMap, x, y, r, g, b, a ) --projector projector.setColor ( hObject, nRed, nGreen, nBlue ) projector.setFieldOfView ( hObject, nValue ) projector.setMaxClipDistance ( hObject, nValue ) projector.setMinClipDistance ( hObject, nValue ) projector.setOpacity ( hObject, nOpacity ) --scene scene.setAmbientColor ( hScene, r, g, b ) scene.setAmbientOcclusionColor ( hScene, r, g, b ) scene.setAmbientOcclusionDepthBias ( hScene, nValue ) scene.setAmbientOcclusionDistance ( hScene, nValue ) scene.setAmbientOcclusionIntensity ( hScene, nValue ) scene.setAmbientOcclusionSampleCount ( hScene, nValue ) scene.setAnimationsFrameTimeFactor ( hScene, nFactor ) scene.setBackgroundColor ( hScene, r, g, b ) scene.setBackgroundOpacity ( hScene, nValue ) scene.setBloomColoring ( hScene, nValue ) scene.setBloomIntensity ( hScene, nValue ) scene.setBloomMotionBlurFactor ( hScene, nValue ) scene.setBloomThreshold ( hScene, nValue ) scene.setColorContrast ( hScene, nValue ) scene.setColorGradingIntensity ( hScene, nValue ) scene.setColorGradingFadeTime ( hScene, nFadeTime ) scene.setColorLevels ( hScene, r, g, b, nFactor ) scene.setColorSaturation ( hScene, r, g, b, nFactor ) scene.setDistanceFogStart ( hScene, nValue ) scene.setDynamicShadowsFadeDistance ( hScene, nValue ) scene.setDynamicShadowsMaxDistance ( hScene, nValue ) scene.setDynamicsFrameTimeFactor ( hScene, nFactor ) scene.setDynamicsIterationsPerStep ( hScene, nIterations ) scene.setDynamicsTimeStep ( hScene, nTimeStep ) scene.setDynamicsGravity ( hScene, x, y, z ) scene.setFogColor ( hScene, r, g, b ) scene.setFogDensity ( hScene, nValue ) scene.setGammaCorrection ( hScene, nValue ) scene.setHeightFogDensityFactor ( hScene, nValue ) scene.setHeightFogLevel ( hScene, nValue ) scene.setMonochromeFilter ( hScene, r, g, b, nValue ) scene.setNormalMappingFadeScreenSize ( hScene, nValue ) scene.setNormalMappingMinScreenSize ( hScene, nValue ) scene.setOceanDepthAttenuationFactor ( hScene, nValue ) scene.setOceanFoamMapScrollingSpeed ( hScene, x, z ) scene.setOceanFoamMapTiling ( hScene, nValue ) scene.setOceanFresnelBias ( hScene, nValue ) scene.setOceanFresnelPower ( hScene, nValue ) scene.setOceanNormalMapScrollingSpeed ( hScene, x, z ) scene.setOceanNormalMapTiling ( hScene, nValue ) scene.setOceanReflectedObjectsMaxSurfaceDistance ( hScene, nValue ) scene.setOceanReflectionNoiseScale ( hScene, nValue ) scene.setOceanSurfaceColor ( hScene, r, g, b ) scene.setOceanSurfaceColorFactor ( hScene, nValue ) scene.setOceanSurfaceColorMaxDistance ( hScene, nValue ) scene.setOceanUnderwaterFogColor ( hScene, r, g, b ) scene.setOceanUnderwaterFogDensity ( hScene, nValue ) scene.setOceanReflectorBias ( hScene, nBias ) scene.setOceanRefractionNoiseScale ( hScene, nScale ) scene.setOceanWavesAmplitude ( hScene, nValue ) scene.setOceanWavesFrequency ( hScene, nValue ) scene.setOceanWavesMeanHeight ( hScene, nValue ) scene.setParticlesFrameTimeFactor ( hScene, nFactor ) scene.setPerPixelLightingMinScreenSize ( hScene, nValue ) scene.setPotentiallyOccludedObjectMaxSize ( hScene, nValue ) scene.setShadowAmbientColor ( hScene, r, g, b ) scene.setSkyBoxColor ( hScene, r, g, b ) scene.setSpecularLightingFadeScreenSize ( hScene, nValue ) scene.setSpecularLightingMinScreenSize ( hScene, nValue ) scene.setTrailsFrameTimeFactor ( hScene, nFactor ) --sensor sensor.setBoxCenterAt ( hObject, nIndex, x, y, z, kSpace ) sensor.setBoxSizeAt ( hObject, nIndex, sx, sy, sz ) sensor.setSphereCenterAt ( hObject, nIndex, x, y, z, kSpace ) sensor.setSphereRadiusAt ( hObject, nIndex, nRadius ) --sfx sfx.setParticleAttractorFieldPointPosition ( hObject, nIndex, x, y, z, kSpace ) sfx.setParticleAttractorFieldStrength ( hObject, nIndex, nValue ) sfx.setParticleEmitterCustomForce ( hObject, nIndex, x, y, z, kSpace ) sfx.setParticleEmitterGenerationRateAt ( hObject, nIndex, nValue ) sfx.setParticleEmitterInitialCountFactorAt ( hObject, nIndex, nFactor ) sfx.setParticleEmitterInitialSpeedFactorAt ( hObject, nIndex, nValue ) sfx.setParticleEmitterKillBoxAt ( hObject, nIndex, xmin, ymin, zmin, xmax, ymax, zmax ) sfx.setParticleEmitterLifeTimeFactorAt ( hObject, nIndex, nValue ) sfx.setParticleEmitterOpacityAt ( hObject, nIndex, nOpacity ) sfx.setParticleEmitterUniformScaleAt ( hObject, nIndex, nValue ) sfx.setParticleTurbulenceFieldFrequency ( hObject, nIndex, nFrequency ) sfx.setParticleTurbulenceFieldStrength ( hObject, nIndex, nStrength ) sfx.setParticleVortexFieldAxialDrop ( hObject, nIndex, nValue ) sfx.setParticleVortexFieldAxialDropDamping ( hObject, nIndex, nValue ) sfx.setParticleVortexFieldOrbitalSpeed ( hObject, nIndex, nValue ) sfx.setParticleVortexFieldOrbitalSpeedDamping ( hObject, nIndex, nValue ) sfx.setParticleVortexFieldRadialPull ( hObject, nIndex, nValue ) sfx.setParticleVortexFieldRadialPullDamping ( hObject, nIndex, nValue ) sfx.setParticleVortexFieldStrength ( hObject, nIndex, nValue ) sfx.setTrailOpacityAt ( hObject, nIndex, nOpacity ) --shape shape.overrideSkeletonJointRotation ( hObject, sJointName, rx, ry, rz, kSpace, nFactor ) shape.overrideSkeletonJointTranslation ( hObject, sJointName, tx, ty, tz, kSpace, nFactor ) shape.setCurveEndColor ( hObject, nCurveIndex, nRed, nGreen, nBlue ) shape.setCurvePoint ( hMesh, nSubset, nVertex, x, y, z ) shape.setCurveStartColor ( hObject, nCurveIndex, nRed, nGreen, nBlue ) shape.setMeshOpacity ( hObject, nOpacity ) shape.setMeshSubsetMaterialEffectMap0AdditionalUVOffset ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetMaterialEffectMap0AdditionalUVRotation ( hObject, nSubsetIndex, nCenterU, nCenterV, nAngle ) shape.setMeshSubsetMaterialEffectMap0AdditionalUVScale ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetMaterialEffectMap1AdditionalUVOffset ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetMaterialEffectMap1AdditionalUVRotation ( hObject, nSubsetIndex, nCenterU, nCenterV, nAngle ) shape.setMeshSubsetMaterialEffectMap1AdditionalUVScale ( hObject, nSubsetIndex, u, v ) shape.setMeshSubsetVertexColor ( hObject, nSubset, nVertex, r, g, b, a ) shape.setSkeletonJointRotation ( hObject, sJointName, rx, ry, rz, kSpace, nFactor ) shape.setSkeletonJointTranslation ( hObject, sJointName, tx, ty, tz, kSpace, nFactor ) --sound sound.setPlaybackProgress ( hObject, nSoundIndex, nValue ) sound.setSpatializationReferenceDistance ( hObject, nValue ) sound.setSpatializationRolloffFactor ( hObject, nValue ) --user user.setAIVariable ( hUser, sAIModel, sVariable, vValue ) user.setEnvironmentVariable ( hUser, sName, vValue ) user.setLocalSoundSourceReferenceDistance ( hUser, nValue ) user.setLocalSoundSourceRolloffFactor ( hUser, nValue ) user.setRenderPriority ( hUser, nPriority ) user.setViewport ( hUser, nLeft, nBottom, nWidth, nHeight )

Description

JPAnimation pack is truly magical. It is a system that will allow you to create animations in your games using the easiest possible way, by using the functions of the ShiVa base API. Usually, when you use a ShiVa function, the effect is instantaneous. With JPAnimation, you can choose at any time to enter or exit the 'animation mode', a mode where all the functions that you use will be applied not instantly but gradually from the current value to the new value, over a defined duration. See for yourself how this works:

object.setTranslation ( hObject, 0, 0, 0, object.kGlobalSpace ) JPAnimation.enterAnimationMode ( ) object.setTranslation ( hObject, 5, 0, 0, object.kGlobalSpace ) JPAnimation.leaveAnimationMode ( )

The object is firstly placed at the origin of the scene. Then is declared an animation block (between enterAnimationMode and leaveAnimationMode). Everything in that block will be interpreted as functions that have to be animated. Here is defined a new position of the object (5,0,0). This will make the object moving from the position (0,0,0) to (5,0,0) over a duration of 1 second (which is the default animation duration).

You can also define an AIModel and a handler to be called when all of the animations defined in the block have ended. Thanks to JPAnimation, you can develop your game with a "event-driven programming" style, no need to create states or onEnterFrame anymore to animate things, JPAnimation does it for you.

The animation proposed by JPAnimation follows a linear curve. By installing the JPTweener pack, you can offer to JPAnimation all of the JPTweener transition curves. The combination of JPAnimation and JPTweener is very powerful, it allows you to make great animations in your game with very few lines of code. Try the sample to see what these packs are capable of. Here's how to use JPTweener with JPAnimation:

JPAnimation.setAnimation ( "easeInSine" )

JPAnimation works with most of the get/set function pairs of the ShiVa API, such as for objects (translation, rotation, scale, ...), for scenes (colors, shaders, ocean, fog distance, ...) and all of the other APIs. To know the list of the functions JPAnimation supports, please refer to the API page by clicking the corresponding button below. In case a function you need is missing, please contact me and I will be happy to complete the pack. In the meantime, you can reference the missing function into JPAnimation by yourself thanks to the great function: JPAnimation.addFunction

JPAnimation also offers to call any other function with a delay, by using JPAnimation.callFunction ( nParamCount, sApiDotFunction, vParam0, vParam1, ... ) like that:

object.setTranslation ( hObject, 0, 0, 0, object.kGlobalSpace ) JPAnimation.enterAnimationMode ( ) object.setTranslation ( hObject, 5, 0, 0, object.kGlobalSpace ) JPAnimation.callFunction ( 2, "object.setVisible", hObject, false ) JPAnimation.leaveAnimationMode ( )

As a result, the object will translate to its new position, and then will be hidden.

JPAnimation also provides a function JPAnimation.callFunctionWithDelay ( nDelay, nParamCount, sApiDotFunction, vParam0, vParam1, ... ). With this function, you will be able to delay the call of any function without having to declare an animation block:

JPAnimation.callFunctionWithDelay ( 5, 2, "hud.setComponentVisible", hComponent, true )

The HUD component will be visible in 5 seconds.