1 /** 2 Particle properties for $(D Particles) and $(D Particles2D) nodes. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.particlesmaterial; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.material; 25 import godot.resource; 26 import godot.texture; 27 import godot.gradienttexture; 28 import godot.curvetexture; 29 /** 30 Particle properties for $(D Particles) and $(D Particles2D) nodes. 31 32 ParticlesMaterial defines particle properties and behavior. It is used in the `process_material` of $(D Particles) and $(D Particles2D) emitter nodes. 33 Some of this material's properties are applied to each particle when emitted, while others can have a $(D CurveTexture) applied to vary values over the lifetime of the particle. 34 When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between `1.0` and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of `0.4` would scale the original property between `0.4-1.0` of its original value. 35 */ 36 @GodotBaseClass struct ParticlesMaterial 37 { 38 package(godot) enum string _GODOT_internal_name = "ParticlesMaterial"; 39 public: 40 @nogc nothrow: 41 union { /** */ godot_object _godot_object; /** */ Material _GODOT_base; } 42 alias _GODOT_base this; 43 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 44 package(godot) __gshared bool _classBindingInitialized = false; 45 package(godot) static struct GDNativeClassBinding 46 { 47 __gshared: 48 @GodotName("get_color") GodotMethod!(Color) getColor; 49 @GodotName("get_color_ramp") GodotMethod!(Texture) getColorRamp; 50 @GodotName("get_direction") GodotMethod!(Vector3) getDirection; 51 @GodotName("get_emission_box_extents") GodotMethod!(Vector3) getEmissionBoxExtents; 52 @GodotName("get_emission_color_texture") GodotMethod!(Texture) getEmissionColorTexture; 53 @GodotName("get_emission_normal_texture") GodotMethod!(Texture) getEmissionNormalTexture; 54 @GodotName("get_emission_point_count") GodotMethod!(long) getEmissionPointCount; 55 @GodotName("get_emission_point_texture") GodotMethod!(Texture) getEmissionPointTexture; 56 @GodotName("get_emission_shape") GodotMethod!(ParticlesMaterial.EmissionShape) getEmissionShape; 57 @GodotName("get_emission_sphere_radius") GodotMethod!(double) getEmissionSphereRadius; 58 @GodotName("get_flag") GodotMethod!(bool, long) getFlag; 59 @GodotName("get_flatness") GodotMethod!(double) getFlatness; 60 @GodotName("get_gravity") GodotMethod!(Vector3) getGravity; 61 @GodotName("get_lifetime_randomness") GodotMethod!(double) getLifetimeRandomness; 62 @GodotName("get_param") GodotMethod!(double, long) getParam; 63 @GodotName("get_param_randomness") GodotMethod!(double, long) getParamRandomness; 64 @GodotName("get_param_texture") GodotMethod!(Texture, long) getParamTexture; 65 @GodotName("get_spread") GodotMethod!(double) getSpread; 66 @GodotName("get_trail_color_modifier") GodotMethod!(GradientTexture) getTrailColorModifier; 67 @GodotName("get_trail_divisor") GodotMethod!(long) getTrailDivisor; 68 @GodotName("get_trail_size_modifier") GodotMethod!(CurveTexture) getTrailSizeModifier; 69 @GodotName("set_color") GodotMethod!(void, Color) setColor; 70 @GodotName("set_color_ramp") GodotMethod!(void, Texture) setColorRamp; 71 @GodotName("set_direction") GodotMethod!(void, Vector3) setDirection; 72 @GodotName("set_emission_box_extents") GodotMethod!(void, Vector3) setEmissionBoxExtents; 73 @GodotName("set_emission_color_texture") GodotMethod!(void, Texture) setEmissionColorTexture; 74 @GodotName("set_emission_normal_texture") GodotMethod!(void, Texture) setEmissionNormalTexture; 75 @GodotName("set_emission_point_count") GodotMethod!(void, long) setEmissionPointCount; 76 @GodotName("set_emission_point_texture") GodotMethod!(void, Texture) setEmissionPointTexture; 77 @GodotName("set_emission_shape") GodotMethod!(void, long) setEmissionShape; 78 @GodotName("set_emission_sphere_radius") GodotMethod!(void, double) setEmissionSphereRadius; 79 @GodotName("set_flag") GodotMethod!(void, long, bool) setFlag; 80 @GodotName("set_flatness") GodotMethod!(void, double) setFlatness; 81 @GodotName("set_gravity") GodotMethod!(void, Vector3) setGravity; 82 @GodotName("set_lifetime_randomness") GodotMethod!(void, double) setLifetimeRandomness; 83 @GodotName("set_param") GodotMethod!(void, long, double) setParam; 84 @GodotName("set_param_randomness") GodotMethod!(void, long, double) setParamRandomness; 85 @GodotName("set_param_texture") GodotMethod!(void, long, Texture) setParamTexture; 86 @GodotName("set_spread") GodotMethod!(void, double) setSpread; 87 @GodotName("set_trail_color_modifier") GodotMethod!(void, GradientTexture) setTrailColorModifier; 88 @GodotName("set_trail_divisor") GodotMethod!(void, long) setTrailDivisor; 89 @GodotName("set_trail_size_modifier") GodotMethod!(void, CurveTexture) setTrailSizeModifier; 90 } 91 /// 92 pragma(inline, true) bool opEquals(in ParticlesMaterial other) const 93 { return _godot_object.ptr is other._godot_object.ptr; } 94 /// 95 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 96 { _godot_object.ptr = n; return null; } 97 /// 98 pragma(inline, true) bool opEquals(typeof(null) n) const 99 { return _godot_object.ptr is n; } 100 /// 101 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 102 mixin baseCasts; 103 /// Construct a new instance of ParticlesMaterial. 104 /// Note: use `memnew!ParticlesMaterial` instead. 105 static ParticlesMaterial _new() 106 { 107 static godot_class_constructor constructor; 108 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("ParticlesMaterial"); 109 if(constructor is null) return typeof(this).init; 110 return cast(ParticlesMaterial)(constructor()); 111 } 112 @disable new(size_t s); 113 /// 114 enum Flags : int 115 { 116 /** 117 Use with $(D setFlag) to set $(D flagAlignY). 118 */ 119 flagAlignYToVelocity = 0, 120 /** 121 Use with $(D setFlag) to set $(D flagRotateY). 122 */ 123 flagRotateY = 1, 124 /** 125 Use with $(D setFlag) to set $(D flagDisableZ). 126 */ 127 flagDisableZ = 2, 128 /** 129 Represents the size of the $(D flags) enum. 130 */ 131 flagMax = 3, 132 } 133 /// 134 enum EmissionShape : int 135 { 136 /** 137 All particles will be emitted from a single point. 138 */ 139 emissionShapePoint = 0, 140 /** 141 Particles will be emitted in the volume of a sphere. 142 */ 143 emissionShapeSphere = 1, 144 /** 145 Particles will be emitted in the volume of a box. 146 */ 147 emissionShapeBox = 2, 148 /** 149 Particles will be emitted at a position determined by sampling a random point on the $(D emissionPointTexture). Particle color will be modulated by $(D emissionColorTexture). 150 */ 151 emissionShapePoints = 3, 152 /** 153 Particles will be emitted at a position determined by sampling a random point on the $(D emissionPointTexture). Particle velocity and rotation will be set based on $(D emissionNormalTexture). Particle color will be modulated by $(D emissionColorTexture). 154 */ 155 emissionShapeDirectedPoints = 4, 156 /** 157 Represents the size of the $(D emissionshape) enum. 158 */ 159 emissionShapeMax = 5, 160 } 161 /// 162 enum Parameter : int 163 { 164 /** 165 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set initial velocity properties. 166 */ 167 paramInitialLinearVelocity = 0, 168 /** 169 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set angular velocity properties. 170 */ 171 paramAngularVelocity = 1, 172 /** 173 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set orbital velocity properties. 174 */ 175 paramOrbitVelocity = 2, 176 /** 177 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set linear acceleration properties. 178 */ 179 paramLinearAccel = 3, 180 /** 181 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set radial acceleration properties. 182 */ 183 paramRadialAccel = 4, 184 /** 185 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set tangential acceleration properties. 186 */ 187 paramTangentialAccel = 5, 188 /** 189 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set damping properties. 190 */ 191 paramDamping = 6, 192 /** 193 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set angle properties. 194 */ 195 paramAngle = 7, 196 /** 197 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set scale properties. 198 */ 199 paramScale = 8, 200 /** 201 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set hue variation properties. 202 */ 203 paramHueVariation = 9, 204 /** 205 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set animation speed properties. 206 */ 207 paramAnimSpeed = 10, 208 /** 209 Use with $(D setParam), $(D setParamRandomness), and $(D setParamTexture) to set animation offset properties. 210 */ 211 paramAnimOffset = 11, 212 /** 213 Represents the size of the $(D parameter) enum. 214 */ 215 paramMax = 12, 216 } 217 /// 218 enum Constants : int 219 { 220 flagAlignYToVelocity = 0, 221 emissionShapePoint = 0, 222 paramInitialLinearVelocity = 0, 223 paramAngularVelocity = 1, 224 emissionShapeSphere = 1, 225 flagRotateY = 1, 226 flagDisableZ = 2, 227 emissionShapeBox = 2, 228 paramOrbitVelocity = 2, 229 flagMax = 3, 230 paramLinearAccel = 3, 231 emissionShapePoints = 3, 232 paramRadialAccel = 4, 233 emissionShapeDirectedPoints = 4, 234 paramTangentialAccel = 5, 235 emissionShapeMax = 5, 236 paramDamping = 6, 237 paramAngle = 7, 238 paramScale = 8, 239 paramHueVariation = 9, 240 paramAnimSpeed = 10, 241 paramAnimOffset = 11, 242 paramMax = 12, 243 } 244 /** 245 246 */ 247 Color getColor() const 248 { 249 checkClassBinding!(typeof(this))(); 250 return ptrcall!(Color)(GDNativeClassBinding.getColor, _godot_object); 251 } 252 /** 253 254 */ 255 Ref!Texture getColorRamp() const 256 { 257 checkClassBinding!(typeof(this))(); 258 return ptrcall!(Texture)(GDNativeClassBinding.getColorRamp, _godot_object); 259 } 260 /** 261 262 */ 263 Vector3 getDirection() const 264 { 265 checkClassBinding!(typeof(this))(); 266 return ptrcall!(Vector3)(GDNativeClassBinding.getDirection, _godot_object); 267 } 268 /** 269 270 */ 271 Vector3 getEmissionBoxExtents() const 272 { 273 checkClassBinding!(typeof(this))(); 274 return ptrcall!(Vector3)(GDNativeClassBinding.getEmissionBoxExtents, _godot_object); 275 } 276 /** 277 278 */ 279 Ref!Texture getEmissionColorTexture() const 280 { 281 checkClassBinding!(typeof(this))(); 282 return ptrcall!(Texture)(GDNativeClassBinding.getEmissionColorTexture, _godot_object); 283 } 284 /** 285 286 */ 287 Ref!Texture getEmissionNormalTexture() const 288 { 289 checkClassBinding!(typeof(this))(); 290 return ptrcall!(Texture)(GDNativeClassBinding.getEmissionNormalTexture, _godot_object); 291 } 292 /** 293 294 */ 295 long getEmissionPointCount() const 296 { 297 checkClassBinding!(typeof(this))(); 298 return ptrcall!(long)(GDNativeClassBinding.getEmissionPointCount, _godot_object); 299 } 300 /** 301 302 */ 303 Ref!Texture getEmissionPointTexture() const 304 { 305 checkClassBinding!(typeof(this))(); 306 return ptrcall!(Texture)(GDNativeClassBinding.getEmissionPointTexture, _godot_object); 307 } 308 /** 309 310 */ 311 ParticlesMaterial.EmissionShape getEmissionShape() const 312 { 313 checkClassBinding!(typeof(this))(); 314 return ptrcall!(ParticlesMaterial.EmissionShape)(GDNativeClassBinding.getEmissionShape, _godot_object); 315 } 316 /** 317 318 */ 319 double getEmissionSphereRadius() const 320 { 321 checkClassBinding!(typeof(this))(); 322 return ptrcall!(double)(GDNativeClassBinding.getEmissionSphereRadius, _godot_object); 323 } 324 /** 325 Returns `true` if the specified flag is enabled. 326 */ 327 bool getFlag(in long flag) const 328 { 329 checkClassBinding!(typeof(this))(); 330 return ptrcall!(bool)(GDNativeClassBinding.getFlag, _godot_object, flag); 331 } 332 /** 333 334 */ 335 double getFlatness() const 336 { 337 checkClassBinding!(typeof(this))(); 338 return ptrcall!(double)(GDNativeClassBinding.getFlatness, _godot_object); 339 } 340 /** 341 342 */ 343 Vector3 getGravity() const 344 { 345 checkClassBinding!(typeof(this))(); 346 return ptrcall!(Vector3)(GDNativeClassBinding.getGravity, _godot_object); 347 } 348 /** 349 350 */ 351 double getLifetimeRandomness() const 352 { 353 checkClassBinding!(typeof(this))(); 354 return ptrcall!(double)(GDNativeClassBinding.getLifetimeRandomness, _godot_object); 355 } 356 /** 357 Returns the value of the specified parameter. 358 */ 359 double getParam(in long param) const 360 { 361 checkClassBinding!(typeof(this))(); 362 return ptrcall!(double)(GDNativeClassBinding.getParam, _godot_object, param); 363 } 364 /** 365 Returns the randomness ratio associated with the specified parameter. 366 */ 367 double getParamRandomness(in long param) const 368 { 369 checkClassBinding!(typeof(this))(); 370 return ptrcall!(double)(GDNativeClassBinding.getParamRandomness, _godot_object, param); 371 } 372 /** 373 Returns the $(D Texture) used by the specified parameter. 374 */ 375 Ref!Texture getParamTexture(in long param) const 376 { 377 checkClassBinding!(typeof(this))(); 378 return ptrcall!(Texture)(GDNativeClassBinding.getParamTexture, _godot_object, param); 379 } 380 /** 381 382 */ 383 double getSpread() const 384 { 385 checkClassBinding!(typeof(this))(); 386 return ptrcall!(double)(GDNativeClassBinding.getSpread, _godot_object); 387 } 388 /** 389 390 */ 391 Ref!GradientTexture getTrailColorModifier() const 392 { 393 checkClassBinding!(typeof(this))(); 394 return ptrcall!(GradientTexture)(GDNativeClassBinding.getTrailColorModifier, _godot_object); 395 } 396 /** 397 398 */ 399 long getTrailDivisor() const 400 { 401 checkClassBinding!(typeof(this))(); 402 return ptrcall!(long)(GDNativeClassBinding.getTrailDivisor, _godot_object); 403 } 404 /** 405 406 */ 407 Ref!CurveTexture getTrailSizeModifier() const 408 { 409 checkClassBinding!(typeof(this))(); 410 return ptrcall!(CurveTexture)(GDNativeClassBinding.getTrailSizeModifier, _godot_object); 411 } 412 /** 413 414 */ 415 void setColor(in Color color) 416 { 417 checkClassBinding!(typeof(this))(); 418 ptrcall!(void)(GDNativeClassBinding.setColor, _godot_object, color); 419 } 420 /** 421 422 */ 423 void setColorRamp(Texture ramp) 424 { 425 checkClassBinding!(typeof(this))(); 426 ptrcall!(void)(GDNativeClassBinding.setColorRamp, _godot_object, ramp); 427 } 428 /** 429 430 */ 431 void setDirection(in Vector3 degrees) 432 { 433 checkClassBinding!(typeof(this))(); 434 ptrcall!(void)(GDNativeClassBinding.setDirection, _godot_object, degrees); 435 } 436 /** 437 438 */ 439 void setEmissionBoxExtents(in Vector3 extents) 440 { 441 checkClassBinding!(typeof(this))(); 442 ptrcall!(void)(GDNativeClassBinding.setEmissionBoxExtents, _godot_object, extents); 443 } 444 /** 445 446 */ 447 void setEmissionColorTexture(Texture texture) 448 { 449 checkClassBinding!(typeof(this))(); 450 ptrcall!(void)(GDNativeClassBinding.setEmissionColorTexture, _godot_object, texture); 451 } 452 /** 453 454 */ 455 void setEmissionNormalTexture(Texture texture) 456 { 457 checkClassBinding!(typeof(this))(); 458 ptrcall!(void)(GDNativeClassBinding.setEmissionNormalTexture, _godot_object, texture); 459 } 460 /** 461 462 */ 463 void setEmissionPointCount(in long point_count) 464 { 465 checkClassBinding!(typeof(this))(); 466 ptrcall!(void)(GDNativeClassBinding.setEmissionPointCount, _godot_object, point_count); 467 } 468 /** 469 470 */ 471 void setEmissionPointTexture(Texture texture) 472 { 473 checkClassBinding!(typeof(this))(); 474 ptrcall!(void)(GDNativeClassBinding.setEmissionPointTexture, _godot_object, texture); 475 } 476 /** 477 478 */ 479 void setEmissionShape(in long shape) 480 { 481 checkClassBinding!(typeof(this))(); 482 ptrcall!(void)(GDNativeClassBinding.setEmissionShape, _godot_object, shape); 483 } 484 /** 485 486 */ 487 void setEmissionSphereRadius(in double radius) 488 { 489 checkClassBinding!(typeof(this))(); 490 ptrcall!(void)(GDNativeClassBinding.setEmissionSphereRadius, _godot_object, radius); 491 } 492 /** 493 If `true`, enables the specified flag. See $(D flags) for options. 494 */ 495 void setFlag(in long flag, in bool enable) 496 { 497 checkClassBinding!(typeof(this))(); 498 ptrcall!(void)(GDNativeClassBinding.setFlag, _godot_object, flag, enable); 499 } 500 /** 501 502 */ 503 void setFlatness(in double amount) 504 { 505 checkClassBinding!(typeof(this))(); 506 ptrcall!(void)(GDNativeClassBinding.setFlatness, _godot_object, amount); 507 } 508 /** 509 510 */ 511 void setGravity(in Vector3 accel_vec) 512 { 513 checkClassBinding!(typeof(this))(); 514 ptrcall!(void)(GDNativeClassBinding.setGravity, _godot_object, accel_vec); 515 } 516 /** 517 518 */ 519 void setLifetimeRandomness(in double randomness) 520 { 521 checkClassBinding!(typeof(this))(); 522 ptrcall!(void)(GDNativeClassBinding.setLifetimeRandomness, _godot_object, randomness); 523 } 524 /** 525 Sets the specified $(D parameter). 526 */ 527 void setParam(in long param, in double value) 528 { 529 checkClassBinding!(typeof(this))(); 530 ptrcall!(void)(GDNativeClassBinding.setParam, _godot_object, param, value); 531 } 532 /** 533 Sets the randomness ratio for the specified $(D parameter). 534 */ 535 void setParamRandomness(in long param, in double randomness) 536 { 537 checkClassBinding!(typeof(this))(); 538 ptrcall!(void)(GDNativeClassBinding.setParamRandomness, _godot_object, param, randomness); 539 } 540 /** 541 Sets the $(D Texture) for the specified $(D parameter). 542 */ 543 void setParamTexture(in long param, Texture texture) 544 { 545 checkClassBinding!(typeof(this))(); 546 ptrcall!(void)(GDNativeClassBinding.setParamTexture, _godot_object, param, texture); 547 } 548 /** 549 550 */ 551 void setSpread(in double degrees) 552 { 553 checkClassBinding!(typeof(this))(); 554 ptrcall!(void)(GDNativeClassBinding.setSpread, _godot_object, degrees); 555 } 556 /** 557 558 */ 559 void setTrailColorModifier(GradientTexture texture) 560 { 561 checkClassBinding!(typeof(this))(); 562 ptrcall!(void)(GDNativeClassBinding.setTrailColorModifier, _godot_object, texture); 563 } 564 /** 565 566 */ 567 void setTrailDivisor(in long divisor) 568 { 569 checkClassBinding!(typeof(this))(); 570 ptrcall!(void)(GDNativeClassBinding.setTrailDivisor, _godot_object, divisor); 571 } 572 /** 573 574 */ 575 void setTrailSizeModifier(CurveTexture texture) 576 { 577 checkClassBinding!(typeof(this))(); 578 ptrcall!(void)(GDNativeClassBinding.setTrailSizeModifier, _godot_object, texture); 579 } 580 /** 581 Initial rotation applied to each particle, in degrees. 582 Only applied when $(D flagDisableZ) or $(D flagRotateY) are `true` or the $(D SpatialMaterial) being used to draw the particle is using $(D constant SpatialMaterial.BILLBOARD_PARTICLES). 583 */ 584 @property double angle() 585 { 586 return getParam(7); 587 } 588 /// ditto 589 @property void angle(double v) 590 { 591 setParam(7, v); 592 } 593 /** 594 Each particle's rotation will be animated along this $(D CurveTexture). 595 */ 596 @property Texture angleCurve() 597 { 598 return getParamTexture(7); 599 } 600 /// ditto 601 @property void angleCurve(Texture v) 602 { 603 setParamTexture(7, v); 604 } 605 /** 606 Rotation randomness ratio. 607 */ 608 @property double angleRandom() 609 { 610 return getParamRandomness(7); 611 } 612 /// ditto 613 @property void angleRandom(double v) 614 { 615 setParamRandomness(7, v); 616 } 617 /** 618 Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. 619 Only applied when $(D flagDisableZ) or $(D flagRotateY) are `true` or the $(D SpatialMaterial) being used to draw the particle is using $(D constant SpatialMaterial.BILLBOARD_PARTICLES). 620 */ 621 @property double angularVelocity() 622 { 623 return getParam(1); 624 } 625 /// ditto 626 @property void angularVelocity(double v) 627 { 628 setParam(1, v); 629 } 630 /** 631 Each particle's angular velocity will vary along this $(D CurveTexture). 632 */ 633 @property Texture angularVelocityCurve() 634 { 635 return getParamTexture(1); 636 } 637 /// ditto 638 @property void angularVelocityCurve(Texture v) 639 { 640 setParamTexture(1, v); 641 } 642 /** 643 Angular velocity randomness ratio. 644 */ 645 @property double angularVelocityRandom() 646 { 647 return getParamRandomness(1); 648 } 649 /// ditto 650 @property void angularVelocityRandom(double v) 651 { 652 setParamRandomness(1, v); 653 } 654 /** 655 Particle animation offset. 656 */ 657 @property double animOffset() 658 { 659 return getParam(11); 660 } 661 /// ditto 662 @property void animOffset(double v) 663 { 664 setParam(11, v); 665 } 666 /** 667 Each particle's animation offset will vary along this $(D CurveTexture). 668 */ 669 @property Texture animOffsetCurve() 670 { 671 return getParamTexture(11); 672 } 673 /// ditto 674 @property void animOffsetCurve(Texture v) 675 { 676 setParamTexture(11, v); 677 } 678 /** 679 Animation offset randomness ratio. 680 */ 681 @property double animOffsetRandom() 682 { 683 return getParamRandomness(11); 684 } 685 /// ditto 686 @property void animOffsetRandom(double v) 687 { 688 setParamRandomness(11, v); 689 } 690 /** 691 Particle animation speed. 692 */ 693 @property double animSpeed() 694 { 695 return getParam(10); 696 } 697 /// ditto 698 @property void animSpeed(double v) 699 { 700 setParam(10, v); 701 } 702 /** 703 Each particle's animation speed will vary along this $(D CurveTexture). 704 */ 705 @property Texture animSpeedCurve() 706 { 707 return getParamTexture(10); 708 } 709 /// ditto 710 @property void animSpeedCurve(Texture v) 711 { 712 setParamTexture(10, v); 713 } 714 /** 715 Animation speed randomness ratio. 716 */ 717 @property double animSpeedRandom() 718 { 719 return getParamRandomness(10); 720 } 721 /// ditto 722 @property void animSpeedRandom(double v) 723 { 724 setParamRandomness(10, v); 725 } 726 /** 727 Each particle's initial color. If the $(D Particles2D)'s `texture` is defined, it will be multiplied by this color. To have particle display color in a $(D SpatialMaterial) make sure to set $(D SpatialMaterial.vertexColorUseAsAlbedo) to `true`. 728 */ 729 @property Color color() 730 { 731 return getColor(); 732 } 733 /// ditto 734 @property void color(Color v) 735 { 736 setColor(v); 737 } 738 /** 739 Each particle's color will vary along this $(D GradientTexture). 740 */ 741 @property Texture colorRamp() 742 { 743 return getColorRamp(); 744 } 745 /// ditto 746 @property void colorRamp(Texture v) 747 { 748 setColorRamp(v); 749 } 750 /** 751 The rate at which particles lose velocity. 752 */ 753 @property double damping() 754 { 755 return getParam(6); 756 } 757 /// ditto 758 @property void damping(double v) 759 { 760 setParam(6, v); 761 } 762 /** 763 Damping will vary along this $(D CurveTexture). 764 */ 765 @property Texture dampingCurve() 766 { 767 return getParamTexture(6); 768 } 769 /// ditto 770 @property void dampingCurve(Texture v) 771 { 772 setParamTexture(6, v); 773 } 774 /** 775 Damping randomness ratio. 776 */ 777 @property double dampingRandom() 778 { 779 return getParamRandomness(6); 780 } 781 /// ditto 782 @property void dampingRandom(double v) 783 { 784 setParamRandomness(6, v); 785 } 786 /** 787 Unit vector specifying the particles' emission direction. 788 */ 789 @property Vector3 direction() 790 { 791 return getDirection(); 792 } 793 /// ditto 794 @property void direction(Vector3 v) 795 { 796 setDirection(v); 797 } 798 /** 799 The box's extents if `emission_shape` is set to $(D constant EMISSION_SHAPE_BOX). 800 */ 801 @property Vector3 emissionBoxExtents() 802 { 803 return getEmissionBoxExtents(); 804 } 805 /// ditto 806 @property void emissionBoxExtents(Vector3 v) 807 { 808 setEmissionBoxExtents(v); 809 } 810 /** 811 Particle color will be modulated by color determined by sampling this texture at the same point as the $(D emissionPointTexture). 812 */ 813 @property Texture emissionColorTexture() 814 { 815 return getEmissionColorTexture(); 816 } 817 /// ditto 818 @property void emissionColorTexture(Texture v) 819 { 820 setEmissionColorTexture(v); 821 } 822 /** 823 Particle velocity and rotation will be set by sampling this texture at the same point as the $(D emissionPointTexture). Used only in $(D constant EMISSION_SHAPE_DIRECTED_POINTS). Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. 824 */ 825 @property Texture emissionNormalTexture() 826 { 827 return getEmissionNormalTexture(); 828 } 829 /// ditto 830 @property void emissionNormalTexture(Texture v) 831 { 832 setEmissionNormalTexture(v); 833 } 834 /** 835 The number of emission points if `emission_shape` is set to $(D constant EMISSION_SHAPE_POINTS) or $(D constant EMISSION_SHAPE_DIRECTED_POINTS). 836 */ 837 @property long emissionPointCount() 838 { 839 return getEmissionPointCount(); 840 } 841 /// ditto 842 @property void emissionPointCount(long v) 843 { 844 setEmissionPointCount(v); 845 } 846 /** 847 Particles will be emitted at positions determined by sampling this texture at a random position. Used with $(D constant EMISSION_SHAPE_POINTS) and $(D constant EMISSION_SHAPE_DIRECTED_POINTS). Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. 848 */ 849 @property Texture emissionPointTexture() 850 { 851 return getEmissionPointTexture(); 852 } 853 /// ditto 854 @property void emissionPointTexture(Texture v) 855 { 856 setEmissionPointTexture(v); 857 } 858 /** 859 Particles will be emitted inside this region. Use $(D emissionshape) constants for values. 860 */ 861 @property ParticlesMaterial.EmissionShape emissionShape() 862 { 863 return getEmissionShape(); 864 } 865 /// ditto 866 @property void emissionShape(long v) 867 { 868 setEmissionShape(v); 869 } 870 /** 871 The sphere's radius if `emission_shape` is set to $(D constant EMISSION_SHAPE_SPHERE). 872 */ 873 @property double emissionSphereRadius() 874 { 875 return getEmissionSphereRadius(); 876 } 877 /// ditto 878 @property void emissionSphereRadius(double v) 879 { 880 setEmissionSphereRadius(v); 881 } 882 /** 883 Align Y axis of particle with the direction of its velocity. 884 */ 885 @property bool flagAlignY() 886 { 887 return getFlag(0); 888 } 889 /// ditto 890 @property void flagAlignY(bool v) 891 { 892 setFlag(0, v); 893 } 894 /** 895 If `true`, particles will not move on the z axis. 896 */ 897 @property bool flagDisableZ() 898 { 899 return getFlag(2); 900 } 901 /// ditto 902 @property void flagDisableZ(bool v) 903 { 904 setFlag(2, v); 905 } 906 /** 907 If `true`, particles rotate around Y axis by $(D angle). 908 */ 909 @property bool flagRotateY() 910 { 911 return getFlag(1); 912 } 913 /// ditto 914 @property void flagRotateY(bool v) 915 { 916 setFlag(1, v); 917 } 918 /** 919 Amount of $(D spread) in Y/Z plane. A value of `1` restricts particles to X/Z plane. 920 */ 921 @property double flatness() 922 { 923 return getFlatness(); 924 } 925 /// ditto 926 @property void flatness(double v) 927 { 928 setFlatness(v); 929 } 930 /** 931 Gravity applied to every particle. 932 */ 933 @property Vector3 gravity() 934 { 935 return getGravity(); 936 } 937 /// ditto 938 @property void gravity(Vector3 v) 939 { 940 setGravity(v); 941 } 942 /** 943 Initial hue variation applied to each particle. 944 */ 945 @property double hueVariation() 946 { 947 return getParam(9); 948 } 949 /// ditto 950 @property void hueVariation(double v) 951 { 952 setParam(9, v); 953 } 954 /** 955 Each particle's hue will vary along this $(D CurveTexture). 956 */ 957 @property Texture hueVariationCurve() 958 { 959 return getParamTexture(9); 960 } 961 /// ditto 962 @property void hueVariationCurve(Texture v) 963 { 964 setParamTexture(9, v); 965 } 966 /** 967 Hue variation randomness ratio. 968 */ 969 @property double hueVariationRandom() 970 { 971 return getParamRandomness(9); 972 } 973 /// ditto 974 @property void hueVariationRandom(double v) 975 { 976 setParamRandomness(9, v); 977 } 978 /** 979 Initial velocity magnitude for each particle. Direction comes from $(D spread) and the node's orientation. 980 */ 981 @property double initialVelocity() 982 { 983 return getParam(0); 984 } 985 /// ditto 986 @property void initialVelocity(double v) 987 { 988 setParam(0, v); 989 } 990 /** 991 Initial velocity randomness ratio. 992 */ 993 @property double initialVelocityRandom() 994 { 995 return getParamRandomness(0); 996 } 997 /// ditto 998 @property void initialVelocityRandom(double v) 999 { 1000 setParamRandomness(0, v); 1001 } 1002 /** 1003 Particle lifetime randomness ratio. 1004 */ 1005 @property double lifetimeRandomness() 1006 { 1007 return getLifetimeRandomness(); 1008 } 1009 /// ditto 1010 @property void lifetimeRandomness(double v) 1011 { 1012 setLifetimeRandomness(v); 1013 } 1014 /** 1015 Linear acceleration applied to each particle in the direction of motion. 1016 */ 1017 @property double linearAccel() 1018 { 1019 return getParam(3); 1020 } 1021 /// ditto 1022 @property void linearAccel(double v) 1023 { 1024 setParam(3, v); 1025 } 1026 /** 1027 Each particle's linear acceleration will vary along this $(D CurveTexture). 1028 */ 1029 @property Texture linearAccelCurve() 1030 { 1031 return getParamTexture(3); 1032 } 1033 /// ditto 1034 @property void linearAccelCurve(Texture v) 1035 { 1036 setParamTexture(3, v); 1037 } 1038 /** 1039 Linear acceleration randomness ratio. 1040 */ 1041 @property double linearAccelRandom() 1042 { 1043 return getParamRandomness(3); 1044 } 1045 /// ditto 1046 @property void linearAccelRandom(double v) 1047 { 1048 setParamRandomness(3, v); 1049 } 1050 /** 1051 Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. 1052 Only available when $(D flagDisableZ) is `true`. 1053 */ 1054 @property double orbitVelocity() 1055 { 1056 return getParam(2); 1057 } 1058 /// ditto 1059 @property void orbitVelocity(double v) 1060 { 1061 setParam(2, v); 1062 } 1063 /** 1064 Each particle's orbital velocity will vary along this $(D CurveTexture). 1065 */ 1066 @property Texture orbitVelocityCurve() 1067 { 1068 return getParamTexture(2); 1069 } 1070 /// ditto 1071 @property void orbitVelocityCurve(Texture v) 1072 { 1073 setParamTexture(2, v); 1074 } 1075 /** 1076 Orbital velocity randomness ratio. 1077 */ 1078 @property double orbitVelocityRandom() 1079 { 1080 return getParamRandomness(2); 1081 } 1082 /// ditto 1083 @property void orbitVelocityRandom(double v) 1084 { 1085 setParamRandomness(2, v); 1086 } 1087 /** 1088 Radial acceleration applied to each particle. Makes particle accelerate away from origin. 1089 */ 1090 @property double radialAccel() 1091 { 1092 return getParam(4); 1093 } 1094 /// ditto 1095 @property void radialAccel(double v) 1096 { 1097 setParam(4, v); 1098 } 1099 /** 1100 Each particle's radial acceleration will vary along this $(D CurveTexture). 1101 */ 1102 @property Texture radialAccelCurve() 1103 { 1104 return getParamTexture(4); 1105 } 1106 /// ditto 1107 @property void radialAccelCurve(Texture v) 1108 { 1109 setParamTexture(4, v); 1110 } 1111 /** 1112 Radial acceleration randomness ratio. 1113 */ 1114 @property double radialAccelRandom() 1115 { 1116 return getParamRandomness(4); 1117 } 1118 /// ditto 1119 @property void radialAccelRandom(double v) 1120 { 1121 setParamRandomness(4, v); 1122 } 1123 /** 1124 Initial scale applied to each particle. 1125 */ 1126 @property double scale() 1127 { 1128 return getParam(8); 1129 } 1130 /// ditto 1131 @property void scale(double v) 1132 { 1133 setParam(8, v); 1134 } 1135 /** 1136 Each particle's scale will vary along this $(D CurveTexture). 1137 */ 1138 @property Texture scaleCurve() 1139 { 1140 return getParamTexture(8); 1141 } 1142 /// ditto 1143 @property void scaleCurve(Texture v) 1144 { 1145 setParamTexture(8, v); 1146 } 1147 /** 1148 Scale randomness ratio. 1149 */ 1150 @property double scaleRandom() 1151 { 1152 return getParamRandomness(8); 1153 } 1154 /// ditto 1155 @property void scaleRandom(double v) 1156 { 1157 setParamRandomness(8, v); 1158 } 1159 /** 1160 Each particle's initial direction range from `+spread` to `-spread` degrees. Applied to X/Z plane and Y/Z planes. 1161 */ 1162 @property double spread() 1163 { 1164 return getSpread(); 1165 } 1166 /// ditto 1167 @property void spread(double v) 1168 { 1169 setSpread(v); 1170 } 1171 /** 1172 Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. 1173 */ 1174 @property double tangentialAccel() 1175 { 1176 return getParam(5); 1177 } 1178 /// ditto 1179 @property void tangentialAccel(double v) 1180 { 1181 setParam(5, v); 1182 } 1183 /** 1184 Each particle's tangential acceleration will vary along this $(D CurveTexture). 1185 */ 1186 @property Texture tangentialAccelCurve() 1187 { 1188 return getParamTexture(5); 1189 } 1190 /// ditto 1191 @property void tangentialAccelCurve(Texture v) 1192 { 1193 setParamTexture(5, v); 1194 } 1195 /** 1196 Tangential acceleration randomness ratio. 1197 */ 1198 @property double tangentialAccelRandom() 1199 { 1200 return getParamRandomness(5); 1201 } 1202 /// ditto 1203 @property void tangentialAccelRandom(double v) 1204 { 1205 setParamRandomness(5, v); 1206 } 1207 /** 1208 Trail particles' color will vary along this $(D GradientTexture). 1209 */ 1210 @property GradientTexture trailColorModifier() 1211 { 1212 return getTrailColorModifier(); 1213 } 1214 /// ditto 1215 @property void trailColorModifier(GradientTexture v) 1216 { 1217 setTrailColorModifier(v); 1218 } 1219 /** 1220 Emitter will emit `amount` divided by `trail_divisor` particles. The remaining particles will be used as trail(s). 1221 */ 1222 @property long trailDivisor() 1223 { 1224 return getTrailDivisor(); 1225 } 1226 /// ditto 1227 @property void trailDivisor(long v) 1228 { 1229 setTrailDivisor(v); 1230 } 1231 /** 1232 Trail particles' size will vary along this $(D CurveTexture). 1233 */ 1234 @property CurveTexture trailSizeModifier() 1235 { 1236 return getTrailSizeModifier(); 1237 } 1238 /// ditto 1239 @property void trailSizeModifier(CurveTexture v) 1240 { 1241 setTrailSizeModifier(v); 1242 } 1243 }