geomUtils.Line Class
Module: cc
line
Index
Properties
Methods
createcreate a new linecloneCreates a new line initialized with values from an existing linecopyCopy the values from one line to anotherfromPointscreate a line from two pointssetSet the components of a Vec3 to the given valueslenCalculate the length of the line.lengthCalculate the length of the line.
Details
Properties
s
Start points.
| meta | description |
|---|---|
| Type | Vec3 |
| Defined in | cocos2d/core/geom-utils/line.ts:147 |
e
End points.
| meta | description |
|---|---|
| Type | Vec3 |
| Defined in | cocos2d/core/geom-utils/line.ts:156 |
Methods
create
create a new line
| meta | description |
|---|---|
| Returns | Line |
| Defined in | cocos2d/core/geom-utils/line.ts:40 |
Parameters
sxNumber The x part of the starting point.syNumber The y part of the starting point.szNumber The z part of the starting point.exNumber The x part of the end point.eyNumber The y part of the end point.ezNumber The z part of the end point.
clone
Creates a new line initialized with values from an existing line
| meta | description |
|---|---|
| Returns | Line |
| Defined in | cocos2d/core/geom-utils/line.ts:58 |
Parameters
aLine The source of cloning.
copy
Copy the values from one line to another
| meta | description |
|---|---|
| Returns | Line |
| Defined in | cocos2d/core/geom-utils/line.ts:74 |
Parameters
outLine The object that accepts the action.aLine The source of the copy.
fromPoints
create a line from two points
| meta | description |
|---|---|
| Returns | Line |
| Defined in | cocos2d/core/geom-utils/line.ts:91 |
Parameters
set
Set the components of a Vec3 to the given values
| meta | description |
|---|---|
| Returns | Line |
| Defined in | cocos2d/core/geom-utils/line.ts:108 |
Parameters
outLine The object that accepts the action.sxNumber The x part of the starting point.syNumber The y part of the starting point.szNumber The z part of the starting point.exNumber The x part of the end point.eyNumber The y part of the end point.ezNumber The z part of the end point.
len
Calculate the length of the line.
| meta | description |
|---|---|
| Returns | Number |
| Defined in | cocos2d/core/geom-utils/line.ts:134 |
Parameters
aLine The line to calculate.
length
Calculate the length of the line.
| meta | description |
|---|---|
| Returns | Number |
| Defined in | cocos2d/core/geom-utils/line.ts:184 |