PlaneHelper

优质
小牛编辑
121浏览
2023-12-01

用于模拟平面 Plane 的辅助对象.

代码示例

const plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 );
const helper = new THREE.PlaneHelper( plane, 1, 0xffff00 );
scene.add( helper );

构造函数

PlaneHelper( plane : Plane, size : Float, hex : Color )

plane -- 被模拟的平面.
size -- (可选的) 辅助对象的单边长度. 默认为 1.
color -- (可选的) 辅助对象的颜色. 默认为 0xffff00.

创建一个线框辅助对象来表示指定平面.

属性

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

.plane : Plane

被模拟的平面 plane .

.size : Float

辅助对象的单边长度.

方法

请到基类 LineSegments 页面查看公共方法.

.updateMatrixWorld ( force : Boolean ) : void

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

源码

src/helpers/PlaneHelper.js