|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mt4j.components.MTComponent
org.mt4j.components.visibleComponents.AbstractVisibleComponent
org.mt4j.components.visibleComponents.shapes.AbstractShape
org.mt4j.components.visibleComponents.shapes.MTCSSStylableShape
org.mt4j.components.visibleComponents.shapes.MTPolygon
org.mt4j.components.visibleComponents.shapes.MTRectangle
public class MTRectangle
A simple rectangular shape.
| Nested Class Summary | |
|---|---|
static class |
MTRectangle.PositionAnchorThe Enum PositionAnchor. |
| Field Summary |
|---|
| Fields inherited from class org.mt4j.components.visibleComponents.shapes.AbstractShape |
|---|
BOUNDS_CHECK_THEN_GEOMETRY_CHECK, BOUNDS_DONT_USE, BOUNDS_ONLY_CHECK, createDefaultGestures |
| Constructor Summary | |
|---|---|
MTRectangle(float x, float y, float z, float width, float height, processing.core.PApplet pApplet)Deprecated. constructor will be deleted! Please , use the constructor with the PApplet instance as the first parameter. |
|
MTRectangle(float x, float y, float width, float height, processing.core.PApplet pApplet)Deprecated. constructor will be deleted! Please , use the constructor with the PApplet instance as the first parameter. |
|
MTRectangle(float width, float height, processing.core.PApplet pApplet)Deprecated. constructor will be deleted! Please , use the constructor with the PApplet instance as the first parameter. |
|
MTRectangle(processing.core.PApplet pApplet, float width, float height)Instantiates a new mT rectangle with the upper left corner at 0,0,0 |
|
MTRectangle(processing.core.PApplet pApplet, float x, float y, float width, float height)Instantiates a new mT rectangle. |
|
MTRectangle(processing.core.PApplet pApplet, float x, float y, float z, float width, float height)Instantiates a new mT rectangle. |
|
MTRectangle(processing.core.PApplet applet, processing.core.PImage texture)Instantiates a new mT rectangle. |
|
MTRectangle(processing.core.PApplet pApplet, Vertex upperLeft, float width, float height)Instantiates a new mT rectangle. |
|
MTRectangle(processing.core.PApplet pApplet, Vertex upperLeft, float width, float height, int textureMaxX, int textureMaxY) |
|
MTRectangle(processing.core.PImage texture, processing.core.PApplet applet)Deprecated. constructor will be deleted! Please , use the constructor with the PApplet instance as the first parameter. |
|
MTRectangle(Vertex upperLeft, float width, float height, processing.core.PApplet pApplet)Deprecated. constructor will be deleted! Please , use the constructor with the PApplet instance as the first parameter. |
|
| Method Summary | |
|---|---|
double |
get2DPolygonArea()Calculates the area of a 2D polygon using its transformed world coordinates NOTE: works only if the last vertex is equal to the first (polygon is closed correctly). |
MTRectangle.PositionAnchor |
getAnchor()Gets the Position anchor. |
Vector3D |
getCenterOfMass2DLocal()Calculates the center of mass of the polygon. |
Vector3D |
getCenterPointLocal()Gets the center point in local object space. |
Vector3D |
getPosition(TransformSpace transformSpace)Gets the position. |
void |
setAnchor(MTRectangle.PositionAnchor anchor)Sets the anchor. |
void |
setHeightLocal(float height)Sets the height locally, meaning that not the transformation of the rectangle is changed, (as setSize/setWidth, scale etc. would do) but the vertices of the rectangle themselves. |
void |
setPositionGlobal(Vector3D position)Sets the global position of the component. |
void |
setPositionRelativeToParent(Vector3D position)Sets the position of the component, relative to its parent coordinate frame. |
void |
setSizeLocal(float width, float height)Sets the size locally, meaning that not the transformation of the rectangle is changed, (as setSize/setWidth, scale etc. would do) but the vertices of the rectangle themselves. |
void |
setTexture(processing.core.PImage newTexImage)Sets a texture for this shape. |
void |
setUseDirectGL(boolean drawPureGL)If set to true - which is the default if using the OpenGL render mode - this shape will bypass processings rendering pipeline and use the OpenGL context directly for performance increases. |
void |
setWidthLocal(float width)Sets the width locally, meaning that not the transformation of the rectangle is changed, (as setSize/setWidth, scale etc. would do) but the vertices of the rectangle themselves. |
| Methods inherited from class org.mt4j.components.visibleComponents.shapes.MTPolygon |
|---|
drawComponent, getGeometryIntersectionLocal, getNormal, isGeometryContainsPointLocal, setGeometryInfo, setHeightXYGlobal, setHeightXYRelativeToParent, setSizeXYGlobal, setSizeXYRelativeToParent, setVertices, setWidthXYGlobal, setWidthXYRelativeToParent |
| Methods inherited from class org.mt4j.components.visibleComponents.shapes.MTCSSStylableShape |
|---|
applyStyleSheet, disableCSS, enableCSS, getCssHelper, isCssForceDisabled, isCSSStyled, setCssForceDisable |
| Methods inherited from class org.mt4j.components.visibleComponents.shapes.AbstractShape |
|---|
destroy, disableAndDeleteDisplayLists, generateAndUseDisplayLists, generateDisplayLists, getCenterPointGlobal, getCenterPointRelativeToParent, getGeometryInfo, getHeightXY, getHeightXYVectLocal, getIntersectionLocal, getTexture, getTextureMode, getVertexCount, getVerticesGlobal, getVerticesLocal, getWidthXY, getWidthXYVectLocal, isBoundsAutoCompute, isSelected, isTextureEnabled, isUseDirectGL, isUseDisplayList, isUseVBOs, setBoundsAutoCompute, setBoundsBehaviour, setFillColor, setMatricesDirty, setPositionRelativeToOther, setSelected, setStrokeColor, setTextureEnabled, setTextureMode, setUseDisplayList, setUseVBOs, tweenTranslate, tweenTranslate, tweenTranslate, tweenTranslateTo, tweenTranslateTo |
| Methods inherited from class org.mt4j.components.visibleComponents.AbstractVisibleComponent |
|---|
getFillColor, getFillDrawMode, getFillPaint, getLineStipple, getMaterial, getStrokeColor, getStrokeWeight, getStyleInfo, isDrawSmooth, isNoFill, isNoStroke, postDraw, postDrawChildren, preDraw, setDrawSmooth, setFillDrawMode, setFillPaint, setLineStipple, setMaterial, setNoFill, setNoStroke, setStrokeWeight, setStyleInfo |
| Methods inherited from class org.mt4j.components.MTComponent |
|---|
addChild, addChild, addChildren, addGestureListener, addInputListener, addStateChangeListener, attachCamera, containsChild, containsDirectChild, containsPointGlobal, getAttachedCamera, getBoundingShape, getBounds, getChildbyID, getChildByIndex, getChildByName, getChildClip, getChildCount, getChildIndexOf, getChildren, getClip, getController, getCSSID, getGestureListeners, getGlobalInverseMatrix, getGlobalMatrix, getGlobalVecToParentRelativeSpace, getID, getInputListeners, getInputProcessors, getIntersectionGlobal, getIntersectionGlobal, getLight, getLocalInverseMatrix, getLocalMatrix, getLocalVecToParentRelativeSpace, getName, getParent, getRenderer, getRoot, getStateChangeListeners, getTransformToDestinationLocalSpace, getTransformToDestinationParentSpace, getUserData, getViewingCamera, globalToLocal, globalToLocal, hasBounds, isBoundingShapeSet, isComposite, isContainedIn, isDepthBufferDisabled, isEnabled, isGestureAllowed, isPickable, isVisible, localToGlobal, localToParent, parentToLocal, pick, pick, processGestureEvent, processInputEvent, registerInputProcessor, removeAllChildren, removeAllGestureEventListeners, removeAllGestureEventListeners, removeChild, removeChild, removeFromParent, removeGestureEventListener, removeInputListener, removeStateChangeListener, reOrthogonalize, rotateX, rotateX, rotateXGlobal, rotateY, rotateY, rotateYGlobal, rotateZ, rotateZ, rotateZGlobal, scale, scale, scaleGlobal, sendToFront, setBoundingShape, setBounds, setChildClip, setClip, setComposite, setController, setCSSID, setDepthBufferDisabled, setEnabled, setGestureAllowance, setLight, setLocalMatrix, setName, setPickable, setUserData, setVisible, toString, transform, translate, translate, translateGlobal, unregisterAllInputProcessors, unregisterInputProcessor, updateComponent |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.mt4j.components.interfaces.IMTComponent3D |
|---|
getIntersectionGlobal, getViewingCamera, isPickable, rotateXGlobal, rotateYGlobal, setPickable |
| Methods inherited from interface org.mt4j.components.interfaces.IMTComponent |
|---|
containsPointGlobal, getID, getName, getRenderer, getRoot, isEnabled, isGestureAllowed, isVisible, processInputEvent, rotateZGlobal, scaleGlobal, setEnabled, setName, setVisible, translateGlobal, updateComponent |
| Constructor Detail |
|---|
public MTRectangle(processing.core.PImage texture,
processing.core.PApplet applet)
texture - the textureapplet - the applet
public MTRectangle(processing.core.PApplet applet,
processing.core.PImage texture)
applet - the applettexture - the texture
public MTRectangle(float width,
float height,
processing.core.PApplet pApplet)
width - the widthheight - the heightpApplet - the applet
public MTRectangle(processing.core.PApplet pApplet,
float width,
float height)
pApplet - the appletwidth - the widthheight - the height
public MTRectangle(float x,
float y,
float width,
float height,
processing.core.PApplet pApplet)
x - the xy - the ywidth - the widthheight - the heightpApplet - the applet
public MTRectangle(processing.core.PApplet pApplet,
float x,
float y,
float width,
float height)
pApplet - the appletx - the xy - the ywidth - the widthheight - the height
public MTRectangle(float x,
float y,
float z,
float width,
float height,
processing.core.PApplet pApplet)
x - the xy - the yz - the zwidth - the widthheight - the heightpApplet - the applet
public MTRectangle(processing.core.PApplet pApplet,
float x,
float y,
float z,
float width,
float height)
pApplet - the appletx - the xy - the yz - the zwidth - the widthheight - the height
public MTRectangle(Vertex upperLeft,
float width,
float height,
processing.core.PApplet pApplet)
upperLeft - the upper leftwidth - the widthheight - the heightpApplet - the applet
public MTRectangle(processing.core.PApplet pApplet,
Vertex upperLeft,
float width,
float height)
pApplet - the appletupperLeft - the upper leftwidth - the widthheight - the height
public MTRectangle(processing.core.PApplet pApplet,
Vertex upperLeft,
float width,
float height,
int textureMaxX,
int textureMaxY)
| Method Detail |
|---|
public void setUseDirectGL(boolean drawPureGL)
AbstractShapeIf this is set to true, and additionally, setUseVBOs() is set to true, the shape is drawn by using vertex buffer objects (VBO).
By calling setUseDisplayList(true) it is drawn using display lists.
setUseDirectGL in class MTPolygon
drawPureGL - the draw pure glpublic void setTexture(processing.core.PImage newTexImage)
AbstractShapesetTexture in class AbstractShape
newTexImage - the new tex imagepublic MTRectangle.PositionAnchor getAnchor()
public void setAnchor(MTRectangle.PositionAnchor anchor)
anchor - the new anchorpublic void setPositionGlobal(Vector3D position)
AbstractShapesetPositionGlobal in class AbstractShape
position - the pospublic void setPositionRelativeToParent(Vector3D position)
AbstractShapesetPositionRelativeToParent in class AbstractShape
position - the pospublic Vector3D getPosition(TransformSpace transformSpace)
transformSpace - the transform spacepublic double get2DPolygonArea()
MTPolygonget2DPolygonArea in class MTPolygon
public Vector3D getCenterOfMass2DLocal()
MTPolygongetCenterOfMass2DLocal in class MTPolygon
public Vector3D getCenterPointLocal()
AbstractShapegetCenterPointLocal in class MTPolygon
public void setSizeLocal(float width,
float height)
width - the widthheight - the heightpublic void setHeightLocal(float height)
height - the new height localpublic void setWidthLocal(float width)
width - the new width local
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||