Ejemplo n.º 1
0
    void keypressHandler(unsigned char key, int mouseX, int mouseY) {
        switch(key) {
            case 'w':
                ociste.y += 0.1;
                break;
            case 's' :
                ociste.y -= 0.1;
                break;
            case 'a' :
                ociste.x -= 0.1;
                break;
            case 'd' :
                ociste.x += 0.1;
                break;
            case 'q' :
                ociste.z += 0.1;
                break;
            case 'e' :
                ociste.z -= 0.1;
                break;
            case 'm' :
                moveObj();
                break;
            case 'r' :
                ociste.x = 0;
                ociste.y = 0;
                ociste.z = 5;
                break;
            default:
                cout << "No handler for this key" << endl;
        }

        updatePerspective();
        glutPostRedisplay();
    }
Ejemplo n.º 2
0
    /**
     * Handles the window resize.
     *
     * @param width:int - New window width
     * @param height:int - New window height
     */
    void reshapeHandler(int w, int h) {
        width = w;
        height = h;

        glViewport(0, 0, width, height);
        updatePerspective();
        glClearDepth(1.0f);
        glEnable(GL_DEPTH_TEST);
        glEnable(GL_CULL_FACE);
        glDepthFunc(GL_LESS);
    }
Ejemplo n.º 3
0
void PaintPropertyTreeBuilder::buildTreeNodesForChildren(
    const LayoutObject& object,
    PaintPropertyTreeBuilderContext& context) {
  if (!object.isBoxModelObject() && !object.isSVG())
    return;

  updateOverflowClip(object, context);
  updatePerspective(object, context);
  updateSvgLocalToBorderBoxTransform(object, context);
  updateScrollAndScrollTranslation(object, context);
  updateOutOfFlowContext(object, context);
}
Ejemplo n.º 4
0
Camera::Camera(float ratio):
	mFovy(70),
	mNear(1),
	mFar(10000),
	mRatio(ratio),
	mTheta(0),
	mPhi(0),
	mZoom(1.f),
	mHold(false)
{
	updatePerspective();
}
Ejemplo n.º 5
0
DirectionNode::DirectionNode(){
  projectionMatrix = QMatrix4x4();
  viewMatrix = QMatrix4x4();

  // TODO(bmonkey): Hardcoded values => xml
  aspect = 1920.0 / 1200.0;

  fov = 70.0;
  nearClip = 0.01;
  farClip = 1000.0;
//  nearClip = 0.1;
//  farClip = 10.0;
  updatePerspective();
}
Ejemplo n.º 6
0
void WalkmeshWidget::fill(Field *field)
{
	this->walkmesh = field->walkmesh();
	this->camera = field->camera();
	this->infFile = field->inf();
	this->bgFile = field->background();
	this->scripts = field->scriptsAndTexts();
	this->field = field;
	this->fieldModels.clear();
	if(modelsVisible) {
		openModels();
	}

	updatePerspective();
	resetCamera();
}
void PaintPropertyTreeBuilder::buildTreeNodes(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
{
    if (!object.isBoxModelObject() && !object.isSVG())
        return;

    object.getMutableForPainting().clearObjectPaintProperties();

    deriveBorderBoxFromContainerContext(object, context);

    updatePaintOffsetTranslation(object, context);
    updateTransform(object, context);
    updateEffect(object, context);
    updateCssClip(object, context);
    updateLocalBorderBoxContext(object, context);
    updateScrollbarPaintOffset(object, context);
    updateOverflowClip(object, context);
    // TODO(trchen): Insert flattening transform here, as specified by
    // http://www.w3.org/TR/css3-transforms/#transform-style-property
    updatePerspective(object, context);
    updateSvgLocalToBorderBoxTransform(object, context);
    updateScrollTranslation(object, context);
    updateOutOfFlowContext(object, context);
}
Ejemplo n.º 8
0
void DirectionNode::setAspect(qreal aspect) {
    this->aspect = aspect;
    /* Create our projection matrix with a 45 degree field of view
     * a width to height ratio of 1 and view from .1 to 100 infront of us */
    updatePerspective();
}