<commit_before>/*
 * oculusdevice.h
 *
 *  Created on: Jul 03, 2013
 *      Author: <NAME>
 */

#ifndef _OSG_OCULUSDEVICE_H_
#define _OSG_OCULUSDEVICE_H_

#include <OVR.h>
#include <osg/Matrix>


class OculusDevice {

	public:
		OculusDevice();
		~OculusDevice();

		enum EyeSide {
			CENTER_EYE	= 0,
			LEFT_EYE	= 1,
			RIGHT_EYE	= 2
		};

		unsigned int hScreenResolution() const;
		unsigned int vScreenResolution() const;
		float hScreenSize() const;
		float vScreenSize() const;
		float vScreenCenter() const;
		float eyeToScreenDistance() const;
		float lensSeparationDistance() const;
		float interpupillaryDistance() const;

		osg::Matrix viewMatrix(EyeSide eye = CENTER_EYE) const;
		osg::Matrix projectionMatrix(EyeSide eye = CENTER_EYE) const;
		osg::Matrix projectionOffsetMatrix(EyeSide eye = CENTER_EYE) const;
		osg::Matrix projectionCenterMatrix() const;

		osg::Vec2f lensCenter(EyeSide eye = CENTER_EYE) const;
		osg::Vec2f screenCenter() const;
		osg::Vec4f warpParameters() const;
		osg::Vec4f chromAbParameters() const;
		osg::Vec2f scale() const;
		osg::Vec2f scaleIn() const;

		void setScaleFactor(float scaleFactor) { m_scaleFactor = scaleFactor; }
		float scaleFactor() const { return m_scaleFactor; }

		float aspectRatio() const {  return float (hScreenResolution()/2) / float (vScreenResolution()); }
		osg::Quat getOrientation() const;

		void setNearClip(float nearClip) { m_nearClip = nearClip; }
		void setFarClip(float farclip) { m_farClip = farclip; }

	protected:
		float viewCenter() const { return hScreenSize() * 0.25f; }
		float halfIPD() const { return interpupillaryDistance() * 0.5f; }

		OVR::DeviceManager* m_deviceManager;
		OVR::HMDDevice* m_hmdDevice;
		OVR::HMDInfo* m_hmdInfo;
		OVR::SensorFusion m_sensorFusion;
		float m_scaleFactor;
		float m_nearClip;
		float m_farClip;
	private:
		OculusDevice(const OculusDevice&); // Do not allow copy
};

#endif
<commit_msg>Added comment to endif statement to be consistent with rest of code style<commit_after>/*
 * oculusdevice.h
 *
 *  Created on: Jul 03, 2013
 *      Author: <NAME>
 */

#ifndef _OSG_OCULUSDEVICE_H_
#define _OSG_OCULUSDEVICE_H_

#include <OVR.h>
#include <osg/Matrix>


class OculusDevice {

	public:
		OculusDevice();
		~OculusDevice();

		enum EyeSide {
			CENTER_EYE	= 0,
			LEFT_EYE	= 1,
			RIGHT_EYE	= 2
		};

		unsigned int hScreenResolution() const;
		unsigned int vScreenResolution() const;
		float hScreenSize() const;
		float vScreenSize() const;
		float vScreenCenter() const;
		float eyeToScreenDistance() const;
		float lensSeparationDistance() const;
		float interpupillaryDistance() const;

		osg::Matrix viewMatrix(EyeSide eye = CENTER_EYE) const;
		osg::Matrix projectionMatrix(EyeSide eye = CENTER_EYE) const;
		osg::Matrix projectionOffsetMatrix(EyeSide eye = CENTER_EYE) const;
		osg::Matrix projectionCenterMatrix() const;

		osg::Vec2f lensCenter(EyeSide eye = CENTER_EYE) const;
		osg::Vec2f screenCenter() const;
		osg::Vec4f warpParameters() const;
		osg::Vec4f chromAbParameters() const;
		osg::Vec2f scale() const;
		osg::Vec2f scaleIn() const;

		void setScaleFactor(float scaleFactor) { m_scaleFactor = scaleFactor; }
		float scaleFactor() const { return m_scaleFactor; }

		float aspectRatio() const {  return float (hScreenResolution()/2) / float (vScreenResolution()); }
		osg::Quat getOrientation() const;

		void setNearClip(float nearClip) { m_nearClip = nearClip; }
		void setFarClip(float farclip) { m_farClip = farclip; }

	protected:
		float viewCenter() const { return hScreenSize() * 0.25f; }
		float halfIPD() const { return interpupillaryDistance() * 0.5f; }

		OVR::DeviceManager* m_deviceManager;
		OVR::HMDDevice* m_hmdDevice;
		OVR::HMDInfo* m_hmdInfo;
		OVR::SensorFusion m_sensorFusion;
		float m_scaleFactor;
		float m_nearClip;
		float m_farClip;
	private:
		OculusDevice(const OculusDevice&); // Do not allow copy
};

#endif /* _OSG_OCULUSDEVICE_H_ */

{'fraction_non_alphanumeric': 0.10926729640030636, 'fraction_numerical': 0.010722491702833802, 'mean_word_length': 4.900602409638554, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2052356', 'n_tokens_mistral': 1533, 'n_tokens_neox': 1363, 'n_words': 333}