|
hAPI Fisica
0.1
The hAPI Fisica physics engine expands Richard Marxer's fisica for Processing. The engine wraps the jbox2d physics engine for use with the Haply Development kit and the Hapkit.
|
Public Member Functions | |
| FDistanceJoint (FBody body1, FBody body2) | |
| void | setDamping (float damping) |
| void | setFrequency (float frequency) |
| void | calculateLength () |
| void | setLength (float length) |
| void | setAnchor2 (float x, float y) |
| void | setAnchor1 (float x, float y) |
| float | getAnchor1X () |
| float | getAnchor1Y () |
| float | getAnchor2X () |
| float | getAnchor2Y () |
| void | draw (PGraphics applet) |
| void | drawDebug (PGraphics applet) |
Public Member Functions inherited from FJoint | |
| Joint | getBox2dJoint () |
| void | addToWorld (FWorld world) |
| void | removeFromWorld () |
| FBody | getBody1 () |
| FBody | getBody2 () |
| void | setCollideConnected (boolean value) |
| float | getReactionForceX () |
| float | getReactionForceY () |
| float | getReactionTorque () |
Public Member Functions inherited from FDrawable | |
| void | draw (PGraphics graphics) |
| void | draw (PApplet applet) |
| void | drawDebug (PGraphics graphics) |
| void | drawDebug (PApplet applet) |
| void | attachImage (PImage img) |
| void | dettachImage () |
| float | getImageAlpha () |
| void | setImageAlpha (float alpha) |
| void | setDrawable (boolean drawable) |
| boolean | isDrawable () |
| int | getFillColor () |
| void | setFillColor (int col) |
| void | setNoFill () |
| void | setFill (float g) |
| void | setFill (float g, float a) |
| void | setFill (float r, float g, float b) |
| void | setFill (float r, float g, float b, float a) |
| void | setStrokeColor (int col) |
| void | setNoStroke () |
| void | setStroke (float g) |
| void | setStroke (float g, float a) |
| void | setStroke (float r, float g, float b) |
| void | setStroke (float r, float g, float b, float a) |
| void | setStrokeWeight (float weight) |
Protected Member Functions | |
| JointDef | getJointDef (FWorld world) |
Protected Member Functions inherited from FJoint | |
| void | processJoint (World world, JointDef jd) |
| JointDef | getJointDef (FWorld world) |
| void | preDraw (PGraphics applet) |
| void | postDraw (PGraphics applet) |
| void | preDrawDebug (PGraphics applet) |
| void | postDrawDebug (PGraphics applet) |
Protected Member Functions inherited from FDrawable | |
| void | updateStyle (FDrawable other) |
| void | appletStroke (PGraphics applet, int argb) |
| void | appletFill (PGraphics applet, int argb) |
| void | appletFillStroke (PGraphics applet) |
| void | drawImage (PGraphics applet) |
Protected Attributes | |
| FBody | m_body1 |
| FBody | m_body2 |
| float | m_damping = 0.3f |
| float | m_frequency = 10.0f |
| float | m_length |
| Vec2 | m_anchor1 |
| Vec2 | m_anchor2 |
Protected Attributes inherited from FJoint | |
| Joint | m_joint |
| FWorld | m_world |
| boolean | m_collideConnected = true |
Protected Attributes inherited from FDrawable | |
| boolean | m_drawable = true |
| boolean | m_fill = true |
| int | m_fillColor = 0xFFFFFFFF |
| boolean | m_stroke = true |
| int | m_strokeColor = 0xFF000000 |
| float | m_strokeWeight = 1.0f |
| PImage | m_image = null |
| float | m_imageAlpha = 255.0f |
| PImage | m_mask = null |
Represents a distance joint that tries to keep two bodies at a constant distance. This joint is similar to connecting both bodies by a spring.
Construct a distance joint between two bodies. The constructor automatically sets the anchors of the joint to the centers of each body, and the length of the joint to the current distance between the bodies.
| body1 | first body of the joint |
| body2 | second body of the joint |
| void FDistanceJoint.calculateLength | ( | ) |
Sets the length of the joint to the current distance between the bodies.
| float FDistanceJoint.getAnchor1X | ( | ) |
Get the horizontal coordinate of the first anchor point on the first body. This position is given relative to the center of the first body.
| float FDistanceJoint.getAnchor1Y | ( | ) |
Get the vertical coordinate of the first anchor point on the first body. This position is given relative to the center of the first body.
| float FDistanceJoint.getAnchor2X | ( | ) |
Get the horizontal coordinate of the second anchor point on the second body. This position is given relative to the center of the second body.
| float FDistanceJoint.getAnchor2Y | ( | ) |
Get the vertical coordinate of the second anchor point on the second body. This position is given relative to the center of the second body.
| void FDistanceJoint.setAnchor1 | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the anchor of the first end of the joint on the first body. This position must be given relative to the center of the first body. The anchor point is the point used to calculate the distance and to apply forces in order to move the body.
| x | the horizontal coordinate of the first anchor relative to the center of the first body |
| y | the vertical coordinate of the first anchor relative to the center of the first body |
| void FDistanceJoint.setAnchor2 | ( | float | x, |
| float | y | ||
| ) |
Sets the position of the anchor of the second end of the joint on the second body. This position must be given relative to the center of the second body. The anchor point is the point used to calculate the distance and to apply forces in order to move the body.
| x | the horizontal coordinate of the second anchor relative to the center of the second body |
| y | the vertical coordinate of the second anchor relative to the center of the second body |
| void FDistanceJoint.setDamping | ( | float | damping | ) |
Sets the damping of the spring used to maintain the distance between the bodies constant.
| damping | the damping of the spring |
| void FDistanceJoint.setFrequency | ( | float | frequency | ) |
Sets the frequency of the spring used to maintain the distance between the bodies constant.
| frequency | the frequency of the spring |
| void FDistanceJoint.setLength | ( | float | length | ) |
Sets the target distance for the joint. This is the distance that the joint will try to maintain between the two bodies. If you want to use as length the current distance between the two bodies, use the method calculateLength.
| length | the length of the joint |
1.8.13