-------------------------------------------------------------------------------- -- Function......... : updateVision -- Author........... : -- Description...... : -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function FPSCamera.updateVision ( ) -------------------------------------------------------------------------------- local o = this.getObject ( ) local d = this.hDynObject ( ) if ( d ~= nil ) then local dt = application.getLastFrameTime ( ) -- Position -- local x, y, z = object.getTranslation ( d, object.kGlobalSpace ) object.translateTo ( o, x, y + 0.75, z, object.kGlobalSpace, 10 * dt ) -- Orientation -- local rh = math.interpolate ( this.nCurAngleH ( ), this.nDstAngleH ( ), 20 * dt ) local rv = math.interpolate ( this.nCurAngleV ( ), this.nDstAngleV ( ), 20 * dt ) this.nCurAngleH ( rh ) this.nCurAngleV ( rv ) object.setRotation ( o, 0, rh, 0, object.kGlobalSpace ) object.rotate ( o, rv, 0, 0, object.kLocalSpace ) end -------------------------------------------------------------------------------- end --------------------------------------------------------------------------------