本文整理汇总了C#中Vector3.Rotate方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.Rotate方法的具体用法?C# Vector3.Rotate怎么用?C# Vector3.Rotate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.Rotate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setIllusionsToVector
private void setIllusionsToVector(Vector3 i_PerpendicularVector)
{
m_LastRecordedDirection = i_PerpendicularVector;
m_Illusions[0].transform.position = transform.position + i_PerpendicularVector.Rotate(m_DegreeBetweenIllusions / 2).normalized * m_IllusionDistanceFromDemon;
m_Illusions[1].transform.position = transform.position + i_PerpendicularVector.Rotate(-m_DegreeBetweenIllusions / 2).normalized * m_IllusionDistanceFromDemon;
}
示例2: Transform3dTo2d
private Vector2 Transform3dTo2d( Vector3 vec3d, Face cubeFace )
{
vec3d = vec3d.Rotate( cubeFace.Normal, -cubeFace.Rotation )
.Transform( VectorUtils.RotateOnto_Q( cubeFace.Normal, Vector3.UnitZ ) );
return new Vector2( vec3d.X, -vec3d.Y );
}
示例3: VectorToDirection
public CompassDirection? VectorToDirection( Vector3 vec )
{
vec.Normalize();
vec = vec.Rounded();
if ( UpVec == vec )
return CompassDirection.North;
vec = vec.Rotate( Normal, MathHelper.PiOver2 ).Rounded();
if ( UpVec == vec )
return CompassDirection.East;
vec = vec.Rotate( Normal, MathHelper.PiOver2 ).Rounded();
if ( UpVec == vec )
return CompassDirection.South;
vec = vec.Rotate( Normal, MathHelper.PiOver2 ).Rounded();
if ( UpVec == vec )
return CompassDirection.West;
return null;
}