feat: sprite 粒子增加运动边界参数 spriteBottom (#1174)

* feat: 去处事件节流

* feat: sprite 补充参数
This commit is contained in:
YiQianYao 2022-06-22 10:59:32 +08:00 committed by GitHub
parent 8ee39b63c3
commit c8720ebda5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View File

@ -66,8 +66,12 @@ export default class SpriteModel extends BaseModel {
}
public planeGeometryUpdateTriangulation = () => {
const {
spriteBottom = -100000,
} = this.layer.getLayerConfig() as IGeometryLayerStyleOptions;
const updateZ = this.spriteUpdate;
const bottomZ = -100000;
// const bottomZ = -100000;
const bottomZ = spriteBottom;
const topZ = this.spriteTop;
for (let i = 0; i < this.positions.length; i += 5) {

View File

@ -183,6 +183,7 @@ export interface IGeometryLayerStyleOptions {
spriteCount?: number;
spriteSpeed?: number;
spriteTop?: number;
spriteBottom?: number;
spriteUpdate?: number;
spriteScale?: number;

View File

@ -33,9 +33,9 @@ export default class Demo extends React.Component {
// },
// })
.shape('sprite')
.size(10)
.size(20)
.style({
opacity: 0.3,
// opacity: 0.3,
mapTexture:
'https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*zLQwQKBSagYAAAAAAAAAAAAAARQnAQ', // snow
// mapTexture: 'https://gw.alipayobjects.com/mdn/rms_816329/afts/img/A*w2SFSZJp4nIAAAAAAAAAAAAAARQnAQ', // rain
@ -45,10 +45,13 @@ export default class Demo extends React.Component {
spriteCount: 60,
spriteRadius: 10,
spriteTop: 2500000,
// spriteTop: 1000000,
// spriteScale: 0.8,
spriteScale: 0.6,
// spriteUpdate: 20000
spriteUpdate: 10000,
spriteScale: 0.8,
// spriteTop: 1000,
// spriteUpdate: 5,
// spriteBottom: -10,
// spriteScale: 0.6,
})
.active(true)
.color('#f00');