RotateBehaviour

class Varwin.RotateBehaviour

Bases: object

class Axis

Bases: object

X: Any = Ellipsis
Y: Any = Ellipsis
Z: Any = Ellipsis
class RotationAxis

Bases: object

All: Any = Ellipsis
LocalX: Any = Ellipsis
LocalY: Any = Ellipsis
SetRotation(eulerAngles: Vector3) None

Instantly sets the rotation of the object in degrees along the three axes. The rotation is counted relative to the world coordinates.

Example:

instance.RotateBehaviour.SetRotation(Varwin.Vector3(1,0,0))
RotateAroundAxis(angle: float, axis: int) None

Instantly rotates the object by the specified angle along the selected axis.

Parameters:

(int) (axis) –

value from the list

  • Varwin.RotateBehaviour.Axis.X (int)

  • Varwin.RotateBehaviour.Axis.Y (int)

  • Varwin.RotateBehaviour.Axis.Z (int)

Example:

instance.RotateBehaviour.RotateAroundAxis(0, Varwin.RotateBehaviour.Axis.X)
RotateToObjectAroundAxis(target: Object, axis: int) None

Instantly rotates the object to the selected object.

Parameters:
  • (Object) (target) – scene object

  • (int) (axis) –

    value from the list

    • Varwin.RotateBehaviour.RotationAxis.All (int)

    • Varwin.RotateBehaviour.RotationAxis.LocalX (int)

    • Varwin.RotateBehaviour.RotationAxis.LocalY (int)

Example:

instance.RotateBehaviour.RotateToObjectAroundAxis(sceneObject1, Varwin.RotateBehaviour.RotationAxis.All)
RotateAsObject(target: Object) None

Instantly rotates the object in the same way as the selected object.

Parameters:

(Object) (target) – scene object

Example:

instance.RotateBehaviour.RotateAsObject(sceneObject1)
RotateAroundAxisWithSpeed(axis: int, speed: float) None

Starts rotation of the specified object around the selected local axis with the specified speed. The rotation continues until it is stopped by the rotation stop block. Use negative speed values to change the rotation direction.

Parameters:

(int) (axis) –

value from the list

  • Varwin.RotateBehaviour.Axis.X (int)

  • Varwin.RotateBehaviour.Axis.Y (int)

  • Varwin.RotateBehaviour.Axis.Z (int)

Example:

instance.RotateBehaviour.RotateAroundAxisWithSpeed(Varwin.RotateBehaviour.Axis.X, 0)
async RotationAroundAxisWithSpeedOverTime(axis: int, time: float, speed: float) None

Starts rotation of the object around the selected axis for the specified time with the specified speed. Use negative speed values to change the rotation direction.

Parameters:

(int) (axis) –

value from the list

  • Varwin.RotateBehaviour.Axis.X (int)

  • Varwin.RotateBehaviour.Axis.Y (int)

  • Varwin.RotateBehaviour.Axis.Z (int)

Example:

await instance.RotateBehaviour.RotationAroundAxisWithSpeedOverTime(Varwin.RotateBehaviour.Axis.X, 0, 0)
RotateAroundAnotherObjectAxisWithSpeed(axis: int, target: Object, speed: float) None

Starts rotation of the object around the selected axis of another object with a specified speed.

Parameters:
  • (int) (axis) –

    value from the list

    • Varwin.RotateBehaviour.Axis.X (int)

    • Varwin.RotateBehaviour.Axis.Y (int)

    • Varwin.RotateBehaviour.Axis.Z (int)

  • (Object) (target) – scene object

Example:

instance.RotateBehaviour.RotateAroundAnotherObjectAxisWithSpeed(Varwin.RotateBehaviour.Axis.X, sceneObject2, 0)
async LookAtObjectWithSpeedAroundAxis(target: Object, speed: float, axis: int) None

Starts rotation of the object to another selected object at a specified speed.

Parameters:
  • (Object) (target) – scene object

  • (int) (axis) –

    value from the list

    • Varwin.RotateBehaviour.RotationAxis.All (int)

    • Varwin.RotateBehaviour.RotationAxis.LocalX (int)

    • Varwin.RotateBehaviour.RotationAxis.LocalY (int)

Example:

await instance.RotateBehaviour.LookAtObjectWithSpeedAroundAxis(sceneObject1, 0, Varwin.RotateBehaviour.RotationAxis.All)
async RotateAsObjectWithSpeed(target: Object, speed: float) None

Starts rotation of the object according to the parameters of the other selected object with the specified speed.

Parameters:

(Object) (target) – scene object

Example:

await instance.RotateBehaviour.RotateAsObjectWithSpeed(sceneObject1, 0)
async RotateToVectorWithSpeed(target: Vector3, speed: float) None

Starts rotation of the object to an angle in world axes defined by a vector with angles on each of the axes [0…360]. The rotation will be performed along the shortest path.

Example:

