์ ๋ํฐ์์ ์์ฑํ ์คํฌ๋ฆฝํธ ํ์ผ์ธ๋ฐ.
๋ด๊ฐ ์ด์ ๋ ์ดํด ๋ชปํ๋ ์์ค์ด๋ค ๋ผ๋ ์์ ์ฝ๋์..
์์ ๋ญ ๋ณ์ ์ ์ธ ํจ์ ์ฐ๊ณ ์ด๋ฐ๊ฑด ๋ณ๊ฑฐ ์์ด ๋ณด์ด๋๋ฐ.. ๊ทธ๋ฅ ๊ตฌ์กฐ์์ฒด๋ฅผ ์ดํด๋ชปํ๊ฒ ๋ค ์ ์ด๋ ๊ฒ ์ง ๊ฑฐ์ผ.. ๊ผญ ์ด๋ ๊ฒ ์ง์ผ๋ง ํ๋ ...
[System.Serializable]
public struct OVRPose
{
/// <summary>
/// A pose with no translation or rotation.
/// </summary>
public static OVRPose identity
{
get {
return new OVRPose()
{
position = Vector3.zero,
orientation = Quaternion.identity
};
}
}
public override bool Equals(System.Object obj)ย
{
return obj is OVRPose && this == (OVRPose)obj;
}
public override int GetHashCode()ย
{
return position.GetHashCode() ^ orientation.GetHashCode();
}
public static bool operator ==(OVRPose x, OVRPose y)ย
{
return x.position == y.position && x.orientation == y.orientation;
}
public static bool operator !=(OVRPose x, OVRPose y)ย
{
return !(x == y);
}
/// <summary>
/// The position.
/// </summary>
public Vector3 position;
/// <summary>
/// The orientation.
/// </summary>
public Quaternion orientation;
/// <summary>
/// Multiplies two poses.
/// </summary>
public static OVRPose operator*(OVRPose lhs, OVRPose rhs)
{
var ret = new OVRPose();
ret.position = lhs.position + lhs.orientation * rhs.position;
ret.orientation = lhs.orientation * rhs.orientation;
return ret;
}
/// <summary>
/// Computes the inverse of the given pose.
/// </summary>
public OVRPose Inverse()
{
OVRPose ret;
ret.orientation = Quaternion.Inverse(orientation);
ret.position = ret.orientation * -position;
return ret;
}
/// <summary>
/// Converts the pose from left- to right-handed or vice-versa.
/// </summary>
internal OVRPose flipZ()
{
var ret = this;
ret.position.z = -ret.position.z;
ret.orientation.z = -ret.orientation.z;
ret.orientation.w = -ret.orientation.w;
return ret;
}
internal OVRPlugin.Posef ToPosef()
{
return new OVRPlugin.Posef()
{
Position = position.ToVector3f(),
Orientation = orientation.ToQuatf()
};
}
}
๊ตฌ์กฐ์ฒด ์์ ๊ตฌ์กฐ์ฒด ๋ค์ด๊ฐ์๊ณ ์ค๋ฒ๋ผ์ด๋์.. ์..
์ ์ธํด์ฃผ๋๊ฒ๋ค? ์ ๊ทผ์ ํ์? ์ด๋ฐ๊ฒ๋ค๋ ์ดํด๋ชปํ๊ฒ ๊ณ
์ด์ ๋ ์ดํด ๋ชปํ๋ ์ฌ๋์๊ฒ c#๊ณต๋ถ๋ฅผ ํ๋ค๋ฉด ๋ญ ์ถ์ฒ ํด์ฃผ๊ณ ์ถ์? ์ด๋ ๋ถ๋ถ?ย
๊ธฐ์ด์ฑ ์ ๋ง if๋ฌธ for๋ฌธ ๋๋ฌด ๊ธฐ์ด์ ์ธ ๊ฒ๋ถํฐ ์์ด์ ์ข ๋ฐฐ์์ผ ํ ๋ถ๋ถ๋ง ๋ญ ๊ฐ์ฒด์งํฅ์ ์ดํด๋ผ๋์ง ๋ถ๋ถ๋ถ๋ถ ๊ณจ๋ผ์ ๋ณด๊ณ ์ถ์๋ฐ..
์์ํ์ธ์! C# 6.0 ํ๋ก๊ทธ๋๋ฐ
์ด๋ผ๋ 600ํ์ด์ง์ง๋ฆฌ ์ฑ ์ด ์๋๋ฐ ๊ณ ๊ฑธ๋ก 1๋ ์ ๋ ๊ณต๋ถํ์ต๋๋ค. ๋์ ๋ง์ด ๋์์ฉ.
์ฌ์ค C# ์ธ์ด ๋ช ์ธ ์์ฒด๋ ๊ทธ๋ค์ง ์ด๋ ค์ธ ๊ฒ ๋ชป ๋ผ๊ณ , ๊ฐ์ฒด์งํฅ ๋์์ธ ํจํด ์์ ์ฐพ์์ ์ฝ์ด๋ณด์๊ธธ ๊ถํฉ๋๋ค
GoF์ ๋์์ธ ํจํด์ด๋ผ๋ ๊ณ ์ ๋ช ์์ด ์์ง๋ง ์ฌ์ค ๋๋ฌด ์ด๋ ค์์ ์ ๋ ์ ์ฝ์ ใ ใ
์๋ฃ๊ตฌ์กฐ๋ ์๊ณ ๋ฆฌ์ฆ์ ๊ธฐ๋ณธ์ผ๋ก ๊น๊ณ ๋ค์ด๊ฐ๋๋ฐ, ์๊ณ ๋ฆฌ์ฆ ๊น์ด ํ๊ธฐ ์์ํ๋ฉด ์ด์ง๊ฐํ ์ฌ๋ฅ ์๋ ์ด์ ํ๋ก๊ทธ๋๋ฐ ์์ฒด์ ํฅ๋ฏธ๊ฐ ๋จ์ด์ง ๊ฐ๋ฅ์ฑ์ด ๋์ผ๋ ๊ธฐ๋ณธ์ ์ธ ์๋ฆฌ ์ ๋๋ง ์๊ตฌ ๊ณ์๊ตฌ์ฉ
์ค์ฝง ๋ง์ด์ด Effective ์๋ฆฌ์ฆ๋ ๋ค ์ฌ์ ์ธ ๋ฒ์ฉ ์ฝ์ด๋ณด์๊ธธ ๊ถํฉ๋๋ค. C++ ์ฑ ์ด๊ธด ํ๋ฐ C# ๊ณต๋ถ์๋ ๋์๋๋ ๋ด์ฉ์ด ๋ง์์
์ํ ๊ฐ์ฌ๊ฐ์ฌ ์ฐ์ ์์ํ์ธ์ ๋ถํฐ ๋ด๋ฐ์ผ๊ฒ ๋ค..
์์งํ c#์ ์ c๋ os ์ฑ ๋ณด์ค? ํ๋ฉด ์ฐ์จ ํ์ค๊ฑฐ์๋์ฌ ใ ใ