Constructor
new Entity(iterations, verlyInstance)
Parameters:
Name | Type | Description |
---|---|---|
iterations |
number | |
verlyInstance |
Verly |
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 |
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> |
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> |
pin(index)
pin a specific Point
Parameters:
Name | Type | Description |
---|---|---|
index |
number |
render()
renderPointIndex()
renderPoints()
renderSticks()
setFriction(f)
sets the friction of this entity
Parameters:
Name | Type | Description |
---|---|---|
f |
number |
setVelocity(x, y)
Parameters:
Name | Type | Description |
---|---|---|
x |
Number | |
y |
Number |
update()
updateConstraints()
updatePoints()
updateSticks(stepCoefopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
stepCoef |
Number |
<optional> |