Skip to content

Commit

Permalink
change particle default params (cocos#5252)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxg0622 authored and jerrywwl committed Aug 27, 2019
1 parent 888af3d commit 07a31c1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
7 changes: 1 addition & 6 deletions cocos/3d/framework/particle/animator/rotation-overtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ export default class RotationOvertimeModule {
}

set separateAxes (val) {
if (!val) {
this._separateAxes = val;
}
else {
console.error('rotation overtime separateAxes is not supported!');
}
this._separateAxes = val;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions cocos/3d/framework/particle/emitter/shape-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class ShapeModule {
@property({
displayOrder: 0,
})
public enable = false;
public enable = true;

/**
* @zh 粒子发射器类型 [[ShapeType]]。
Expand All @@ -105,7 +105,7 @@ export default class ShapeModule {
type: ShapeType,
displayOrder: 1,
})
public shapeType = ShapeType.Box;
public shapeType = ShapeType.Cone;

/**
* @zh 粒子从发射器哪个部位发射 [[EmitLocation]]。
Expand Down Expand Up @@ -182,7 +182,7 @@ export default class ShapeModule {
@property({
displayOrder: 9,
})
public arcSpread = 8;
public arcSpread = 0;

/**
* @zh 粒子沿圆周发射的速度。
Expand All @@ -200,7 +200,7 @@ export default class ShapeModule {
@property({
displayOrder: 11,
})
public length = 0;
public length = 5;

/**
* @zh 粒子发射器发射位置(针对 Box 类型的粒子发射器)。
Expand Down
4 changes: 2 additions & 2 deletions cocos/3d/framework/particle/particle-system-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export class ParticleSystemComponent extends RenderableComponent {
this.rateOverTime.constant = 10;
this.startLifetime.constant = 5;
this.startSize.constant = 1;
this.startSpeed.constant = 1;
this.startSpeed.constant = 5;

// internal status
this._isPlaying = false;
Expand Down Expand Up @@ -601,7 +601,7 @@ export class ParticleSystemComponent extends RenderableComponent {
}
Vec3.copy(particle.ultimateVelocity, particle.velocity);
// apply startRotation. now 2D only.
Vec3.set(particle.rotation, this.startRotation.evaluate(this._time / this.duration, rand)!, 0, 0);
Vec3.set(particle.rotation, 0, 0, this.startRotation.evaluate(this._time / this.duration, rand)!);

// apply startSize. now 2D only.
Vec3.set(particle.startSize, this.startSize.evaluate(this._time / this.duration, rand)!, 1, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ export default class ParticleSystemRenderer {
this.attrs[attrNum++] = _tempAttribUV;
this.attrs[attrNum++] = p.size;
this.attrs[attrNum++] = p.rotation;
this.attrs[attrNum++] = _tempAttribUV0;
this.attrs[attrNum++] = p.color._val;
this._model!.addParticleVertexData(i, this.attrs);
}
Expand Down
4 changes: 2 additions & 2 deletions cocos/renderer/models/particle-batch-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ export default class ParticleBatchModel extends Model {
this._vdataF32![offset++] = pvdata[2].x; // size
this._vdataF32![offset++] = pvdata[2].y;
this._vdataF32![offset++] = pvdata[2].z;
this._vdataF32![offset++] = pvdata[3].z; // rotation
this._vdataF32![offset++] = pvdata[3].z;
this._vdataF32![offset++] = pvdata[3].x; // rotation
this._vdataF32![offset++] = pvdata[3].y;
this._vdataF32![offset++] = pvdata[3].z;
this._vdataUint32![offset++] = pvdata[4]; // color
if (pvdata[5]) {
Expand Down

0 comments on commit 07a31c1

Please sign in to comment.