Scripting/Squirrel/Functions/Object.RotateTo: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with " '''Syntax''' <pre> function onScriptLoad() { Obj<-CreateObject(502, 0, Vector(-897.355, -339.4, 13.6187), 255); } </pre> '''Example''' <source lang=squirrel> function...")
 
No edit summary
Line 1: Line 1:
This function rotates an object to a specified Quaternion rotation.


== Syntax ==
<pre>object.RotateTo( rotation, time )</pre>


== Arguments ==
* ''CObject'' '''object''' - A valid object instance.
* ''Quaternion'' '''rotation''' - A rotation that is in Quaternion format.
* ''int'' '''time''' - Time period within which the object has to rotate, in ms.


'''Syntax'''
== Example ==
<pre>
<pre>CreateObject(1259, 0, Vector(-879.757, -576.008, 11.3371), 255).RotateTo( Quaternion(0, 0, 0.5, -0.866025), 0 );</pre>
function onScriptLoad()
{
Obj<-CreateObject(502, 0, Vector(-897.355, -339.4, 13.6187), 255);
}
</pre>
 
 
 
 
'''Example'''
<source lang=squirrel>
 
 
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "objectrotateto" )
{
Obj.RotateTo( Quaternion(0.0000000000, 0.0000000000, 0.0000000000, -1.0000000000), 0 );
}
}

Revision as of 15:23, 9 March 2016

This function rotates an object to a specified Quaternion rotation.

Syntax

object.RotateTo( rotation, time )

Arguments

  • CObject object - A valid object instance.
  • Quaternion rotation - A rotation that is in Quaternion format.
  • int time - Time period within which the object has to rotate, in ms.

Example

CreateObject(1259, 0, Vector(-879.757, -576.008, 11.3371), 255).RotateTo( Quaternion(0, 0, 0.5, -0.866025), 0 );