await instance.RotateBehaviour.RotateToVectorWithSpeed(Varwin.Vector3(1,0,0), 0)
async RotateAroundAxisByAngleWithSpeed(axis: int, angle: float, speed: float) None

Starts rotation of the object around the selected local axis with a specified speed. Use negative speed values to change the rotation direction.

Parameters:

(int) (axis) –

value from the list

  • Varwin.RotateBehaviour.Axis.X (int)

  • Varwin.RotateBehaviour.Axis.Y (int)

  • Varwin.RotateBehaviour.Axis.Z (int)

Example:

await instance.RotateBehaviour.RotateAroundAxisByAngleWithSpeed(Varwin.RotateBehaviour.Axis.X, 0, 0)
Stop() None

Controls any rotation. A paused rotation can be continued with the “Continue” block.

Example:

instance.RotateBehaviour.Stop()
Pause() None

Controls any rotation. A paused rotation can be continued with the “Continue” block.

Example:

instance.RotateBehaviour.Pause()
Continue() None

Controls any rotation. A paused rotation can be continued with the “Continue” block.

Example:

instance.RotateBehaviour.Continue()
IsRotatingNow() bool

Returns “true” if the specified object is currently rotating. Otherwise it returns “false”.

Example:

result = instance.RotateBehaviour.IsRotatingNow()
GetRotationAroundAxisToObject(axis: int, target: Object) float

Returns the angle of the object relative to another object along the selected axis.

Parameters:
  • (int) (axis) –

    value from the list

    • Varwin.RotateBehaviour.Axis.X (int)

    • Varwin.RotateBehaviour.Axis.Y (int)

    • Varwin.RotateBehaviour.Axis.Z (int)

  • (Object) (target) – scene object

Example:

result = instance.RotateBehaviour.GetRotationAroundAxisToObject(Varwin.RotateBehaviour.Axis.X, sceneObject2)
GetRotationToObject(target: Object) Vector3

Returns the rotation of an object relative to another object as a vector.

Parameters:

(Object) (target) – scene object

Example:

result = instance.RotateBehaviour.GetRotationToObject(sceneObject1)
AngleX() float

Returns the rotation angle of the object along the selected axis in world coordinates.

Example:

result = instance.RotateBehaviour.AngleX()
AngleY() float

Returns the rotation angle of the object along the selected axis in world coordinates.

Example:

result = instance.RotateBehaviour.AngleY()
AngleZ() float

Returns the rotation angle of the object along the selected axis in world coordinates.

Example:

result = instance.RotateBehaviour.AngleZ()
property Angle: Vector3

Returns the rotation of the specified object in world coordinates as a vector.

Example:

result = instance.RotateBehaviour.Angle
AddRotationFinishedHandler(handler: Callable[[Object], CoroutineType]) None

The event is triggered when the object completes any rotation. The rotation is considered complete if the object has reached the rotation to the target point or if the rotation has been stopped by the corresponding block. The object for which the event was triggered is passed to the parameter.

Parameters:

handler

Asynchronous handler function with signature:

  • sender (Object): the object that triggered the event

Example:

async def OnRotationFinished(sender):
  ...
instance.RotateBehaviour.AddRotationFinishedHandler(OnRotationFinished)
AddToWrapperRotationFinishedHandler(handler: Callable[[Object, Object], CoroutineType]) None

The event is triggered when the object has completed the rotation to the target object, or when it has rotated as the target object. The object for which the event was triggered and the object to which the rotation was completed (target object) are passed in parameters.

Parameters:

handler

Asynchronous handler function with signature:

  • target (Object): target object

  • sender (Object): the object that triggered the event

Example:

async def OnToWrapperRotationFinished(target, sender):
  ...
instance.RotateBehaviour.AddToWrapperRotationFinishedHandler(OnToWrapperRotationFinished)
AddAsWrapperRotationFinishedHandler(handler: Callable[[Object, Object], CoroutineType]) None

The event is triggered when the object has completed the rotation to the target object, or when it has rotated as the target object. The object for which the event was triggered and the object to which the rotation was completed (target object) are passed in parameters.

Parameters:

handler

Asynchronous handler function with signature:

  • target (Object): target object

  • sender (Object): the object that triggered the event

Example:

async def OnAsWrapperRotationFinished(target, sender):
  ...
instance.RotateBehaviour.AddAsWrapperRotationFinishedHandler(OnAsWrapperRotationFinished)
AddToVectorRotationFinishedHandler(handler: Callable[[Vector3, Object], CoroutineType]) None

The event is triggered when the object completes the rotation to the target rotation. The object for which the event was triggered (rotating object) and the rotation, as a vector, to which the rotation was completed (target rotation) are passed in parameters.

Parameters:

handler

Asynchronous handler function with signature:

  • target (Vector3): target rotation

  • sender (Object): the object that triggered the event

Example:

async def OnToVectorRotationFinished(target, sender):
  ...
instance.RotateBehaviour.AddToVectorRotationFinishedHandler(OnToVectorRotationFinished)