Перейти к содержанию

Streaming::setFocusPosAndVel

Материал из RAGE MP Wiki Archive

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

<syntaxhighlight lang="javascript">mp.game.streaming.setFocusPosAndVel(x, y, z, velocityX, velocityY, velocityZ);</syntaxhighlight>

Required Arguments

  • x: float
  • y: float
  • z: float
  • velocityX: float
  • velocityY: float
  • velocityZ: float

Return value

  • Undefined

Example

<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>

See also