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
FLine Class Reference
Inheritance diagram for FLine:
FBody FDrawable

Public Member Functions

 FLine (float x1, float y1, float x2, float y2)
 
void setStart (float x, float y)
 
void setEnd (float x, float y)
 
void draw (PGraphics applet)
 
void drawDebug (PGraphics applet)
 
- Public Member Functions inherited from FBody
Body getBox2dBody ()
 
int getGroupIndex ()
 
void addToWorld (FWorld world)
 
void setState (FBody b)
 
void setStateFromWorld ()
 
void recreateInWorld ()
 
void removeFromWorld ()
 
void setGroupIndex (int index)
 
void setFilterBits (int mask)
 
void setCategoryBits (int mask)
 
int getCategoryBits ()
 
int getFilterBits ()
 
void setParent (FBody b)
 
FBody getParent ()
 
void setGrabbable (boolean value)
 
void setForce (float fx, float fy)
 
float getForceX ()
 
float getForceY ()
 
void addTorque (float torque)
 
void addForce (float fx, float fy)
 
void addImpulse (float fx, float fy)
 
void addForce (float fx, float fy, float px, float py)
 
void addImpulse (float fx, float fy, float px, float py)
 
void resetForces ()
 
float getVelocityX ()
 
float getVelocityY ()
 
void setVelocity (float vx, float vy)
 
void adjustVelocity (float dvx, float dvy)
 
float getX ()
 
float getY ()
 
void setPosition (float x, float y)
 
void adjustPosition (float dx, float dy)
 
float getRotation ()
 
float getHapticStiffness ()
 
float getHapticDamping ()
 
void setRotation (float w)
 
void adjustRotation (float dw)
 
boolean isResting ()
 
boolean isSleeping ()
 
void wakeUp ()
 
float getAngularVelocity ()
 
void setAngularVelocity (float w)
 
void adjustAngularVelocity (float dw)
 
void setAngularDamping (float damping)
 
void setDamping (float damping)
 
void setName (String name)
 
String getName ()
 
void setDensity (float density)
 
float getDensity ()
 
void setSensor (boolean value)
 
boolean isSensor ()
 
void setHaptic (boolean value)
 
void setHaptic (boolean value, float stiffness, float damping)
 
boolean isHaptic ()
 
void setHapticStiffness (float stiffness)
 
void setHapticDamping (float damping)
 
void setStaticBody (boolean value)
 
void setStatic (boolean value)
 
float getMass ()
 
boolean isStatic ()
 
void setBullet (boolean value)
 
void setRestitution (float restitution)
 
void setFriction (float friction)
 
void setRotatable (boolean rotatable)
 
void setAllowSleeping (boolean allowSleep)
 
ArrayList getTouching ()
 
ArrayList getContacts ()
 
ArrayList getJoints ()
 
boolean isConnected (FBody other)
 
boolean isTouchingBody (FBody b)
 
- 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

ShapeDef getShapeDef ()
 
- Protected Member Functions inherited from FBody
void processBody (Body bd, ShapeDef sd)
 
ShapeDef getShapeDef ()
 
ShapeDef getTransformedShapeDef ()
 
ShapeDef getProcessedShapeDef ()
 
ArrayList getShapeDefs ()
 
ArrayList getBodies ()
 
ShapeDef processShapeDef (ShapeDef sd)
 
void preDraw (PGraphics applet)
 
void postDraw (PGraphics applet)
 
void preDrawDebug (PGraphics applet)
 
void postDrawDebug (PGraphics applet)
 
AABB getAABB ()
 
AABB getBB ()
 
void applyMatrix (PGraphics applet)
 
void setPosition (Vec2 position)
 
void updateMass ()
 
Vec2 getLocalWorldPoint (Vec2 p)
 
- 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

Vec2 m_start
 
Vec2 m_end
 
- Protected Attributes inherited from FBody
float m_density = 1.0f
 
float m_restitution = 0.1f
 
float m_friction = 0.1f
 
boolean m_bullet = false
 
boolean m_sensor = false
 
boolean m_static = false
 
float m_linearDamping = 0.5f
 
float m_gravityScale = 1.0f
 
float m_angularDamping = 0.5f
 
boolean m_rotatable = true
 
boolean m_allowSleep = true
 
boolean m_isSleeping = false
 
int m_groupIndex = 0
 
int m_filterBits = 0xffff
 
int m_categoryBits = 0x0001
 
Vec2 m_linearVelocity = new Vec2(0.0f, 0.0f)
 
float m_angularVelocity = 0.0f
 
Vec2 m_force = new Vec2(0.0f, 0.0f)
 
float m_torque = 0.0f
 
Vec2 m_position = new Vec2(0.0f, 0.0f)
 
float m_angle = 0.0f
 
String m_name
 
Body m_body
 
FWorld m_world
 
FBody m_parent
 
boolean m_grabbable = true
 
boolean h_isHaptic = true
 
float h_damping = 0.0f
 
float h_stiffness =0.0f
 
- 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 a line body that can be added to a world.

FLine myLine = new FLine(40, 20, 100, 40);
world.add(myLine);

Bodies

See also
FBox
FCircle
FBlob
FPoly

Constructor & Destructor Documentation

◆ FLine()

FLine.FLine ( float  x1,
float  y1,
float  x2,
float  y2 
)

Constructs a line body that can be added to a world.

Parameters
x1horizontal position of the first point of the line
y1vertical position of the first point of the line
x2horizontal position of the second point of the line
y2vertical position of the second point of the line

Member Function Documentation

◆ setEnd()

void FLine.setEnd ( float  x,
float  y 
)

Sets the end point of the line. Under the hood the body is removed and readded to the world.

Bodies

Parameters
xhorizontal position of the first point of the line
yvertical position of the first point of the line

◆ setStart()

void FLine.setStart ( float  x,
float  y 
)

Sets the start point of the line. Under the hood the body is removed and readded to the world.

Bodies

Parameters
xhorizontal position of the first point of the line
yvertical position of the first point of the line

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