mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 00:22:43 +08:00
4bc2739786
* Vmath (#4895) * vmath refactor * value-type API change * vmath change update * conflict fix * value types change * translate modify (#4917) * value types bug fixed (#4940) * playground update (#4946) * bug fixed * bug fixed * bug fixed * bug fix * util modify * create remove & ccenum rename * export by cc.math * Rename value-types to math * util funtion deprecated warn * value-types change * color test fix * color API change
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
/**
|
|
* @hidden
|
|
*/
|
|
|
|
import { Color, Vec3 } from '../../../core/math';
|
|
import { ParticleSystemComponent } from './particle-system-component';
|
|
|
|
export default class Particle {
|
|
public particleSystem: ParticleSystemComponent;
|
|
public position: Vec3;
|
|
public velocity: Vec3;
|
|
public animatedVelocity: Vec3;
|
|
public ultimateVelocity: Vec3;
|
|
public angularVelocity: Vec3;
|
|
public axisOfRotation: Vec3;
|
|
public rotation: Vec3;
|
|
public startSize: Vec3;
|
|
public size: Vec3;
|
|
public startColor: Color;
|
|
public color = cc.Color.WHITE;
|
|
public randomSeed: number; // uint
|
|
public remainingLifetime: number;
|
|
public startLifetime: number;
|
|
public emitAccumulator0: number;
|
|
public emitAccumulator1: number;
|
|
public frameIndex: number;
|
|
|
|
constructor (particleSystem: any) {
|
|
this.particleSystem = particleSystem;
|
|
this.position = new Vec3(0, 0, 0);
|
|
this.velocity = new Vec3(0, 0, 0);
|
|
this.animatedVelocity = new Vec3(0, 0, 0);
|
|
this.ultimateVelocity = new Vec3(0, 0, 0);
|
|
this.angularVelocity = new Vec3(0, 0, 0);
|
|
this.axisOfRotation = new Vec3(0, 0, 0);
|
|
this.rotation = new Vec3(0, 0, 0);
|
|
this.startSize = new Vec3(0, 0, 0);
|
|
this.size = new Vec3(0, 0, 0);
|
|
this.startColor = cc.Color.WHITE;
|
|
this.color = cc.Color.WHITE;
|
|
this.randomSeed = 0; // uint
|
|
this.remainingLifetime = 0.0;
|
|
this.startLifetime = 0.0;
|
|
this.emitAccumulator0 = 0.0;
|
|
this.emitAccumulator1 = 0.0;
|
|
this.frameIndex = 0.0;
|
|
}
|
|
}
|