Skip to content

Commit

Permalink
Add back nullRotation. Needed to merge extends in older MSL.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Dec 10, 2021
1 parent 2e0eb40 commit 803f3e4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
28 changes: 28 additions & 0 deletions ModelicaServices/AnimationInterface/Frames/nullRotation.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
within ModelicaServices.AnimationInterface.Frames;
function nullRotation
"Return orientation object that does not rotate a frame"
extends Icons.Function;
output Orientation R
"Orientation object such that frame 1 and frame 2 are identical";
algorithm
R := Orientation(T=identity(3),w= zeros(3));
annotation(Inline=true, Documentation(info="<html>
<h4>Syntax</h4>
<blockquote><pre>
R = Frames.<strong>nullRotation</strong>();
</pre></blockquote>
<h4>Description</h4>
<p>
The function call <code>Frames.<strong>nullRotation</strong>()</code> returns an orientation matrix&nbsp;R
describing the orientation object to rotate frame&nbsp;1 into frame&nbsp;2, if frame&nbsp;1 and frame&nbsp;2 are identical.
(= transformation matrix is identity matrix and angular velocity is zero).
</p>
<h4>See also</h4>
<p>
<a href=\"modelica://Modelica.Mechanics.MultiBody.Frames.TransformationMatrices.nullRotation\">TransformationMatrices.nullRotation</a>,
<a href=\"modelica://Modelica.Mechanics.MultiBody.Frames.Quaternions.nullRotation\">Quaternions.nullRotation</a>.
</p>
</html>"));
end nullRotation;
6 changes: 3 additions & 3 deletions ModelicaServices/AnimationInterface/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package AnimationInterface
partial model PartialShape "Interface for 3D animation of elementary shapes"
parameter Types.ShapeType shapeType="box"
"Type of shape (box, sphere, cylinder, pipecylinder, cone, pipe, beam, gearwheel, spring, <external shape>)";
input Frames.Orientation R=Frames.Orientation(T=identity(3),w=zeros(3))
input Frames.Orientation R=Frames.nullRotation()
"Orientation object to rotate the world frame into the object frame" annotation(Dialog);
input Types.Position r[3]={0,0,0}
"Position vector from origin of world frame to origin of object frame, resolved in world frame" annotation(Dialog);
Expand Down Expand Up @@ -35,7 +35,7 @@ This model is documented at
end PartialShape;

partial model PartialVector "Interface for 3D animation of a vector quantity (force, torque etc)"
input Frames.Orientation R=Frames.Orientation(T=identity(3),w=zeros(3))
input Frames.Orientation R=Frames.nullRotation()
"Orientation object to rotate the world frame into the vector frame" annotation(Dialog);
input Types.Position r[3]={0,0,0}
"Position vector from origin of world frame to origin of vector frame, resolved in world frame" annotation(Dialog);
Expand All @@ -59,7 +59,7 @@ This model is documented at
end PartialVector;

partial model PartialSurface "Interface for 3D animation of surfaces"
input Frames.Orientation R=Frames.Orientation(T=identity(3),w=zeros(3))
input Frames.Orientation R=Frames.nullRotation()
"Orientation object to rotate the world frame into the surface frame"
annotation(Dialog(group="Surface frame"));
input Types.Position r_0[3]={0,0,0}
Expand Down

0 comments on commit 803f3e4

Please sign in to comment.