本文整理汇总了C#中Quaternion.GetEulerAngles方法的典型用法代码示例。如果您正苦于以下问题:C# Quaternion.GetEulerAngles方法的具体用法?C# Quaternion.GetEulerAngles怎么用?C# Quaternion.GetEulerAngles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quaternion
的用法示例。
在下文中一共展示了Quaternion.GetEulerAngles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Set
private void Set(Quaternion value)
{
if (mRotation.Equals(value))
return;
mRotation = value;
mRotationChanging = true;
if (!mPitchChanging && !mYawChanging) {
float roll, pitch, yaw;
value.GetEulerAngles(out roll, out pitch, out yaw);
Set(pitch * RAD2DEG, yaw * RAD2DEG);
}
if (!mVectorChanging)
mLookAtVector = Vector3.UnitX * value;
if (Changed != null)
Changed(this, null);
mRotationChanging = false;
}
示例2: dirupdate
bool dirupdate()
{
if(MainClass.client.Network.LoginStatusCode!=LoginStatus.Success)
return true;
Quaternion myrotation=MainClass.client.Self.RelativeRotation;
Console.Write(myrotation.ToString()+"\n");
if(myrotation!=rotation)
{
float x,y,z;
rotation=myrotation;
rotation.GetEulerAngles(out x, out y, out z);
this.spinbutton_direction.Value=(int)z*(float)(360.0/(2.0*3.1415));
}
return true;
}
示例3: GetXYDiffOfMovement
static Vector3 GetXYDiffOfMovement(int zAngleFromFace, Quaternion rot, double distance)
{
double radAngle = zAngleFromFace / RAD2DEG;
rot.Normalize();
float rx, ry, rz;
rot.GetEulerAngles(out rx, out rz, out ry);
//if (rx != 0f || ry != 0f)
//{
// Debug("180 Eulers: {0} {1} {2}", rx * RAD_TO_DEG, ry * RAD_TO_DEG, rz * RAD_TO_DEG);
//}
//else
//{
// Debug("Current Eulers: {0} {1} {2}", rx * RAD_TO_DEG, ry * RAD_TO_DEG, rz * RAD_TO_DEG);
//}
double az = rz + radAngle;
while (az < 0)
{
az += PI2;
}
while (az > PI2)
{
az -= PI2;
}
float xmul = (float)Math.Cos(az);
float ymul = (float)Math.Sin(az);
return new Vector3(xmul, ymul, 0) * (float)distance;
}