Object3DLineLineSegments

Box3Helper

模拟3维包围盒 Box3 的辅助对象.

代码示例

const box = new v3d.Box3(); box.setFromCenterAndSize(new v3d.Vector3(1, 1, 1), new v3d.Vector3(2, 1, 3)); const helper = new v3d.Box3Helper(box, 0xffff00); scene.add(helper);

构造函数

Box3Helper(box : Box3, color : Color)

box -- 被模拟的3维包围盒.
color -- (可选的) 线框盒子的颜色. 默认为 0xffff00.

创建一个新的线框盒子用以表示指定的3维包围盒.

属性

请到基类 LineSegments 页面查看公共属性.

.box : Box3

被模拟的3维包围盒.

方法

请到基类 LineSegments 页面查看其常用方法.

.updateMatrixWorld(force : Boolean) → void

重写基类 Object3D 的该方法以便于 同时更新线框辅助对象与 .box 属性保持一致.

源码

src/helpers/Box3Helper.js