34 public bool GyroAngleDetected
44 Transform currentParent =
transform.parent;
45 GameObject camParent =
new GameObject (
"GyroCamParent");
46 camParent.transform.position =
transform.position;
48 GameObject camGrandparent =
new GameObject (
"GyroCamGrandParent");
49 camGrandparent.transform.position =
transform.position;
50 camParent.transform.parent = camGrandparent.transform;
51 camGrandparent.transform.parent = currentParent;
54 gyroBool = Input.isGyroAvailable;
56 gyroBool = SystemInfo.supportsGyroscope;
64 if (Screen.orientation == ScreenOrientation.LandscapeLeft) {
65 camParent.transform.eulerAngles =
new Vector3 (90, 180, 0);
66 }
else if (Screen.orientation == ScreenOrientation.Portrait) {
67 camParent.transform.eulerAngles =
new Vector3 (90, 180, 0);
68 }
else if (Screen.orientation == ScreenOrientation.PortraitUpsideDown) {
69 camParent.transform.eulerAngles =
new Vector3 (90, 180, 0);
70 }
else if (Screen.orientation == ScreenOrientation.LandscapeRight) {
71 camParent.transform.eulerAngles =
new Vector3 (90, 180, 0);
73 camParent.transform.eulerAngles =
new Vector3 (90, 180, 0);
76 if (Screen.orientation == ScreenOrientation.LandscapeLeft) {
77 rotFix =
new Quaternion (0, 0, 1, 0);
78 }
else if (Screen.orientation == ScreenOrientation.Portrait) {
79 rotFix =
new Quaternion (0, 0, 1, 0);
80 }
else if (Screen.orientation == ScreenOrientation.PortraitUpsideDown) {
81 rotFix =
new Quaternion (0, 0, 1, 0);
82 }
else if (Screen.orientation == ScreenOrientation.LandscapeRight) {
83 rotFix =
new Quaternion (0, 0, 1, 0);
85 rotFix =
new Quaternion (0, 0, 1, 0);
103 quatMap = gyro.attitude;
105 quatMap =
new Quaternion(gyro.attitude.x,gyro.attitude.y,gyro.attitude.z,gyro.attitude.w);
Gyroscope-controlled camera for iPhone Android revised 2.26.12
int transform(const BasicImage< S > &in, BasicImage< T > &out, const TooN::Matrix< 2 > &M, const TooN::Vector< 2 > &inOrig, const TooN::Vector< 2 > &outOrig, const T defaultValue=T())