XSIMath
 
 
 

XSIMath

Object Hierarchy | Related C++ Class: XSIMATH

Description

XSIMath is an intrinsic object that provides basic 3D mathematics functionality. An intrinsic object is one that you can refer to by name in your code without creating an instance of it first. The scripting engine creates the XSIMath object when the engine is loaded. All of its methods and properties are available to your script at all times.

This object is designed to allow scripters to easily create Math objects, including SIVector3, SIMatrix3, SIMatrix4, SITransformation, SIRotation and SIQuaternion.

Methods

CreateMatrix3 CreateMatrix4 CreateQuaternion CreateRotation
CreateTransform CreateVector3 DegreesToRadians MapObjectOrientationToObjectSpace
MapObjectOrientationToWorldSpace MapObjectPoseToObjectSpace MapObjectPoseToWorldSpace MapObjectPositionToObjectSpace
MapObjectPositionToWorldSpace MapWorldOrientationToObjectSpace MapWorldPoseToObjectSpace MapWorldPositionToObjectSpace
RadiansToDegrees      
       

Properties

PI      
       

Examples

1. VBScript Example

Dim v3 
set v3 = XSIMath.CreateVector3(10.0, 10.0, 10.0)
v3.ScaleInPlace 2
Application.LogMessage join( v3.get2, ", " )
'Output:
'INFO : 20, 20, 20

2. JScript Example

var v3 = XSIMath.CreateVector3( 10.0, 10.0, 10.0 ) ;
v3.ScaleInPlace( 2 ) ;
Application.LogMessage( v3.x +", "+v3.y+", "+v3.z ) ;
//Output:
//INFO : 20, 20, 20

3. Python Example

#
# This example demonstrates how to create and manipulate an SIVector3
# object in Python.
#
Application.NewScene( "", False )
v3 = XSIMath.CreateVector3(10.0, 20.0, 30.0) 
v3.ScaleInPlace(2) 
x=y=z=0 
x, y, z = v3.Get(x,y,z) 
Application.LogMessage( '%(x).2f %(y).2f %(z).2f' % vars() ) 
# Output of above script:
#INFO : 20.00 40.00 60.00

See Also

XSIRound Geometry.GetBoundingBox Kinematics