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 | Protected Member Functions | Protected Attributes | List of all members
FConstantVolumeJoint Class Reference
Inheritance diagram for FConstantVolumeJoint:
FJoint FDrawable

Public Member Functions

 FConstantVolumeJoint ()
 
void addBody (FBody b)
 
ArrayList getBodies ()
 
void setDamping (float damping)
 
void setFrequency (float frequency)
 
PVector getCentroid ()
 
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

ArrayList m_bodies
 
float m_damping = 0.0f
 
float m_frequency = 0.0f
 
- 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
 

Detailed Description

Represents constant volume joint that tries to keep the volume enclosed by a group of bodies constant. This joint is similar to connecting multiple springs between the bodies in order to maintain the volume inside their position constant. This is the joint used to create the FBlob body.

Constructor & Destructor Documentation

◆ FConstantVolumeJoint()

FConstantVolumeJoint.FConstantVolumeJoint ( )

Constructs an constant volume joint. It creates an empty joint, before adding the joint to the world use addBody to add bodies to the joint and to define the initial and target volume of the joint.

Member Function Documentation

◆ addBody()

void FConstantVolumeJoint.addBody ( FBody  b)

Adds a body to the joint. This method must be called before adding the joint to the world.

Parameters
bbody to be added

◆ getBodies()

ArrayList FConstantVolumeJoint.getBodies ( )

Return the group of bodies that are connected by this joint.

Returns
list of bodies (ArrayList of FBody) connected by the joint

◆ setDamping()

void FConstantVolumeJoint.setDamping ( float  damping)

Sets the damping of the springs used to maintain the volume defined by the vertices constant. This method must be called before adding the joint to the world.

Parameters
dampingthe damping of the springs of the constant volume joint

◆ setFrequency()

void FConstantVolumeJoint.setFrequency ( float  frequency)

Sets the frequency of the springs used to maintain the volume defined by the vertices constant. This method must be called before adding the joint to the world.

Parameters
frequencythe frequency of the springs of the constant volume joint

The documentation for this class was generated from the following file: