Class: SectionObject
剖切对象操作类
Details
开启控制,结束控制,设置位置姿态等
Hierarchy
Callable
↳
SectionObject
Properties
index
• index: undefined
| number
Details
此剖切对象的索引值
type
• type: undefined
| string
Details
此剖切对象的类型
key
• key: undefined
| number
Details
被剖切对象的id
Methods
openControl
▸ openControl(): Promise
<any
>
Details
开启剖切轴控制
Examples
await cloud.getSectioningManager()
let sceManager =await cloud.getSceneManager();
var rootNode = await sceManager.getRootNode3D();//获取根节点
const translation1 = new Vector3(10, 0, 0)
const eulerAngle1 = new Euler(0, 0, 0)
const scaling1 = new Vector3(1, 1, 1)
const trans = new Transform(translation1, eulerAngle1, scaling1)
const state: NodeState = {
color: '0xFF0000',
opacity: 100,
show: true,
}
let obj= await cloud.sectioningManager.addBoxSection(trans,rootNode!,state);
await obj.openControl();
await cloud.getSectioningManager()
let sceManager =await cloud.getSceneManager();
var rootNode = await sceManager.getRootNode3D();//获取根节点
const translation1 = new Vector3(10, 0, 0)
const eulerAngle1 = new Euler(0, 0, 0)
const scaling1 = new Vector3(1, 1, 1)
const trans = new Transform(translation1, eulerAngle1, scaling1)
const state: NodeState = {
color: '0xFF0000',
opacity: 100,
show: true,
}
let obj= await cloud.sectioningManager.addBoxSection(trans,rootNode!,state);
await obj.openControl();
Returns
Promise
<any
>
endControl
▸ endControl(): Promise
<any
>
Details
结束剖切轴控制
Examples
await obj.endControl();
await obj.endControl();
Returns
Promise
<any
>
getSectionInfo
▸ getSectionInfo(): Promise
<Transform
>
Details
获取此剖切盒或面的Transform
Examples
const trans = await obj.getSectionInfo();
const trans = await obj.getSectionInfo();
Returns
Promise
<Transform
>
Transform位置姿态
setSectionInfo
▸ setSectionInfo(trans
): Promise
<any
>
Details
通过Transform设置此剖切面或盒的位置姿态
Examples
const translation1 = new Vector3(10, 0, 0)
const eulerAngle1 = new Euler(0, 0, 0)
const scaling1 = new Vector3(1, 1, 1)
const trans = new Transform(translation1, eulerAngle1, scaling1)
await obj.setSectionInfo(trans);
const translation1 = new Vector3(10, 0, 0)
const eulerAngle1 = new Euler(0, 0, 0)
const scaling1 = new Vector3(1, 1, 1)
const trans = new Transform(translation1, eulerAngle1, scaling1)
await obj.setSectionInfo(trans);
Parameters
Name | Type | Description |
---|---|---|
trans | Transform | 位置姿态(位置,欧拉角,缩放) |
Returns
Promise
<any
>
getType
▸ getType(): undefined
| string
Details
获取此剖切类型
Examples
const type = await obj.getType();
const type = await obj.getType();
Returns
undefined
| string
Plane剖切面或Box剖切盒
getDir
▸ getDir(): Promise
<Vector3
>
Details
获取此剖切面或盒的方向
Examples
const dir = await obj.getDir();
const dir = await obj.getDir();
Returns
Promise
<Vector3
>
dir方向
getSectionShowState
▸ getSectionShowState(): Promise
<boolean
>
Details
获取此剖切面或盒的显示状态
Examples
const state = await obj.getSectionShowState();
const state = await obj.getSectionShowState();
Returns
Promise
<boolean
>
true显示 false隐藏
setSectionShowState
▸ setSectionShowState(isShow
): Promise
<any
>
Details
设置此剖切面或盒的显示状态
Examples
await obj.setSectionShowState(true);
await obj.setSectionShowState(true);
Parameters
Name | Type | Description |
---|---|---|
isShow | boolean | true显示 false隐藏 |
Returns
Promise
<any
>