Merge branch 'quaternion-fix-down' of https://github.com/Zode/FlaxEngine into Zode-quaternion-fix-down
This commit is contained in:
@@ -294,6 +294,10 @@ Quaternion Quaternion::FromDirection(const Float3& direction)
|
|||||||
{
|
{
|
||||||
RotationAxis(Float3::Left, PI_OVER_2, orientation);
|
RotationAxis(Float3::Left, PI_OVER_2, orientation);
|
||||||
}
|
}
|
||||||
|
else if (Float3::Dot(direction, Float3::Down) >= 0.999f)
|
||||||
|
{
|
||||||
|
RotationAxis(Float3::Right, PI_OVER_2, orientation);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Float3 right, up;
|
Float3 right, up;
|
||||||
|
|||||||
@@ -654,6 +654,10 @@ namespace FlaxEngine
|
|||||||
{
|
{
|
||||||
orientation = RotationAxis(Float3.Left, Mathf.PiOverTwo);
|
orientation = RotationAxis(Float3.Left, Mathf.PiOverTwo);
|
||||||
}
|
}
|
||||||
|
else if (Float3.Dot(direction, Float3.Down) >= 0.999f)
|
||||||
|
{
|
||||||
|
orientation = RotationAxis(Float3.Right, Mathf.PiOverTwo);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var right = Float3.Cross(direction, Float3.Up);
|
var right = Float3.Cross(direction, Float3.Up);
|
||||||
|
|||||||
Reference in New Issue
Block a user