Options
All
  • Public
  • Public/Protected
  • All
Menu

Module particle2d

Index

Variables

Const DURATION_INFINITY

DURATION_INFINITY: -1 = -1
en

The Particle emitter lives forever.

zh

表示发射器永久存在

static
readonly

Const EmitterMode

EmitterMode: { GRAVITY: number; RADIUS: number } = Enum({/*** @en Uses gravity, speed, radial and tangential acceleration.* @zh 重力模式,模拟重力,可让粒子围绕一个中心点移近或移远。*/GRAVITY: 0,/*** @en Uses radius movement + rotation.* @zh 半径模式,可以使粒子以圆圈方式旋转,它也可以创造螺旋效果让粒子急速前进或后退。*/RADIUS: 1,})
en

Enum for emitter modes

zh

发射模式

Type declaration

  • GRAVITY: number
    en

    Uses gravity, speed, radial and tangential acceleration.

    zh

    重力模式,模拟重力,可让粒子围绕一个中心点移近或移远。

  • RADIUS: number
    en

    Uses radius movement + rotation.

    zh

    半径模式,可以使粒子以圆圈方式旋转,它也可以创造螺旋效果让粒子急速前进或后退。

Const PositionType

PositionType: { FREE: number; GROUPED: number; RELATIVE: number } = Enum({/*** @en* Living particles are attached to the world and are unaffected by emitter repositioning.* @zh* 自由模式,相对于世界坐标,不会随粒子节点移动而移动。(可产生火焰、蒸汽等效果)*/FREE: 0,/*** @en* In the relative mode, the particle will move with the parent node, but not with the node where the particle is.* For example, the coffee in the cup is steaming. Then the steam moves (forward) with the train, rather than moves with the cup.* @zh* 相对模式,粒子会跟随父节点移动,但不跟随粒子所在节点移动,例如在一列行进火车中,杯中的咖啡飘起雾气,* 杯子移动,雾气整体并不会随着杯子移动,但从火车整体的角度来看,雾气整体会随着火车移动。*/RELATIVE: 1,/*** @en* Living particles are attached to the emitter and are translated along with it.* @zh* 整组模式,粒子跟随发射器移动。(不会发生拖尾)*/GROUPED: 2,})
en

Enum for particles movement type.

zh

粒子位置类型

Type declaration

  • FREE: number
    en

    Living particles are attached to the world and are unaffected by emitter repositioning.

    zh

    自由模式,相对于世界坐标,不会随粒子节点移动而移动。(可产生火焰、蒸汽等效果)

  • GROUPED: number
    en

    Living particles are attached to the emitter and are translated along with it.

    zh

    整组模式,粒子跟随发射器移动。(不会发生拖尾)

  • RELATIVE: number
    en

    In the relative mode, the particle will move with the parent node, but not with the node where the particle is. For example, the coffee in the cup is steaming. Then the steam moves (forward) with the train, rather than moves with the cup.

    zh

    相对模式,粒子会跟随父节点移动,但不跟随粒子所在节点移动,例如在一列行进火车中,杯中的咖啡飘起雾气, 杯子移动,雾气整体并不会随着杯子移动,但从火车整体的角度来看,雾气整体会随着火车移动。

Const START_RADIUS_EQUAL_TO_END_RADIUS

START_RADIUS_EQUAL_TO_END_RADIUS: -1 = -1
en

The starting radius of the particle is equal to the ending radius.

zh

表示粒子的起始半径等于结束半径。

static
readonly

Const START_SIZE_EQUAL_TO_END_SIZE

START_SIZE_EQUAL_TO_END_SIZE: -1 = -1
en

The starting size of the particle is equal to the ending size.

zh

表示粒子的起始大小等于结束大小。

static
readonly

Const ZERO_VEC2

ZERO_VEC2: Vec2 = new Vec2(0, 0)

Const _normal

_normal: Vec2 = new Vec2()

Const _pos

_pos: Vec2 = new Vec2()

Const _tangent

_tangent: Vec2 = new Vec2()

Const _tpa

_tpa: Vec2 = new Vec2()

Const _tpb

_tpb: Vec2 = new Vec2()

Const _tpc

_tpc: Vec2 = new Vec2()

Const _vec2

_vec2: Vec2 = new Vec2()

Const formatBytes

formatBytes: number = getComponentPerVertex(vfmtPosUvColor)

Const pool

