Camera::getFov: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
*'''float'''
*'''float'''
==Example==
==Example==
This example creates a camera and if the current Field of View of it is less than or equals to 10 destroys the camera.
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40); // Creates the camera
camera.setActive(true);
let currFov = camera.getFov();
if (currFov <= 10) {
  camera.destroy();
}
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Camera_function_c}}
{{Camera_definition_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 23:31, 11 December 2020

Syntax

camera.getFov();

Required Arguments

Return value

  • float

Example

This example creates a camera and if the current Field of View of it is less than or equals to 10 destroys the camera.

let camera = mp.cameras.new('default', new mp.Vector3(-485, 1095.75, 323.85), new mp.Vector3(0,0,0), 40); // Creates the camera
camera.setActive(true);
let currFov = camera.getFov();
if (currFov <= 10) {
  camera.destroy();
}

See also