Class

Entity

Entity(iterations, verlyInstance)

Constructor

new Entity(iterations, verlyInstance)

Parameters:
Name Type Description
iterations number
verlyInstance Verly

View Source Entity.js, line 7

Methods

addAngleStick(p1, p2, p3, stiffness) → {AngleStick}

adds a AngleStick in between 3 points
Parameters:
Name Type Description
p1 Point
p2 Point
p3 Point
stiffness number

View Source Entity.js, line 132

AngleStick

addPoint(x, yopt, vxopt, vyopt, radiusopt) → {Point}

adds a Point in points array with {x,y,vx,vy,radius}
Parameters:
Name Type Attributes Description
x Number | Point
y Number <optional>
vx Number <optional>
vy Number <optional>
radius Number <optional>

View Source Entity.js, line 94

Point

addStick(p1, p2, lengthopt, stiffnessopt, ishiddenopt)

adds a stick inbetween two points
Parameters:
Name Type Attributes Description
p1 number | Point
p2 number | Point
length number <optional>
stiffness number <optional>
ishidden boolean <optional>

View Source Entity.js, line 113

pin(index)

pin a specific Point
Parameters:
Name Type Description
index number

View Source Entity.js, line 60

removeSticks(p)

remove a specific Point
Parameters:
Name Type Description
p Point

View Source Entity.js, line 68

renderPointIndex()

View Source Entity.js, line 199

renderPoints()

View Source Entity.js, line 183

renderSticks()

View Source Entity.js, line 191

setFriction(f)

sets the friction of this entity
Parameters:
Name Type Description
f number

View Source Entity.js, line 50

setGravity(g)

sets the gravity of this entity
Parameters:
Name Type Description
g Vector

View Source Entity.js, line 40

setVelocity(x, y)

Parameters:
Name Type Description
x Number
y Number

View Source Entity.js, line 78

updateConstraints()

View Source Entity.js, line 164

updatePoints()

View Source Entity.js, line 146

updateSticks(stepCoefopt)

Parameters:
Name Type Attributes Description
stepCoef Number <optional>

View Source Entity.js, line 156