Skip to content

@simversus/yjvis


@simversus/yjvis / math / Plane

Class: Plane ​

Defined in: math/Plane.ts:10

Constructors ​

Constructor ​

new Plane(): Plane

Returns ​

Plane

Properties ​

constant ​

constant: number = 0

Defined in: math/Plane.ts:14

原点到平面的有符号距离


normal ​

normal: Vec3

Defined in: math/Plane.ts:12

平面法向量

Methods ​

applyMatrix4() ​

applyMatrix4(matrix, optionalNormalMatrix?): Plane

Defined in: math/Plane.ts:52

应用矩阵变换到平面

Parameters ​

matrix ​

Mat4

变换矩阵

optionalNormalMatrix? ​

Mat3

可选的法线矩阵。如果未提供,将根据变换矩阵计算。

Returns ​

Plane

this


coplanarPoint() ​

coplanarPoint(target): Vec3

Defined in: math/Plane.ts:42

获取平面上的一个共面点

Parameters ​

target ​

Vec3

目标向量,用于存储结果

Returns ​

Vec3

共面点向量 (normal * -constant)


copy() ​

copy(plane): Plane

Defined in: math/Plane.ts:65

复制另一个平面的数据

Parameters ​

plane ​

Plane

源平面

Returns ​

Plane

this


distanceToPoint() ​

distanceToPoint(point): number

Defined in: math/Plane.ts:33

计算点到平面的有符号距离

Parameters ​

point ​

Vec3

目标点

Returns ​

number

距离值。正值表示在法线指向的一侧,负值表示在背面。


setFromNormalAndCoplanarPoint() ​

setFromNormalAndCoplanarPoint(normal, point): Plane

Defined in: math/Plane.ts:22

通过法向量和平面上的一点设置平面

Parameters ​

normal ​

Vec3

平面法向量

point ​

Vec3

平面上的一点

Returns ​

Plane

this