new Model()
模型对象,此类中包含了模型可见(STATE_UNVISIBLE)与不可见(STATE_VISIBLE)两种常量
Properties:
| Name | Type | Description |
|---|---|---|
State.STATE_UNVISIBLE |
int | 0 - 模型可见性:不可见 |
State.STATE_VISIBLE |
int | 1 - 模型可见性:可见 |
Methods
(async, static) createObj() → {Promise.<Model>}
创建一个新的Model对象
Returns:
- Type
- Promise.<Model>
(async, static) getAngleAroundX() → {float}
获取模型绕x轴旋转的角度
Returns:
角度
- Type
- float
(async, static) getAngleAroundY() → {float}
获取模型绕y轴旋转的角度
Returns:
角度
- Type
- float
(async, static) getAngleAroundZ() → {float}
获取模型绕z轴旋转的角度
Returns:
角度
- Type
- float
(async, static) getName() → {String}
获取名称
Returns:
名称
- Type
- String
(async, static) getPosition() → {Promise.<Dot3D>}
获取模型位置
Returns:
模型位置
- Type
- Promise.<Dot3D>
(async, static) getScaleX() → {double}
获取模型在x轴方向上的缩放比
Returns:
缩放比
- Type
- double
(async, static) getScaleY() → {double}
获取模型在y轴方向上的缩放比
Returns:
缩放比
- Type
- double
(async, static) getScaleZ() → {double}
获取模型在z轴方向上的缩放比
Returns:
缩放比
- Type
- double
(async, static) getState() → {int}
获取图形的可见状态.
Returns:
模型的可见状态 ,取值为STATE_UNVISIBLE和STATE_VISIBLE两种.
- Type
- int
(async, static) isShowBoundingBox() → {boolean}
是否显示包围盒
Returns:
是否显示
- Type
- boolean
(async, static) loadDataFromFile(strModelFile) → {boolean}
从单个模型文件中加载数据(默认格式为mm3d)
Parameters:
| Name | Type | Description |
|---|---|---|
strModelFile |
String | 单个模型文件 |
Returns:
true-成功 ; false-失败
- Type
- boolean
(async, static) saveDataToFile(strModelFile) → {boolean}
保存模型数据到指定的单个模型文件中(默认格式为mm3d)
Parameters:
| Name | Type | Description |
|---|---|---|
strModelFile |
String | 单个模型文件 |
Returns:
true-成功 ; false-失败
- Type
- boolean
(async, static) setAngleAroundX(angle) → {Promise.<Void>}
设置模型绕x轴旋转的角度
Parameters:
| Name | Type | Description |
|---|---|---|
angle |
float | 角度 |
Returns:
- Type
- Promise.<Void>
(async, static) setAngleAroundY(angle) → {Promise.<Void>}
设置模型绕y轴旋转的角度
Parameters:
| Name | Type | Description |
|---|---|---|
angle |
float | 角度 |
Returns:
- Type
- Promise.<Void>
(async, static) setAngleAroundZ(angle) → {Promise.<Void>}
设置模型绕z轴旋转的角度
Parameters:
| Name | Type | Description |
|---|---|---|
angle |
float | 角度 |
Returns:
- Type
- Promise.<Void>
(async, static) setName(name) → {Promise.<Void>}
设置名称
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String | 名称 |
Returns:
- Type
- Promise.<Void>
(async, static) setPosition(position) → {Promise.<Void>}
设置模型位置
Parameters:
| Name | Type | Description |
|---|---|---|
position |
Object | 位置 (Object-Dot3D) |
Returns:
- Type
- Promise.<Void>
(async, static) setScaleX(scale) → {Promise.<Void>}
设置模型在x轴方向上的缩放比
Parameters:
| Name | Type | Description |
|---|---|---|
scale |
double | 缩放比 |
Returns:
- Type
- Promise.<Void>
(async, static) setScaleY(scale) → {Promise.<Void>}
设置模型在y轴方向上的缩放比
Parameters:
| Name | Type | Description |
|---|---|---|
scale |
double | 缩放比 |
Returns:
- Type
- Promise.<Void>
(async, static) setScaleZ(scale) → {Promise.<Void>}
设置模型在z轴方向上的缩放比
Parameters:
| Name | Type | Description |
|---|---|---|
scale |
double | 缩放比 |
Returns:
- Type
- Promise.<Void>
(async, static) setShowBoundingBox(show) → {Promise.<Void>}
设置是否显示包围盒
Parameters:
| Name | Type | Description |
|---|---|---|
show |
boolean | 是否显示包围盒 |
Returns:
- Type
- Promise.<Void>
(async, static) setState(state) → {Promise.<Void>}
设置图形的可见状态.
Parameters:
| Name | Type | Description |
|---|---|---|
state |
int | 模型的可见状态 ,取值为STATE_UNVISIBLE和STATE_VISIBLE两种. |
Returns:
- Type
- Promise.<Void>