Added spherical.tovector (but is is buggy)
This commit is contained in:
		
							parent
							
								
									273ebae33b
								
							
						
					
					
						commit
						159bdaec8e
					
				@ -1,6 +1,7 @@
 | 
				
			|||||||
#include "Spherical.h"
 | 
					#include "Spherical.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "Angle.h"
 | 
					#include "Angle.h"
 | 
				
			||||||
 | 
					#include "Quaternion.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <math.h>
 | 
					#include <math.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -48,3 +49,10 @@ float Spherical::GetSwing() {
 | 
				
			|||||||
Polar Spherical::ProjectOnHorizontalPlane() {
 | 
					Polar Spherical::ProjectOnHorizontalPlane() {
 | 
				
			||||||
  return Polar(horizontalAngle, distance);
 | 
					  return Polar(horizontalAngle, distance);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Vector3 Spherical::ToVector3() {
 | 
				
			||||||
 | 
					  Vector3 v = Quaternion::Euler(
 | 
				
			||||||
 | 
					                  Vector3(-this->verticalAngle, this->horizontalAngle, 0)) *
 | 
				
			||||||
 | 
					              Vector3::forward * this->distance;
 | 
				
			||||||
 | 
					  return v;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -56,6 +56,7 @@ public:
 | 
				
			|||||||
  float GetSwing();
 | 
					  float GetSwing();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Polar ProjectOnHorizontalPlane();
 | 
					  Polar ProjectOnHorizontalPlane();
 | 
				
			||||||
 | 
					  Vector3 ToVector3();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // namespace Passer
 | 
					} // namespace Passer
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user