Streaming::setFocusPosAndVel: Difference between revisions
m (Help to clear focus after use) |
|||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
Override the area where the camera will render the terrain. | Override the area where the camera will render the terrain. After moving to another area, you need to clear focus. This can be done using the following native [[Streaming::clearFocus]] | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="javascript">mp.game.streaming. | <syntaxhighlight lang="javascript">mp.game.streaming.setFocusPosAndVel(x, y, z, velocityX, velocityY, velocityZ);</syntaxhighlight> | ||
=== Required Arguments === | === Required Arguments === | ||
*'''x:''' float | *'''x:''' float | ||
*'''y:''' float | *'''y:''' float | ||
*'''z:''' float | *'''z:''' float | ||
*''' | *'''velocityX:''' float | ||
*''' | *'''velocityY:''' float | ||
*''' | *'''velocityZ:''' float | ||
===Return value=== | ===Return value=== | ||
*'''Undefined''' | *'''Undefined''' | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
// | const position = new mp.Vector3(); | ||
mp.game.streaming.setFocusPosAndVel(position.x, position.y, position.z, 0, 0, 0); | |||
// Wait till it's loaded | |||
mp.game.streaming.newLoadSceneStartSphere(position.x, position.y, position.z, 30, 0); | |||
while (!mp.game.streaming.isNewLoadSceneLoaded()) { | |||
await mp.game.waitAsync(0); | |||
} | |||
mp.game.streaming.newLoadSceneStop(); | |||
// Your code | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{ | {{Streaming_functions_c}} | ||
[[Category:Clientside API]] | [[Category:Clientside API]] | ||
[[Category:TODO: Example]] | [[Category:TODO: Example]] | ||
Latest revision as of 03:35, 27 May 2024
Override the area where the camera will render the terrain. After moving to another area, you need to clear focus. This can be done using the following native Streaming::clearFocus
Syntax
mp.game.streaming.setFocusPosAndVel(x, y, z, velocityX, velocityY, velocityZ);
Required Arguments
- x: float
- y: float
- z: float
- velocityX: float
- velocityY: float
- velocityZ: float
Return value
- Undefined
Example
const position = new mp.Vector3();
mp.game.streaming.setFocusPosAndVel(position.x, position.y, position.z, 0, 0, 0);
// Wait till it's loaded
mp.game.streaming.newLoadSceneStartSphere(position.x, position.y, position.z, 30, 0);
while (!mp.game.streaming.isNewLoadSceneLoaded()) {
await mp.game.waitAsync(0);
}
mp.game.streaming.newLoadSceneStop();
// Your code
See also
- mp.game.streaming.loadAllObjectsNow
- mp.game.streaming.loadScene
- mp.game.streaming.networkUpdateLoadScene
- mp.game.streaming.isNetworkLoadingScene
- mp.game.streaming.setInteriorActive
- mp.game.streaming.requestModel
- mp.game.streaming.requestMenuPedModel
- mp.game.streaming.requestModel2
- mp.game.streaming.hasModelLoaded
- mp.game.streaming.requestModelsInRoom
- mp.game.streaming.setModelAsNoLongerNeeded
- mp.game.streaming.isModelInCdimage
- mp.game.streaming.isModelValid
- mp.game.streaming.isModelAPed
- mp.game.streaming.isModelAVehicle
- mp.game.streaming.requestCollisionAtCoord
- mp.game.streaming.requestCollisionForModel
- mp.game.streaming.hasCollisionForModelLoaded
- mp.game.streaming.requestAdditionalCollisionAtCoord
- mp.game.streaming.doesAnimDictExist
- mp.game.streaming.requestAnimDict
- mp.game.streaming.hasAnimDictLoaded
- mp.game.streaming.removeAnimDict
- mp.game.streaming.requestAnimSet
- mp.game.streaming.hasAnimSetLoaded
- mp.game.streaming.removeAnimSet
- mp.game.streaming.requestClipSet
- mp.game.streaming.hasClipSetLoaded
- mp.game.streaming.removeClipSet
- mp.game.streaming.requestIpl
- mp.game.streaming.removeIpl
- mp.game.streaming.isIplActive
- mp.game.streaming.set
- mp.game.streaming.setStreaming
- mp.game.streaming.loadGlobalWaterType
- mp.game.streaming.getGlobalWaterType
- mp.game.streaming.setGamePausesFor
- mp.game.streaming.setGamePausesForStreaming
- mp.game.streaming.setReducePedModelBudget
- mp.game.streaming.setReduceVehicleModelBudget
- mp.game.streaming.setDitchPoliceModels
- mp.game.streaming.getNumberOfRequests
- mp.game.streaming.requestPtfxAsset
- mp.game.streaming.hasPtfxAssetLoaded
- mp.game.streaming.removePtfxAsset
- mp.game.streaming.requestNamedPtfxAsset
- mp.game.streaming.hasNamedPtfxAssetLoaded
- mp.game.streaming.removeNamedPtfxAsset
- mp.game.streaming.setVehiclePopulationBudget
- mp.game.streaming.setPedPopulationBudget
- mp.game.streaming.clearFocus
- mp.game.streaming.setFocusPosAndVel
- mp.game.streaming.setFocusArea
- mp.game.streaming.setFocusEntity
- mp.game.streaming.isEntityFocus
- mp.game.streaming.setMapdatacullboxEnabled
- mp.game.streaming.streamvolCreateSphere
- mp.game.streaming.setUnkCameraSettings
- mp.game.streaming.streamvolCreateFrustum
- mp.game.streaming.streamvolCreateLine
- mp.game.streaming.streamvolDelete
- mp.game.streaming.streamvolHasLoaded
- mp.game.streaming.streamvolIsValid
- mp.game.streaming.isStreamvolActive
- mp.game.streaming.newLoadSceneStart
- mp.game.streaming.newLoadSceneStartSphere
- mp.game.streaming.newLoadSceneStartSafe
- mp.game.streaming.newLoadSceneStop
- mp.game.streaming.isNewLoadSceneActive
- mp.game.streaming.isNewLoadSceneLoaded
- mp.game.streaming.startPlayerSwitch
- mp.game.streaming.stopPlayerSwitch
- mp.game.streaming.isPlayerSwitchInProgress
- mp.game.streaming.getPlayerSwitchType
- mp.game.streaming.getIdealPlayerSwitchType
- mp.game.streaming.getPlayerSwitchState
- mp.game.streaming.getPlayerShortSwitchState
- mp.game.streaming.getPlayerSwitchJumpCutIndex
- mp.game.streaming.setPlayerSwitchOutro
- mp.game.streaming.setPlayerSwitchLocation
- mp.game.streaming.setPlayerSwitchEstablishingShot
- mp.game.streaming.allowPlayerSwitchPan
- mp.game.streaming.allowPlayerSwitchOutro
- mp.game.streaming.allowPlayerSwitchAscent
- mp.game.streaming.allowPlayerSwitchDescent
- mp.game.streaming.isSwitchReadyForDescent
- mp.game.streaming.enableSwitchPauseBeforeDescent
- mp.game.streaming.disableSwitchOutroFx
- mp.game.streaming.switchOutPlayer
- mp.game.streaming.switchInPlayer
- mp.game.streaming.getPlayerSwitchInterpOutDuration
- mp.game.streaming.getPlayerSwitchInterpOutCurrentTime
- mp.game.streaming.isSwitchSkippingDescent
- mp.game.streaming.getLodscale
- mp.game.streaming.overrideLodscaleThisFrame
- mp.game.streaming.setRenderHdOnly
- mp.game.streaming.prefetchSrl
- mp.game.streaming.isSrlLoaded
- mp.game.streaming.beginSrl
- mp.game.streaming.endSrl
- mp.game.streaming.setSrlTime
- mp.game.streaming.setHdArea
- mp.game.streaming.clearHdArea
- mp.game.streaming.initCreatorBudget
- mp.game.streaming.shutdownCreatorBudget
- mp.game.streaming.addModelToCreatorBudget
- mp.game.streaming.removeModelFromCreatorBudget
- mp.game.streaming.getUsedCreatorModelMemoryPercentage
- mp.game.streaming.setIslandHopperEnabled
- mp.game.streaming.getAllModelNames
- mp.game.streaming.getAllModelHashes
- mp.game.streaming.getModelNameFromHash
- mp.game.streaming.forceStreamingUpdate
- mp.game.streaming.requestAnimDictAsync
- mp.game.streaming.requestRuntimeAssetFromUrl
- mp.game.streaming.releaseRuntimeAsset