pool: ParticlePool = new ParticlePool((par: Particle) => {par.pos.set(ZERO_VEC2);par.startPos.set(ZERO_VEC2);par.color._val = 0xFF000000;par.deltaColor.r = par.deltaColor.g = par.deltaColor.b = 0;par.deltaColor.a = 255;par.size = 0;par.deltaSize = 0;par.rotation = 0;par.deltaRotation = 0;par.timeToLive = 0;par.drawPos.set(ZERO_VEC2);par.aspectRatio = 1;// Mode Apar.dir.set(ZERO_VEC2);par.radialAccel = 0;par.tangentialAccel = 0;// Mode Bpar.angle = 0;par.degreesPerSecond = 0;par.radius = 0;par.deltaRadius = 0;}, 1024)

Functions

computeMiter

  • computeMiter(miter: any, lineA: any, lineB: any, halfThick: any, maxMultiple: any): number

getImageFormatByData

getParticleComponents

getWorldRotation

  • getWorldRotation(node: any): number

normal

Object literals

Const MotionStreakAssembler

MotionStreakAssembler: object

createData

fillBuffers

  • fillBuffers(comp: MotionStreak, renderer: Batcher2D): void

update

updateRenderData

Const MotionStreakAssemblerManager

MotionStreakAssemblerManager: object

getAssembler

Const ParticleAssembler

ParticleAssembler: object

maxParticleDeltaTime

maxParticleDeltaTime: number = 0

createData

fillBuffers

updateRenderData

  • updateRenderData(): void

Const ParticleSystem2DAssembler

ParticleSystem2DAssembler: object

getAssembler

Const fieldTagNames

fieldTagNames: object

254

254: string = "NewSubfileType"

255

255: string = "SubfileType"

256

256: string = "ImageWidth"

257

257: string = "ImageLength"

258

258: string = "BitsPerSample"

259

259: string = "Compression"

262

262: string = "PhotometricInterpretation"

263

263: string = "Threshholding"

264

264: string = "CellWidth"

265

265: string = "CellLength"

266

266: string = "FillOrder"

269

269: string = "DocumentName"

270

270: string = "ImageDescription"

271

271: string = "Make"

272

272: string = "Model"

273

273: string = "StripOffsets"

274

274: string = "Orientation"

277

277: string = "SamplesPerPixel"

278

278: string = "RowsPerStrip"

279

279: string = "StripByteCounts"

280

280: string = "MinSampleValue"

281

281: string = "MaxSampleValue"

282

282: string = "XResolution"

283

283: string = "YResolution"

284

284: string = "PlanarConfiguration"

285

285: string = "PageName"

286

286: string = "XPosition"

287

287: string = "YPosition"

288

288: string = "FreeOffsets"

289

289: string = "FreeByteCounts"

290

290: string = "GrayResponseUnit"

291

291: string = "GrayResponseCurve"

292

292: string = "T4Options"

293

293: string = "T6Options"

296

296: string = "ResolutionUnit"

297

297: string = "PageNumber"

301

301: string = "TransferFunction"

305

305: string = "Software"

306

306: string = "DateTime"

315

315: string = "Artist"

316

316: string = "HostComputer"

317

317: string = "Predictor"

318

318: string = "WhitePoint"

319

319: string = "PrimaryChromaticities"

320

320: string = "ColorMap"

321

321: string = "HalftoneHints"

322

322: string = "TileWidth"

323

323: string = "TileLength"

324

324: string = "TileOffsets"

325

325: string = "TileByteCounts"

326

326: string = "BadFaxLines"

327

327: string = "CleanFaxData"

328

328: string = "ConsecutiveBadFaxLines"

330

330: string = "SubIFDs"

33432

33432: string = "Copyright"

33434

33434: string = "ExposureTime"

33437

33437: string = "FNumber"

336

336: string = "DotRange"

33723

33723: string = "IPTC"

338

338: string = "ExtraSamples"

339

339: string = "SampleFormat"

343

343: string = "ClipPath"

34377

34377: string = "Photoshop"

344

344: string = "XClipPathUnits"

345

345: string = "YClipPathUnits"

346

346: string = "Indexed"

34665

34665: string = "Exif IFD"

34675

34675: string = "ICC Profile"

347

347: string = "JPEGTables"

36864

36864: string = "ExifVersion"

36867

36867: string = "DateTimeOriginal"

36868

36868: string = "DateTimeDigitized"

37377

37377: string = "ShutterSpeedValue"

37378

37378: string = "ApertureValue"

37384

37384: string = "LightSource"

37385

37385: string = "Flash"

37500

37500: string = "MakerNote"

37510

37510: string = "UserComment"

40960

40960: string = "FlashpixVersion"

40961

40961: string = "ColorSpace"

41728

41728: string = "FileSource"

42016

42016: string = "ImageUniqueID"

42112

42112: string = "GDAL_METADATA"

42113

42113: string = "GDAL_NODATA"

433

433: string = "Decode"

434

434: string = "DefaultImageColor"

529

529: string = "YCbCrCoefficients"

530

530: string = "YCbCrSubSampling"

531

531: string = "YCbCrPositioning"

532

532: string = "ReferenceBlackWhite"

559

559: string = "StripRowCounts"

700

700: string = "XMP"

Const fieldTypeNames

fieldTypeNames: object

1

1: string = "BYTE"

10

10: string = "SRATIONAL"

11

11: string = "FLOAT"

12

12: string = "DOUBLE"

2

2: string = "ASCII"

3

3: string = "SHORT"

4

4: string = "LONG"

5

5: string = "RATIONAL"

6

6: string = "SBYTE"

7

7: string = "UNDEFINED"

8

8: string = "SSHORT"

9

9: string = "SLONG"

Generated using TypeDoc