mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
add setEulerRotation to pair with getEulerRotation for sceneobjects
This commit is contained in:
parent
cf233367a8
commit
061c25686d
1 changed files with 13 additions and 0 deletions
|
|
@ -1531,6 +1531,19 @@ DefineEngineMethod( SceneObject, getEulerRotation, Point3F, (),,
|
||||||
return euler;
|
return euler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(SceneObject, setEulerRotation, void, (Point3F inRot), ,
|
||||||
|
"set Euler rotation of this object.\n"
|
||||||
|
"@set the orientation of the object in the form of rotations around the "
|
||||||
|
"X, Y and Z axes in degrees.\n")
|
||||||
|
{
|
||||||
|
MatrixF curMat = object->getTransform();
|
||||||
|
Point3F curPos = curMat.getPosition();
|
||||||
|
Point3F curScale = curMat.getScale();
|
||||||
|
EulerF inRotRad = inRot * M_PI_F / 180.0;
|
||||||
|
curMat.set(inRotRad, curPos);
|
||||||
|
curMat.scale(curScale);
|
||||||
|
object->setTransform(curMat);
|
||||||
|
}
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DefineEngineMethod( SceneObject, getForwardVector, VectorF, (),,
|
DefineEngineMethod( SceneObject, getForwardVector, VectorF, (),,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue