Class BezierSurface

    • Method Detail

      • decreaseHorizontalForce

        public void decreaseHorizontalForce()
        Decrease the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
        Specified by:
        decreaseHorizontalForce in interface SuperSurface
      • decreaseVerticalForce

        public void decreaseVerticalForce()
        Decrease the amount of vertical displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
        Specified by:
        decreaseVerticalForce in interface SuperSurface
      • getActiveBezierPointIndex

        public int getActiveBezierPointIndex​(int mX,
                                             int mY)
        Returns index 0-7 if coordinates are on a bezier control
        Specified by:
        getActiveBezierPointIndex in interface SuperSurface
        Parameters:
        mX -
        mY -
        Returns:
      • getActiveCornerPointIndex

        public int getActiveCornerPointIndex​(int mX,
                                             int mY)
        Returns index 0-3 if coordinates are near a corner or index 4 if on a surface
        Specified by:
        getActiveCornerPointIndex in interface SuperSurface
        Parameters:
        mX -
        mY -
        Returns:
      • getActivePoint

        public int getActivePoint()
        Get the index of active corner (or surface)
        Specified by:
        getActivePoint in interface SuperSurface
        Returns:
      • getArea

        public double getArea()
        Description copied from interface: SuperSurface
        Calculates and returns the surfaces area in squarepixels.
        Specified by:
        getArea in interface SuperSurface
        Returns:
      • getBezierPoint

        public Point3D getBezierPoint​(int index)
        Get the target bezier point
        Specified by:
        getBezierPoint in interface SuperSurface
        Parameters:
        index -
        Returns:
      • getBezierPoints

        public Point3D[] getBezierPoints()
        Get all bezier points
        Returns:
      • getBlendLeftSize

        public float getBlendLeftSize()
        Description copied from interface: SuperSurface
        Get the width of the left edge blend
        Specified by:
        getBlendLeftSize in interface SuperSurface
        Returns:
      • getBlendRightSize

        public float getBlendRightSize()
        Description copied from interface: SuperSurface
        Get the width of the right edge blend
        Specified by:
        getBlendRightSize in interface SuperSurface
        Returns:
      • getBufferScreenWidth

        public int getBufferScreenWidth()
      • getCenter

        public Point3D getCenter()
        Get the average center point of the surface
        Specified by:
        getCenter in interface SuperSurface
        Returns:
      • getColor

        public int getColor()
        Get the fill color of the surface in calibration mode
        Specified by:
        getColor in interface SuperSurface
        Returns:
      • getCornerPoint

        public Point3D getCornerPoint​(int index)
        Get the target corner point
        Specified by:
        getCornerPoint in interface SuperSurface
        Parameters:
        index -
        Returns:
      • getHorizontalForce

        public int getHorizontalForce()
        Get the amount of horizontal displacement force used for spherical mapping for bezier surfaces.
        Specified by:
        getHorizontalForce in interface SuperSurface
        Returns:
      • getId

        public int getId()
        Get the surfaces ID
        Specified by:
        getId in interface SuperSurface
        Returns:
      • getLocked

        public boolean getLocked()
        See if the surface is locked
        Returns:
      • getLongestSide

        public double getLongestSide()
        Get the longest side as double
        Specified by:
        getLongestSide in interface SuperSurface
        Returns:
      • getRes

        public int getRes()
        Get the amount of subdivision used in the surface
        Specified by:
        getRes in interface SuperSurface
        Returns:
      • getSelectedBezierControl

        public int getSelectedBezierControl()
        Get the currently selected bezier control
        Specified by:
        getSelectedBezierControl in interface SuperSurface
        Returns:
      • getSelectedCorner

        public int getSelectedCorner()
        Get the currently selected corner
        Specified by:
        getSelectedCorner in interface SuperSurface
        Returns:
      • getSurfaceType

        public int getSurfaceType()
        Description copied from interface: SuperSurface
        See which type this surface is
        Specified by:
        getSurfaceType in interface SuperSurface
        Returns:
      • getVerticalForce

        public int getVerticalForce()
        Get the amount of vertical displacement force used for spherical mapping for bezier surfaces.
        Specified by:
        getVerticalForce in interface SuperSurface
        Returns:
      • increaseHorizontalForce

        public void increaseHorizontalForce()
        Increase the amount of horizontal displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
        Specified by:
        increaseHorizontalForce in interface SuperSurface
      • increaseVerticalForce

        public void increaseVerticalForce()
        Increase the amount of vertical displacement force used for spherical mapping for bezier surfaces. (using orthographic projection)
        Specified by:
        increaseVerticalForce in interface SuperSurface
      • isBlendLeft

        public boolean isBlendLeft()
        Description copied from interface: SuperSurface
        See if the surface has been set to blend on the left
        Specified by:
        isBlendLeft in interface SuperSurface
        Returns:
      • isBlendRight

        public boolean isBlendRight()
        Description copied from interface: SuperSurface
        See if the surface has been set to blend on the right
        Specified by:
        isBlendRight in interface SuperSurface
        Returns:
      • isCornerMovementAllowed

        public boolean isCornerMovementAllowed()
        Description copied from interface: SuperSurface
        See if we can move the cornerpoint of the surface
        Specified by:
        isCornerMovementAllowed in interface SuperSurface
        Returns:
      • isHidden

        public boolean isHidden()
        See if surface is hidden
        Specified by:
        isHidden in interface SuperSurface
        Returns:
      • isInside

        public boolean isInside​(float mX,
                                float mY)
        Returns true if coordinates are inside a surface
        Specified by:
        isInside in interface SuperSurface
        Parameters:
        mX -
        mY -
        Returns:
      • isLocked

        public boolean isLocked()
        Description copied from interface: SuperSurface
        See if the surface is locked
        Specified by:
        isLocked in interface SuperSurface
        Returns:
      • isSelected

        public boolean isSelected()
        See if the surface is selected
        Specified by:
        isSelected in interface SuperSurface
        Returns:
      • isUsingEdgeBlend

        public boolean isUsingEdgeBlend()
        Description copied from interface: SuperSurface
        See if the surface is using edge blend
        Specified by:
        isUsingEdgeBlend in interface SuperSurface
        Returns:
      • render

        public void render​(processing.core.PGraphics g)
        Render method for rendering while in calibration mode
        Specified by:
        render in interface SuperSurface
        Parameters:
        g -
      • render

        public void render​(processing.core.PGraphics g,
                           processing.core.PImage tex)
        Render method for rendering in RENDER mode. Takes one GLGraphicsOffScreen and one GLTexture. The GLTexture is the texture used for the surface, and is drawn to the offscreen buffer.
        Specified by:
        render in interface SuperSurface
        Parameters:
        g -
        tex -
      • rotateCornerPoints

        public void rotateCornerPoints​(int direction)
        Rotate the cornerpoints in direction (0=ClockWise 1=CounterClockWise)
        Specified by:
        rotateCornerPoints in interface SuperSurface
        Parameters:
        direction -
      • screenCoordinatesToQuad

        public Point3D screenCoordinatesToQuad​(float x,
                                               float y)
        Translates a point on the screen into a point in the surface. (not implemented in Bezier Surfaces yet)
        Specified by:
        screenCoordinatesToQuad in interface SuperSurface
        Parameters:
        x -
        y -
        Returns:
      • setActivePoint

        public void setActivePoint​(int activePoint)
        Set index of which corner is active
        Specified by:
        setActivePoint in interface SuperSurface
        Parameters:
        activePoint -
      • setBezierPoint

        public void setBezierPoint​(int pointIndex,
                                   float x,
                                   float y)
        Set target bezier control point to coordinates
        Specified by:
        setBezierPoint in interface SuperSurface
        Parameters:
        pointIndex -
        x -
        y -
      • setBlendLeft

        public void setBlendLeft​(boolean blendLeft)
        Description copied from interface: SuperSurface
        Set if the left side should be blended
        Specified by:
        setBlendLeft in interface SuperSurface
      • setBlendLeftSize

        public void setBlendLeftSize​(float blendLeftSize)
        Description copied from interface: SuperSurface
        Set the width of the left edge blend
        Specified by:
        setBlendLeftSize in interface SuperSurface
      • setBlendRight

        public void setBlendRight​(boolean blendRight)
        Description copied from interface: SuperSurface
        Set if the right side should be blended
        Specified by:
        setBlendRight in interface SuperSurface
      • setBlendRightSize

        public void setBlendRightSize​(float blendRightSize)
        Description copied from interface: SuperSurface
        Set the width of the right edge blend
        Specified by:
        setBlendRightSize in interface SuperSurface
      • setBufferScreenWidth

        public void setBufferScreenWidth​(int bufferScreenWidth)
        Description copied from interface: SuperSurface
        Set the width of the buffer offscreen
        Specified by:
        setBufferScreenWidth in interface SuperSurface
      • setColor

        public void setColor​(int ccolor)
        Sets the fill color of the surface in calibration mode
        Specified by:
        setColor in interface SuperSurface
        Parameters:
        ccolor -
      • setCornerPoint

        public void setCornerPoint​(int pointIndex,
                                   float x,
                                   float y)
        Set target corner point to coordinates
        Specified by:
        setCornerPoint in interface SuperSurface
        Parameters:
        pointIndex -
        x -
        y -
      • setCornerPoints

        public void setCornerPoints​(float x0,
                                    float y0,
                                    float x1,
                                    float y1,
                                    float x2,
                                    float y2,
                                    float x3,
                                    float y3)
        Manually set coordinates for all corners of the surface
        Specified by:
        setCornerPoints in interface SuperSurface
        Parameters:
        x0 -
        y0 -
        x1 -
        y1 -
        x2 -
        y2 -
        x3 -
        y3 -
      • setHide

        public void setHide​(boolean hidden)
        Set if the surface should be hidden
        Specified by:
        setHide in interface SuperSurface
        Parameters:
        hidden -
      • setId

        public void setId​(int id)
        Set the surfaces ID
        Specified by:
        setId in interface SuperSurface
        Parameters:
        id -
      • setLocked

        public void setLocked​(boolean isLocked)
        Set if the surface is locked
        Specified by:
        setLocked in interface SuperSurface
        Parameters:
        isLocked -
      • setModeCalibrate

        public void setModeCalibrate()
        Set surface to calibration mode
        Specified by:
        setModeCalibrate in interface SuperSurface
      • setModeRender

        public void setModeRender()
        Set surface to render mode
        Specified by:
        setModeRender in interface SuperSurface
      • setSelected

        public void setSelected​(boolean selected)
        Set if the surface is selected
        Specified by:
        setSelected in interface SuperSurface
        Parameters:
        selected -
      • setSelectedBezierControl

        public void setSelectedBezierControl​(int selectedBezierControl)
        Set target bezier control to selected
        Specified by:
        setSelectedBezierControl in interface SuperSurface
        Parameters:
        selectedBezierControl -
      • setSelectedCorner

        public void setSelectedCorner​(int selectedCorner)
        Set target corner to selected
        Specified by:
        setSelectedCorner in interface SuperSurface
        Parameters:
        selectedCorner -
      • setShake

        public void setShake​(int strength,
                             int speed,
                             int fallOfSpeed)
        Set parameters for shaking the surface. Strength == max Z-displacement, Speed == vibration speed, FallOfSpeed 1-1000 == how fast strength is diminished
        Specified by:
        setShake in interface SuperSurface
        Parameters:
        strength -
        speed -
        fallOfSpeed -
      • setSurfaceMask

        public void setSurfaceMask​(processing.core.PImage mask)
        Specified by:
        setSurfaceMask in interface SuperSurface
      • setTextureWindow

        public void setTextureWindow​(float x,
                                     float y,
                                     float width,
                                     float height)
        Manually set coordinates for mapping the texture. This allows for easy cropping and enables a single texture to span more than one surface. Use normalized values for the values! (i.e 0-1)
        Specified by:
        setTextureWindow in interface SuperSurface
      • setZ

        public void setZ​(float currentZ)
        Set Z-displacement for all coordinates of surface
        Specified by:
        setZ in interface SuperSurface
        Parameters:
        currentZ -
      • setSketchIndex

        public void setSketchIndex​(int sketchIndex)
        Description copied from interface: SuperSurface
        Set the actual sketch index.
        Specified by:
        setSketchIndex in interface SuperSurface
      • shake

        public void shake()
        Tells surface to shake (will only do something if setShake has been called quite recently)
        Specified by:
        shake in interface SuperSurface
      • toggleLocked

        public void toggleLocked()
        Toggle if surface is locked
        Specified by:
        toggleLocked in interface SuperSurface
      • toggleMode

        public void toggleMode()
        Toggle surface mode
        Specified by:
        toggleMode in interface SuperSurface
      • updateTransform

        public void updateTransform()
        Recalculates all coordinates of the surface. Must be called whenever any change has been done to the surface.