コード例 #1
0
static ERROR_T Calibrate(IvhSensor* me)
{
    ERROR_T retVal = ERROR_OK;
    IvhSensorData temp;
    pIvhSensorOrientation sensor = (pIvhSensorOrientation)(me);

    SAFE_MEMCPY(&temp, &sensor->input);

    CalculateRotation(sensor);

    UpdateData(sensor, &temp);

    SAFE_MEMCPY(&sensor->output, &temp);

    me->Notify(me);
    return retVal;
}
コード例 #2
0
ファイル: FlyCamera.cpp プロジェクト: ShaneCoates/LevelEditor
void FlyCamera::HandleMouseInput(double dt) {
	if (glfwGetMouseButton(m_window, GLFW_MOUSE_BUTTON_3) == GLFW_PRESS) {
		if (m_bViewButtonClicked == false) {
			int width, height;
			glfwGetFramebufferSize(m_window, &width, &height);
			m_dCursorX = width / 2.0;
			m_dCursorY = height / 2.0;
			glfwSetCursorPos(m_window, m_dCursorX, m_dCursorY);
			m_bViewButtonClicked = true;
		} else {
			double mouseX, mouseY;
			glfwGetCursorPos(m_window, &mouseX, &mouseY);
			double xOffset = mouseX - m_dCursorX;
			double yOffset = mouseY - m_dCursorY;
			m_dCursorX = mouseX;
			m_dCursorY = mouseY;
			CalculateRotation(dt, xOffset, yOffset);
		}
	} else {
		m_bViewButtonClicked = false;
	}
}
コード例 #3
0
	void SceneObject::RotationTo(const _3point& rotation)
	{
		CalculateRotation(rotation);
	}
コード例 #4
0
	void SceneObject::RotationZ(const _point& angle)
	{
		CalculateRotation(m_Rotation + _3point(0.0f, 0.0f, angle));
	}
コード例 #5
0
	// Rotation
	void SceneObject::Rotation(const _3point& rotation)
	{
		CalculateRotation(m_Rotation + rotation);
	}
コード例 #6
0
ファイル: XSFlyCamera.cpp プロジェクト: eezstreet/xsngine
		void FlyCamera::HandleMouseInput( real64_t dt ) {
			real64_t xOffset = clgState.viewDelta[1] / 360.0;
			real64_t yOffset = clgState.viewDelta[0] / 360.0;
			CalculateRotation( dt, xOffset, yOffset );
		}