Example #1
0
	void CameraOld::pitchLocal(float deg)
	{
		glm::quat rot = glm::angleAxis(glm::radians(deg), mOrientation * glm::vec3(1,0,0));
		mOrientation = rot * mOrientation;
		mOrientation = glm::normalize(mOrientation);
		_invalidate();
	}
Example #2
0
	void CameraOld::setProjection(float fov, float aspect, float nearclip, float farclip, glm::vec2 offset)
	{
		mProjMatrix = glm::perspective(glm::radians(fov), aspect, nearclip, farclip);
		// Offset the Z row X and Y to skew the cameras vision
		mProjMatrix[2].xy += offset;
		_invalidate();
	}
Example #3
0
	void CameraOld::rollGlobal(float deg)
	{
		glm::quat rot = glm::angleAxis(glm::radians(deg), glm::vec3(0,0,1));
		mOrientation = rot * mOrientation;
		mOrientation = glm::normalize(mOrientation);
		_invalidate();
	}
Example #4
0
uint64_t RedScreen::invalidate(const SpiceRect& rect, bool urgent)
{
    uint64_t update_mark;
    if (_invalidate(rect, urgent, update_mark)) {
        if (!urgent && _update_by_timer) {
            activate_timer();
        } else {
            if (update_by_interrupt()) {
                interrupt_update();
            } else {
                AutoRef<UpdateEvent> update_event(new UpdateEvent(_id));
                _owner.push_event(*update_event);
            }
        }
    }
    return update_mark;
}
Example #5
0
	void CameraOld::lookAt(glm::vec3 lookat, glm::vec3 up)
	{
		glm::vec3 xAxis, yAxis, zAxis;
		zAxis = glm::normalize(mPosition-lookat);
		xAxis = glm::normalize(glm::cross(up, zAxis));
		yAxis = glm::cross(zAxis, xAxis);

		glm::mat4 mat;
		mat[0] = glm::vec4(xAxis, 0);
		mat[1] = glm::vec4(yAxis, 0);
		mat[2] = glm::vec4(zAxis, 0);
		mat[3] = glm::vec4(0,0,0, 1);

		mOrientation = glm::toQuat(mat);

		_invalidate();
	}
Example #6
0
	void CameraOld::translateGlobal(const glm::vec3& vec)
	{
		mPosition += vec;
		_invalidate();
	}
Example #7
0
	void CameraOld::translateLocal(const glm::vec3& vec)
	{
		glm::vec3 trans = mOrientation * vec;
		mPosition += trans;
		_invalidate();
	}
Example #8
0
	void CameraOld::setOrtho(float left, float right, float bottom, float top, float nearclip, float farclip)
	{
		mProjMatrix = glm::ortho(left, right, bottom, top, nearclip, farclip);
		_invalidate();
	}
Example #9
0
	void CameraOld::setPosition(glm::vec3 pos)
	{
		mPosition = pos;
		_invalidate();
	}