Camera::getRot: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
The last parameter, as in other 'ROT' methods, is usually 2.
{{ClientsideJsFunction}}
{{JSContainer|
 
Rotation Orders
<pre>
enum eRotationOrder {
    XYZ = 0,
    XZY,
    YXZ,
    YZX,
    ZXY,
    ZYX,
    MAX,
}
</pre>
===Required Params===
*'''rotationOrder''' {{RageType|Number}}
 
===Return value===
*''{{RageType|Vector3}}''
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">camera.getRot(p1);</syntaxhighlight>
<syntaxhighlight lang="javascript">
=== Required Arguments ===
camera.getRot(rotationOrder);
*'''p1:''' unknown (to be checked)
</syntaxhighlight>
===Return value===
 
*'''Vector3'''
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
const camera = mp.cameras.new("default", mp.players.local.position, mp.players.local.getRotation(2));
mp.game.cam.renderScriptCams(true, false, 100, false, false);
const cameraRot = camera.getRot(2);
mp.console.logInfo(`Camera rot is: ${cameraRot.x} ${cameraRot.y} ${cameraRot.z}`);
</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 12:44, 27 April 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Rotation Orders

enum eRotationOrder {
    XYZ = 0,
    XZY,
    YXZ,
    YZX,
    ZXY,
    ZYX,
    MAX,
}

Required Params

  • rotationOrder Number

Return value

  • Vector3

Syntax

camera.getRot(rotationOrder);

Example

const camera = mp.cameras.new("default", mp.players.local.position, mp.players.local.getRotation(2));
mp.game.cam.renderScriptCams(true, false, 100, false, false);
const cameraRot = camera.getRot(2);
mp.console.logInfo(`Camera rot is: ${cameraRot.x} ${cameraRot.y} ${cameraRot.z}`);


See also