本文整理汇总了C#中Axiom.Math.Quaternion.ToAngleAxis方法的典型用法代码示例。如果您正苦于以下问题:C# Quaternion.ToAngleAxis方法的具体用法?C# Quaternion.ToAngleAxis怎么用?C# Quaternion.ToAngleAxis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Math.Quaternion
的用法示例。
在下文中一共展示了Quaternion.ToAngleAxis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DumpContents
/// <summary>
///
/// </summary>
/// <param name="fileName"></param>
public void DumpContents( string fileName )
{
var fs = File.Open( fileName, FileMode.Create );
var writer = new StreamWriter( fs );
writer.AutoFlush = true;
writer.WriteLine( "-= Debug output of skeleton {0} =-", Name );
writer.WriteLine( "" );
writer.WriteLine( "== Bones ==" );
writer.WriteLine( "Number of bones: {0}", this.boneList.Count );
var q = new Quaternion();
Real angle = 0;
var axis = new Vector3();
// write each bone out
foreach ( var bone in this.boneList.Values )
{
writer.WriteLine( "-- Bone {0} --", bone.Handle );
writer.Write( "Position: {0}", bone.Position );
q = bone.Orientation;
writer.Write( "Rotation: {0}", q );
q.ToAngleAxis( ref angle, ref axis );
writer.Write( " = {0} radians around axis {1}", angle, axis );
writer.WriteLine( "" );
writer.WriteLine( "" );
}
writer.WriteLine( "== Animations ==" );
writer.WriteLine( "Number of animations: {0}", this.animationList.Count );
// animations
foreach ( var anim in this.animationList.Values )
{
writer.WriteLine( "-- Animation '{0}' (length {1}) --", anim.Name, anim.Length );
writer.WriteLine( "Number of tracks: {0}", anim.NodeTracks.Count );
// tracks
foreach ( var track in anim.NodeTracks.Values )
{
writer.WriteLine( " -- AnimationTrack {0} --", track.Handle );
writer.WriteLine( " Affects bone: {0}", ( (Bone)track.TargetNode ).Handle );
writer.WriteLine( " Number of keyframes: {0}", track.KeyFrames.Count );
// key frames
var kf = 0;
for ( ushort i = 0; i < track.KeyFrames.Count; i++ )
{
var keyFrame = track.GetNodeKeyFrame( i );
writer.WriteLine( " -- KeyFrame {0} --", kf++ );
writer.Write( " Time index: {0}", keyFrame.Time );
writer.WriteLine( " Translation: {0}", keyFrame.Translate );
q = keyFrame.Rotation;
writer.Write( " Rotation: {0}", q );
q.ToAngleAxis( ref angle, ref axis );
writer.WriteLine( " = {0} radians around axis {1}", angle, axis );
}
}
}
writer.Close();
fs.Close();
}