Options
All
  • Public
  • Public/Protected
  • All
Menu

Module primitive

Index

References

IGeometry

Re-exports IGeometry

IGeometryOptions

Re-exports IGeometryOptions

applyDefaultGeometryOptions

Re-exports applyDefaultGeometryOptions

box

Re-exports box

capsule

Re-exports capsule

circle

Re-exports circle

cone

Re-exports cone

cylinder

Re-exports cylinder

invWinding

Re-exports invWinding

normals

Re-exports normals

plane

Re-exports plane

quad

Re-exports quad

scale

Re-exports scale

sphere

Re-exports sphere

toWavefrontOBJ

Re-exports toWavefrontOBJ

torus

Re-exports torus

translate

Re-exports translate

wireframe

Re-exports wireframe

wireframed

Re-exports wireframed

Type aliases

IConeOptions

IConeOptions: ICylinderOptions

Variables

Const c0

c0: Vec3 = new Vec3()

Const c00

c00: Vec3 = new Vec3(0, 0, 0)

Const c01

c01: Vec3 = new Vec3(0, 0, 0)

Const c1

c1: Vec3 = new Vec3()

Const c10

c10: Vec3 = new Vec3(0, 0, 0)

Const c2

c2: Vec3 = new Vec3()

Const c3

c3: Vec3 = new Vec3()

Const c4

c4: Vec3 = new Vec3()

Const c5

c5: Vec3 = new Vec3()

Const c6

c6: Vec3 = new Vec3()

Const c7

c7: Vec3 = new Vec3()

Const r

r: Vec3 = new Vec3()

Const r

r: Vec3 = new Vec3(0, 0, 0)

Const temp1

temp1: Vec3 = new Vec3(0, 0, 0)

Const temp1

temp1: Vec3 = new Vec3(0, 0, 0)

Const temp1

temp1: Vec3 = new Vec3(0, 0, 0)

Const temp1

temp1: Vec3 = new Vec3()

Const temp2

temp2: Vec3 = new Vec3(0, 0, 0)

Const temp2

temp2: Vec3 = new Vec3()

Const temp2

temp2: Vec3 = new Vec3(0, 0, 0)

Const temp2

temp2: Vec3 = new Vec3(0, 0, 0)

Const temp3

temp3: Vec3 = new Vec3()

Const temp3

temp3: Vec3 = new Vec3(0, 0, 0)

Functions

applyDefaultCircleOptions

applyDefaultGeometryOptions

  • applyDefaultGeometryOptions<GeometryOptions>(options?: RecursivePartial<IGeometryOptions>): GeometryOptions

applyDefaultPlaneOptions

box

capsule

  • capsule(radiusTop?: number, radiusBottom?: number, height?: number, opts?: RecursivePartial<ICapsuteOptions>): { boundingRadius: number; indices: number[]; maxPos: Vec3; minPos: Vec3; normals: number[]; positions: number[]; uvs: number[] }
  • Generate a capsule with radiusTop radiusBottom 0.5, height 2, centered at origin, but may be repositioned through the center option.

    生成一个胶囊体。

    Parameters

    • Default value radiusTop: number = 0.5

      顶部半径。

    • Default value radiusBottom: number = 0.5

      底部半径。

    • Default value height: number = 2
    • Default value opts: RecursivePartial<ICapsuteOptions> = {}

      胶囊体参数选项。

    Returns { boundingRadius: number; indices: number[]; maxPos: Vec3; minPos: Vec3; normals: number[]; positions: number[]; uvs: number[] }

    • boundingRadius: number
    • indices: number[]
    • maxPos: Vec3
    • minPos: Vec3
    • normals: number[]
    • positions: number[]
    • uvs: number[]

circle

cone

  • 生成一个圆锥。

    Parameters

    • Default value radius: number = 0.5

      圆锥半径。

    • Default value height: number = 1

      圆锥高度。

    • Default value opts: RecursivePartial<IConeOptions> = {}

      圆锥参数选项。

    Returns IGeometry

cylinder

  • 生成一个圆柱。

    Parameters

    • Default value radiusTop: number = 0.5

      顶部半径。

    • Default value radiusBottom: number = 0.5

      底部半径。

    • Default value height: number = 2
    • Default value opts: RecursivePartial<ICylinderOptions> = {}

      圆柱参数选项。

    Returns IGeometry

invWinding

  • invWinding(indices: number[]): number[]

normals

  • normals(positions: number[], nms: number[], length?: number): any[]
  • deprecated

    Parameters

    • positions: number[]
    • nms: number[]
    • Default value length: number = 1

    Returns any[]

plane

quad

scale

  • scale(geometry: IGeometry, value: { x?: undefined | number; y?: undefined | number; z?: undefined | number }): IGeometry
  • 缩放几何体。

    Parameters

    • geometry: IGeometry

      几何体信息。

    • value: { x?: undefined | number; y?: undefined | number; z?: undefined | number }

      缩放量。

      • Optional x?: undefined | number
      • Optional y?: undefined | number
      • Optional z?: undefined | number

    Returns IGeometry

sphere

toWavefrontOBJ

  • toWavefrontOBJ(primitive: IGeometry, scale?: number): string

torus

  • torus(radius?: number, tube?: number, opts?: RecursivePartial<ITorusOptions>): { boundingRadius: number; indices: number[]; maxPos: Vec3; minPos: Vec3; normals: number[]; positions: number[]; uvs: number[] }
  • 生成一个环面。

    Parameters

    • Default value radius: number = 0.4

      环面半径。

    • Default value tube: number = 0.1

      管形大小。

    • Default value opts: RecursivePartial<ITorusOptions> = {}

      参数选项。

    Returns { boundingRadius: number; indices: number[]; maxPos: Vec3; minPos: Vec3; normals: number[]; positions: number[]; uvs: number[] }

    • boundingRadius: number
    • indices: number[]
    • maxPos: Vec3
    • minPos: Vec3
    • normals: number[]
    • positions: number[]
    • uvs: number[]

translate

  • translate(geometry: IGeometry, offset: { x?: undefined | number; y?: undefined | number; z?: undefined | number }): IGeometry
  • 平移几何体。

    Parameters

    • geometry: IGeometry

      几何体信息。

    • offset: { x?: undefined | number; y?: undefined | number; z?: undefined | number }

      偏移量。

      • Optional x?: undefined | number
      • Optional y?: undefined | number
      • Optional z?: undefined | number

    Returns IGeometry

wireframe

  • wireframe(indices: number[]): number[]

wireframed

Generated using TypeDoc