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

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, p2opt, lengthopt, stiffnessopt, ishiddenopt)

adds a stick inbetween two points
Parameters:
Name Type Attributes Description
p1 number | Stick
p2 number <optional>
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 179

renderPoints()

View Source Entity.js, line 163

renderSticks()

View Source Entity.js, line 171

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 144

updatePoints()

View Source Entity.js, line 126

updateSticks(stepCoefopt)

Parameters:
Name Type Attributes Description
stepCoef Number <optional>

View Source Entity.js, line 136