1 /** 2 CPU-based 3D particle emitter. 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.cpuparticles; 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.geometryinstance; 25 import godot.node; 26 import godot.gradient; 27 import godot.mesh; 28 import godot.curve; 29 /** 30 CPU-based 3D particle emitter. 31 32 CPU-based 3D particle node used to create a variety of particle systems and effects. 33 See also $(D Particles), which provides the same functionality with hardware acceleration, but may not run on older devices. 34 $(B Note:) Unlike $(D Particles), the visibility rect is generated on-the-fly and doesn't need to be configured by the user. 35 */ 36 @GodotBaseClass struct CPUParticles 37 { 38 package(godot) enum string _GODOT_internal_name = "CPUParticles"; 39 public: 40 @nogc nothrow: 41 union { /** */ godot_object _godot_object; /** */ GeometryInstance _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("_update_render_thread") GodotMethod!(void) _updateRenderThread; 49 @GodotName("convert_from_particles") GodotMethod!(void, Node) convertFromParticles; 50 @GodotName("get_amount") GodotMethod!(long) getAmount; 51 @GodotName("get_color") GodotMethod!(Color) getColor; 52 @GodotName("get_color_ramp") GodotMethod!(Gradient) getColorRamp; 53 @GodotName("get_direction") GodotMethod!(Vector3) getDirection; 54 @GodotName("get_draw_order") GodotMethod!(CPUParticles.DrawOrder) getDrawOrder; 55 @GodotName("get_emission_box_extents") GodotMethod!(Vector3) getEmissionBoxExtents; 56 @GodotName("get_emission_colors") GodotMethod!(PoolColorArray) getEmissionColors; 57 @GodotName("get_emission_normals") GodotMethod!(PoolVector3Array) getEmissionNormals; 58 @GodotName("get_emission_points") GodotMethod!(PoolVector3Array) getEmissionPoints; 59 @GodotName("get_emission_shape") GodotMethod!(CPUParticles.EmissionShape) getEmissionShape; 60 @GodotName("get_emission_sphere_radius") GodotMethod!(double) getEmissionSphereRadius; 61 @GodotName("get_explosiveness_ratio") GodotMethod!(double) getExplosivenessRatio; 62 @GodotName("get_fixed_fps") GodotMethod!(long) getFixedFps; 63 @GodotName("get_flatness") GodotMethod!(double) getFlatness; 64 @GodotName("get_fractional_delta") GodotMethod!(bool) getFractionalDelta; 65 @GodotName("get_gravity") GodotMethod!(Vector3) getGravity; 66 @GodotName("get_lifetime") GodotMethod!(double) getLifetime; 67 @GodotName("get_lifetime_randomness") GodotMethod!(double) getLifetimeRandomness; 68 @GodotName("get_mesh") GodotMethod!(Mesh) getMesh; 69 @GodotName("get_one_shot") GodotMethod!(bool) getOneShot; 70 @GodotName("get_param") GodotMethod!(double, long) getParam; 71 @GodotName("get_param_curve") GodotMethod!(Curve, long) getParamCurve; 72 @GodotName("get_param_randomness") GodotMethod!(double, long) getParamRandomness; 73 @GodotName("get_particle_flag") GodotMethod!(bool, long) getParticleFlag; 74 @GodotName("get_pre_process_time") GodotMethod!(double) getPreProcessTime; 75 @GodotName("get_randomness_ratio") GodotMethod!(double) getRandomnessRatio; 76 @GodotName("get_speed_scale") GodotMethod!(double) getSpeedScale; 77 @GodotName("get_spread") GodotMethod!(double) getSpread; 78 @GodotName("get_use_local_coordinates") GodotMethod!(bool) getUseLocalCoordinates; 79 @GodotName("is_emitting") GodotMethod!(bool) isEmitting; 80 @GodotName("restart") GodotMethod!(void) restart; 81 @GodotName("set_amount") GodotMethod!(void, long) setAmount; 82 @GodotName("set_color") GodotMethod!(void, Color) setColor; 83 @GodotName("set_color_ramp") GodotMethod!(void, Gradient) setColorRamp; 84 @GodotName("set_direction") GodotMethod!(void, Vector3) setDirection; 85 @GodotName("set_draw_order") GodotMethod!(void, long) setDrawOrder; 86 @GodotName("set_emission_box_extents") GodotMethod!(void, Vector3) setEmissionBoxExtents; 87 @GodotName("set_emission_colors") GodotMethod!(void, PoolColorArray) setEmissionColors; 88 @GodotName("set_emission_normals") GodotMethod!(void, PoolVector3Array) setEmissionNormals; 89 @GodotName("set_emission_points") GodotMethod!(void, PoolVector3Array) setEmissionPoints; 90 @GodotName("set_emission_shape") GodotMethod!(void, long) setEmissionShape; 91 @GodotName("set_emission_sphere_radius") GodotMethod!(void, double) setEmissionSphereRadius; 92 @GodotName("set_emitting") GodotMethod!(void, bool) setEmitting; 93 @GodotName("set_explosiveness_ratio") GodotMethod!(void, double) setExplosivenessRatio; 94 @GodotName("set_fixed_fps") GodotMethod!(void, long) setFixedFps; 95 @GodotName("set_flatness") GodotMethod!(void, double) setFlatness; 96 @GodotName("set_fractional_delta") GodotMethod!(void, bool) setFractionalDelta; 97 @GodotName("set_gravity") GodotMethod!(void, Vector3) setGravity; 98 @GodotName("set_lifetime") GodotMethod!(void, double) setLifetime; 99 @GodotName("set_lifetime_randomness") GodotMethod!(void, double) setLifetimeRandomness; 100 @GodotName("set_mesh") GodotMethod!(void, Mesh) setMesh; 101 @GodotName("set_one_shot") GodotMethod!(void, bool) setOneShot; 102 @GodotName("set_param") GodotMethod!(void, long, double) setParam; 103 @GodotName("set_param_curve") GodotMethod!(void, long, Curve) setParamCurve; 104 @GodotName("set_param_randomness") GodotMethod!(void, long, double) setParamRandomness; 105 @GodotName("set_particle_flag") GodotMethod!(void, long, bool) setParticleFlag; 106 @GodotName("set_pre_process_time") GodotMethod!(void, double) setPreProcessTime; 107 @GodotName("set_randomness_ratio") GodotMethod!(void, double) setRandomnessRatio; 108 @GodotName("set_speed_scale") GodotMethod!(void, double) setSpeedScale; 109 @GodotName("set_spread") GodotMethod!(void, double) setSpread; 110 @GodotName("set_use_local_coordinates") GodotMethod!(void, bool) setUseLocalCoordinates; 111 } 112 /// 113 pragma(inline, true) bool opEquals(in CPUParticles other) const 114 { return _godot_object.ptr is other._godot_object.ptr; } 115 /// 116 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 117 { _godot_object.ptr = n; return null; } 118 /// 119 pragma(inline, true) bool opEquals(typeof(null) n) const 120 { return _godot_object.ptr is n; } 121 /// 122 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 123 mixin baseCasts; 124 /// Construct a new instance of CPUParticles. 125 /// Note: use `memnew!CPUParticles` instead. 126 static CPUParticles _new() 127 { 128 static godot_class_constructor constructor; 129 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CPUParticles"); 130 if(constructor is null) return typeof(this).init; 131 return cast(CPUParticles)(constructor()); 132 } 133 @disable new(size_t s); 134 /// 135 enum Flags : int 136 { 137 /** 138 Use with $(D setParticleFlag) to set $(D flagAlignY). 139 */ 140 flagAlignYToVelocity = 0, 141 /** 142 Use with $(D setParticleFlag) to set $(D flagRotateY). 143 */ 144 flagRotateY = 1, 145 /** 146 Use with $(D setParticleFlag) to set $(D flagDisableZ). 147 */ 148 flagDisableZ = 2, 149 /** 150 Represents the size of the $(D flags) enum. 151 */ 152 flagMax = 3, 153 } 154 /// 155 enum EmissionShape : int 156 { 157 /** 158 All particles will be emitted from a single point. 159 */ 160 emissionShapePoint = 0, 161 /** 162 Particles will be emitted in the volume of a sphere. 163 */ 164 emissionShapeSphere = 1, 165 /** 166 Particles will be emitted in the volume of a box. 167 */ 168 emissionShapeBox = 2, 169 /** 170 Particles will be emitted at a position chosen randomly among $(D emissionPoints). Particle color will be modulated by $(D emissionColors). 171 */ 172 emissionShapePoints = 3, 173 /** 174 Particles will be emitted at a position chosen randomly among $(D emissionPoints). Particle velocity and rotation will be set based on $(D emissionNormals). Particle color will be modulated by $(D emissionColors). 175 */ 176 emissionShapeDirectedPoints = 4, 177 /** 178 Represents the size of the $(D emissionshape) enum. 179 */ 180 emissionShapeMax = 5, 181 } 182 /// 183 enum Parameter : int 184 { 185 /** 186 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set initial velocity properties. 187 */ 188 paramInitialLinearVelocity = 0, 189 /** 190 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set angular velocity properties. 191 */ 192 paramAngularVelocity = 1, 193 /** 194 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set orbital velocity properties. 195 */ 196 paramOrbitVelocity = 2, 197 /** 198 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set linear acceleration properties. 199 */ 200 paramLinearAccel = 3, 201 /** 202 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set radial acceleration properties. 203 */ 204 paramRadialAccel = 4, 205 /** 206 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set tangential acceleration properties. 207 */ 208 paramTangentialAccel = 5, 209 /** 210 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set damping properties. 211 */ 212 paramDamping = 6, 213 /** 214 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set angle properties. 215 */ 216 paramAngle = 7, 217 /** 218 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set scale properties. 219 */ 220 paramScale = 8, 221 /** 222 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set hue variation properties. 223 */ 224 paramHueVariation = 9, 225 /** 226 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set animation speed properties. 227 */ 228 paramAnimSpeed = 10, 229 /** 230 Use with $(D setParam), $(D setParamRandomness), and $(D setParamCurve) to set animation offset properties. 231 */ 232 paramAnimOffset = 11, 233 /** 234 Represents the size of the $(D parameter) enum. 235 */ 236 paramMax = 12, 237 } 238 /// 239 enum DrawOrder : int 240 { 241 /** 242 Particles are drawn in the order emitted. 243 */ 244 drawOrderIndex = 0, 245 /** 246 Particles are drawn in order of remaining lifetime. 247 */ 248 drawOrderLifetime = 1, 249 /** 250 Particles are drawn in order of depth. 251 */ 252 drawOrderViewDepth = 2, 253 } 254 /// 255 enum Constants : int 256 { 257 emissionShapePoint = 0, 258 paramInitialLinearVelocity = 0, 259 flagAlignYToVelocity = 0, 260 drawOrderIndex = 0, 261 flagRotateY = 1, 262 paramAngularVelocity = 1, 263 drawOrderLifetime = 1, 264 emissionShapeSphere = 1, 265 emissionShapeBox = 2, 266 drawOrderViewDepth = 2, 267 flagDisableZ = 2, 268 paramOrbitVelocity = 2, 269 flagMax = 3, 270 paramLinearAccel = 3, 271 emissionShapePoints = 3, 272 paramRadialAccel = 4, 273 emissionShapeDirectedPoints = 4, 274 paramTangentialAccel = 5, 275 emissionShapeMax = 5, 276 paramDamping = 6, 277 paramAngle = 7, 278 paramScale = 8, 279 paramHueVariation = 9, 280 paramAnimSpeed = 10, 281 paramAnimOffset = 11, 282 paramMax = 12, 283 } 284 /** 285 286 */ 287 void _updateRenderThread() 288 { 289 Array _GODOT_args = Array.make(); 290 String _GODOT_method_name = String("_update_render_thread"); 291 this.callv(_GODOT_method_name, _GODOT_args); 292 } 293 /** 294 Sets this node's properties to match a given $(D Particles) node with an assigned $(D ParticlesMaterial). 295 */ 296 void convertFromParticles(Node particles) 297 { 298 checkClassBinding!(typeof(this))(); 299 ptrcall!(void)(GDNativeClassBinding.convertFromParticles, _godot_object, particles); 300 } 301 /** 302 303 */ 304 long getAmount() const 305 { 306 checkClassBinding!(typeof(this))(); 307 return ptrcall!(long)(GDNativeClassBinding.getAmount, _godot_object); 308 } 309 /** 310 311 */ 312 Color getColor() const 313 { 314 checkClassBinding!(typeof(this))(); 315 return ptrcall!(Color)(GDNativeClassBinding.getColor, _godot_object); 316 } 317 /** 318 319 */ 320 Ref!Gradient getColorRamp() const 321 { 322 checkClassBinding!(typeof(this))(); 323 return ptrcall!(Gradient)(GDNativeClassBinding.getColorRamp, _godot_object); 324 } 325 /** 326 327 */ 328 Vector3 getDirection() const 329 { 330 checkClassBinding!(typeof(this))(); 331 return ptrcall!(Vector3)(GDNativeClassBinding.getDirection, _godot_object); 332 } 333 /** 334 335 */ 336 CPUParticles.DrawOrder getDrawOrder() const 337 { 338 checkClassBinding!(typeof(this))(); 339 return ptrcall!(CPUParticles.DrawOrder)(GDNativeClassBinding.getDrawOrder, _godot_object); 340 } 341 /** 342 343 */ 344 Vector3 getEmissionBoxExtents() const 345 { 346 checkClassBinding!(typeof(this))(); 347 return ptrcall!(Vector3)(GDNativeClassBinding.getEmissionBoxExtents, _godot_object); 348 } 349 /** 350 351 */ 352 PoolColorArray getEmissionColors() const 353 { 354 checkClassBinding!(typeof(this))(); 355 return ptrcall!(PoolColorArray)(GDNativeClassBinding.getEmissionColors, _godot_object); 356 } 357 /** 358 359 */ 360 PoolVector3Array getEmissionNormals() const 361 { 362 checkClassBinding!(typeof(this))(); 363 return ptrcall!(PoolVector3Array)(GDNativeClassBinding.getEmissionNormals, _godot_object); 364 } 365 /** 366 367 */ 368 PoolVector3Array getEmissionPoints() const 369 { 370 checkClassBinding!(typeof(this))(); 371 return ptrcall!(PoolVector3Array)(GDNativeClassBinding.getEmissionPoints, _godot_object); 372 } 373 /** 374 375 */ 376 CPUParticles.EmissionShape getEmissionShape() const 377 { 378 checkClassBinding!(typeof(this))(); 379 return ptrcall!(CPUParticles.EmissionShape)(GDNativeClassBinding.getEmissionShape, _godot_object); 380 } 381 /** 382 383 */ 384 double getEmissionSphereRadius() const 385 { 386 checkClassBinding!(typeof(this))(); 387 return ptrcall!(double)(GDNativeClassBinding.getEmissionSphereRadius, _godot_object); 388 } 389 /** 390 391 */ 392 double getExplosivenessRatio() const 393 { 394 checkClassBinding!(typeof(this))(); 395 return ptrcall!(double)(GDNativeClassBinding.getExplosivenessRatio, _godot_object); 396 } 397 /** 398 399 */ 400 long getFixedFps() const 401 { 402 checkClassBinding!(typeof(this))(); 403 return ptrcall!(long)(GDNativeClassBinding.getFixedFps, _godot_object); 404 } 405 /** 406 407 */ 408 double getFlatness() const 409 { 410 checkClassBinding!(typeof(this))(); 411 return ptrcall!(double)(GDNativeClassBinding.getFlatness, _godot_object); 412 } 413 /** 414 415 */ 416 bool getFractionalDelta() const 417 { 418 checkClassBinding!(typeof(this))(); 419 return ptrcall!(bool)(GDNativeClassBinding.getFractionalDelta, _godot_object); 420 } 421 /** 422 423 */ 424 Vector3 getGravity() const 425 { 426 checkClassBinding!(typeof(this))(); 427 return ptrcall!(Vector3)(GDNativeClassBinding.getGravity, _godot_object); 428 } 429 /** 430 431 */ 432 double getLifetime() const 433 { 434 checkClassBinding!(typeof(this))(); 435 return ptrcall!(double)(GDNativeClassBinding.getLifetime, _godot_object); 436 } 437 /** 438 439 */ 440 double getLifetimeRandomness() const 441 { 442 checkClassBinding!(typeof(this))(); 443 return ptrcall!(double)(GDNativeClassBinding.getLifetimeRandomness, _godot_object); 444 } 445 /** 446 447 */ 448 Ref!Mesh getMesh() const 449 { 450 checkClassBinding!(typeof(this))(); 451 return ptrcall!(Mesh)(GDNativeClassBinding.getMesh, _godot_object); 452 } 453 /** 454 455 */ 456 bool getOneShot() const 457 { 458 checkClassBinding!(typeof(this))(); 459 return ptrcall!(bool)(GDNativeClassBinding.getOneShot, _godot_object); 460 } 461 /** 462 Returns the base value of the parameter specified by $(D parameter). 463 */ 464 double getParam(in long param) const 465 { 466 checkClassBinding!(typeof(this))(); 467 return ptrcall!(double)(GDNativeClassBinding.getParam, _godot_object, param); 468 } 469 /** 470 Returns the $(D Curve) of the parameter specified by $(D parameter). 471 */ 472 Ref!Curve getParamCurve(in long param) const 473 { 474 checkClassBinding!(typeof(this))(); 475 return ptrcall!(Curve)(GDNativeClassBinding.getParamCurve, _godot_object, param); 476 } 477 /** 478 Returns the randomness factor of the parameter specified by $(D parameter). 479 */ 480 double getParamRandomness(in long param) const 481 { 482 checkClassBinding!(typeof(this))(); 483 return ptrcall!(double)(GDNativeClassBinding.getParamRandomness, _godot_object, param); 484 } 485 /** 486 Returns the enabled state of the given flag (see $(D flags) for options). 487 */ 488 bool getParticleFlag(in long flag) const 489 { 490 checkClassBinding!(typeof(this))(); 491 return ptrcall!(bool)(GDNativeClassBinding.getParticleFlag, _godot_object, flag); 492 } 493 /** 494 495 */ 496 double getPreProcessTime() const 497 { 498 checkClassBinding!(typeof(this))(); 499 return ptrcall!(double)(GDNativeClassBinding.getPreProcessTime, _godot_object); 500 } 501 /** 502 503 */ 504 double getRandomnessRatio() const 505 { 506 checkClassBinding!(typeof(this))(); 507 return ptrcall!(double)(GDNativeClassBinding.getRandomnessRatio, _godot_object); 508 } 509 /** 510 511 */ 512 double getSpeedScale() const 513 { 514 checkClassBinding!(typeof(this))(); 515 return ptrcall!(double)(GDNativeClassBinding.getSpeedScale, _godot_object); 516 } 517 /** 518 519 */ 520 double getSpread() const 521 { 522 checkClassBinding!(typeof(this))(); 523 return ptrcall!(double)(GDNativeClassBinding.getSpread, _godot_object); 524 } 525 /** 526 527 */ 528 bool getUseLocalCoordinates() const 529 { 530 checkClassBinding!(typeof(this))(); 531 return ptrcall!(bool)(GDNativeClassBinding.getUseLocalCoordinates, _godot_object); 532 } 533 /** 534 535 */ 536 bool isEmitting() const 537 { 538 checkClassBinding!(typeof(this))(); 539 return ptrcall!(bool)(GDNativeClassBinding.isEmitting, _godot_object); 540 } 541 /** 542 Restarts the particle emitter. 543 */ 544 void restart() 545 { 546 checkClassBinding!(typeof(this))(); 547 ptrcall!(void)(GDNativeClassBinding.restart, _godot_object); 548 } 549 /** 550 551 */ 552 void setAmount(in long amount) 553 { 554 checkClassBinding!(typeof(this))(); 555 ptrcall!(void)(GDNativeClassBinding.setAmount, _godot_object, amount); 556 } 557 /** 558 559 */ 560 void setColor(in Color color) 561 { 562 checkClassBinding!(typeof(this))(); 563 ptrcall!(void)(GDNativeClassBinding.setColor, _godot_object, color); 564 } 565 /** 566 567 */ 568 void setColorRamp(Gradient ramp) 569 { 570 checkClassBinding!(typeof(this))(); 571 ptrcall!(void)(GDNativeClassBinding.setColorRamp, _godot_object, ramp); 572 } 573 /** 574 575 */ 576 void setDirection(in Vector3 direction) 577 { 578 checkClassBinding!(typeof(this))(); 579 ptrcall!(void)(GDNativeClassBinding.setDirection, _godot_object, direction); 580 } 581 /** 582 583 */ 584 void setDrawOrder(in long order) 585 { 586 checkClassBinding!(typeof(this))(); 587 ptrcall!(void)(GDNativeClassBinding.setDrawOrder, _godot_object, order); 588 } 589 /** 590 591 */ 592 void setEmissionBoxExtents(in Vector3 extents) 593 { 594 checkClassBinding!(typeof(this))(); 595 ptrcall!(void)(GDNativeClassBinding.setEmissionBoxExtents, _godot_object, extents); 596 } 597 /** 598 599 */ 600 void setEmissionColors(in PoolColorArray array) 601 { 602 checkClassBinding!(typeof(this))(); 603 ptrcall!(void)(GDNativeClassBinding.setEmissionColors, _godot_object, array); 604 } 605 /** 606 607 */ 608 void setEmissionNormals(in PoolVector3Array array) 609 { 610 checkClassBinding!(typeof(this))(); 611 ptrcall!(void)(GDNativeClassBinding.setEmissionNormals, _godot_object, array); 612 } 613 /** 614 615 */ 616 void setEmissionPoints(in PoolVector3Array array) 617 { 618 checkClassBinding!(typeof(this))(); 619 ptrcall!(void)(GDNativeClassBinding.setEmissionPoints, _godot_object, array); 620 } 621 /** 622 623 */ 624 void setEmissionShape(in long shape) 625 { 626 checkClassBinding!(typeof(this))(); 627 ptrcall!(void)(GDNativeClassBinding.setEmissionShape, _godot_object, shape); 628 } 629 /** 630 631 */ 632 void setEmissionSphereRadius(in double radius) 633 { 634 checkClassBinding!(typeof(this))(); 635 ptrcall!(void)(GDNativeClassBinding.setEmissionSphereRadius, _godot_object, radius); 636 } 637 /** 638 639 */ 640 void setEmitting(in bool emitting) 641 { 642 checkClassBinding!(typeof(this))(); 643 ptrcall!(void)(GDNativeClassBinding.setEmitting, _godot_object, emitting); 644 } 645 /** 646 647 */ 648 void setExplosivenessRatio(in double ratio) 649 { 650 checkClassBinding!(typeof(this))(); 651 ptrcall!(void)(GDNativeClassBinding.setExplosivenessRatio, _godot_object, ratio); 652 } 653 /** 654 655 */ 656 void setFixedFps(in long fps) 657 { 658 checkClassBinding!(typeof(this))(); 659 ptrcall!(void)(GDNativeClassBinding.setFixedFps, _godot_object, fps); 660 } 661 /** 662 663 */ 664 void setFlatness(in double amount) 665 { 666 checkClassBinding!(typeof(this))(); 667 ptrcall!(void)(GDNativeClassBinding.setFlatness, _godot_object, amount); 668 } 669 /** 670 671 */ 672 void setFractionalDelta(in bool enable) 673 { 674 checkClassBinding!(typeof(this))(); 675 ptrcall!(void)(GDNativeClassBinding.setFractionalDelta, _godot_object, enable); 676 } 677 /** 678 679 */ 680 void setGravity(in Vector3 accel_vec) 681 { 682 checkClassBinding!(typeof(this))(); 683 ptrcall!(void)(GDNativeClassBinding.setGravity, _godot_object, accel_vec); 684 } 685 /** 686 687 */ 688 void setLifetime(in double secs) 689 { 690 checkClassBinding!(typeof(this))(); 691 ptrcall!(void)(GDNativeClassBinding.setLifetime, _godot_object, secs); 692 } 693 /** 694 695 */ 696 void setLifetimeRandomness(in double random) 697 { 698 checkClassBinding!(typeof(this))(); 699 ptrcall!(void)(GDNativeClassBinding.setLifetimeRandomness, _godot_object, random); 700 } 701 /** 702 703 */ 704 void setMesh(Mesh mesh) 705 { 706 checkClassBinding!(typeof(this))(); 707 ptrcall!(void)(GDNativeClassBinding.setMesh, _godot_object, mesh); 708 } 709 /** 710 711 */ 712 void setOneShot(in bool enable) 713 { 714 checkClassBinding!(typeof(this))(); 715 ptrcall!(void)(GDNativeClassBinding.setOneShot, _godot_object, enable); 716 } 717 /** 718 Sets the base value of the parameter specified by $(D parameter). 719 */ 720 void setParam(in long param, in double value) 721 { 722 checkClassBinding!(typeof(this))(); 723 ptrcall!(void)(GDNativeClassBinding.setParam, _godot_object, param, value); 724 } 725 /** 726 Sets the $(D Curve) of the parameter specified by $(D parameter). 727 */ 728 void setParamCurve(in long param, Curve curve) 729 { 730 checkClassBinding!(typeof(this))(); 731 ptrcall!(void)(GDNativeClassBinding.setParamCurve, _godot_object, param, curve); 732 } 733 /** 734 Sets the randomness factor of the parameter specified by $(D parameter). 735 */ 736 void setParamRandomness(in long param, in double randomness) 737 { 738 checkClassBinding!(typeof(this))(); 739 ptrcall!(void)(GDNativeClassBinding.setParamRandomness, _godot_object, param, randomness); 740 } 741 /** 742 Enables or disables the given flag (see $(D flags) for options). 743 */ 744 void setParticleFlag(in long flag, in bool enable) 745 { 746 checkClassBinding!(typeof(this))(); 747 ptrcall!(void)(GDNativeClassBinding.setParticleFlag, _godot_object, flag, enable); 748 } 749 /** 750 751 */ 752 void setPreProcessTime(in double secs) 753 { 754 checkClassBinding!(typeof(this))(); 755 ptrcall!(void)(GDNativeClassBinding.setPreProcessTime, _godot_object, secs); 756 } 757 /** 758 759 */ 760 void setRandomnessRatio(in double ratio) 761 { 762 checkClassBinding!(typeof(this))(); 763 ptrcall!(void)(GDNativeClassBinding.setRandomnessRatio, _godot_object, ratio); 764 } 765 /** 766 767 */ 768 void setSpeedScale(in double scale) 769 { 770 checkClassBinding!(typeof(this))(); 771 ptrcall!(void)(GDNativeClassBinding.setSpeedScale, _godot_object, scale); 772 } 773 /** 774 775 */ 776 void setSpread(in double degrees) 777 { 778 checkClassBinding!(typeof(this))(); 779 ptrcall!(void)(GDNativeClassBinding.setSpread, _godot_object, degrees); 780 } 781 /** 782 783 */ 784 void setUseLocalCoordinates(in bool enable) 785 { 786 checkClassBinding!(typeof(this))(); 787 ptrcall!(void)(GDNativeClassBinding.setUseLocalCoordinates, _godot_object, enable); 788 } 789 /** 790 The number of particles emitted in one emission cycle (corresponding to the $(D lifetime)). 791 $(B Note:) Changing $(D amount) will reset the particle emission, therefore removing all particles that were already emitted before changing $(D amount). 792 */ 793 @property long amount() 794 { 795 return getAmount(); 796 } 797 /// ditto 798 @property void amount(long v) 799 { 800 setAmount(v); 801 } 802 /** 803 Initial rotation applied to each particle, in degrees. 804 */ 805 @property double angle() 806 { 807 return getParam(7); 808 } 809 /// ditto 810 @property void angle(double v) 811 { 812 setParam(7, v); 813 } 814 /** 815 Each particle's rotation will be animated along this $(D Curve). 816 */ 817 @property Curve angleCurve() 818 { 819 return getParamCurve(7); 820 } 821 /// ditto 822 @property void angleCurve(Curve v) 823 { 824 setParamCurve(7, v); 825 } 826 /** 827 Rotation randomness ratio. 828 */ 829 @property double angleRandom() 830 { 831 return getParamRandomness(7); 832 } 833 /// ditto 834 @property void angleRandom(double v) 835 { 836 setParamRandomness(7, v); 837 } 838 /** 839 Initial angular velocity applied to each particle. Sets the speed of rotation of the particle. 840 */ 841 @property double angularVelocity() 842 { 843 return getParam(1); 844 } 845 /// ditto 846 @property void angularVelocity(double v) 847 { 848 setParam(1, v); 849 } 850 /** 851 Each particle's angular velocity will vary along this $(D Curve). 852 */ 853 @property Curve angularVelocityCurve() 854 { 855 return getParamCurve(1); 856 } 857 /// ditto 858 @property void angularVelocityCurve(Curve v) 859 { 860 setParamCurve(1, v); 861 } 862 /** 863 Angular velocity randomness ratio. 864 */ 865 @property double angularVelocityRandom() 866 { 867 return getParamRandomness(1); 868 } 869 /// ditto 870 @property void angularVelocityRandom(double v) 871 { 872 setParamRandomness(1, v); 873 } 874 /** 875 Particle animation offset. 876 */ 877 @property double animOffset() 878 { 879 return getParam(11); 880 } 881 /// ditto 882 @property void animOffset(double v) 883 { 884 setParam(11, v); 885 } 886 /** 887 Each particle's animation offset will vary along this $(D Curve). 888 */ 889 @property Curve animOffsetCurve() 890 { 891 return getParamCurve(11); 892 } 893 /// ditto 894 @property void animOffsetCurve(Curve v) 895 { 896 setParamCurve(11, v); 897 } 898 /** 899 Animation offset randomness ratio. 900 */ 901 @property double animOffsetRandom() 902 { 903 return getParamRandomness(11); 904 } 905 /// ditto 906 @property void animOffsetRandom(double v) 907 { 908 setParamRandomness(11, v); 909 } 910 /** 911 Particle animation speed. 912 */ 913 @property double animSpeed() 914 { 915 return getParam(10); 916 } 917 /// ditto 918 @property void animSpeed(double v) 919 { 920 setParam(10, v); 921 } 922 /** 923 Each particle's animation speed will vary along this $(D Curve). 924 */ 925 @property Curve animSpeedCurve() 926 { 927 return getParamCurve(10); 928 } 929 /// ditto 930 @property void animSpeedCurve(Curve v) 931 { 932 setParamCurve(10, v); 933 } 934 /** 935 Animation speed randomness ratio. 936 */ 937 @property double animSpeedRandom() 938 { 939 return getParamRandomness(10); 940 } 941 /// ditto 942 @property void animSpeedRandom(double v) 943 { 944 setParamRandomness(10, v); 945 } 946 /** 947 Unused for 3D particles. 948 */ 949 @property Color color() 950 { 951 return getColor(); 952 } 953 /// ditto 954 @property void color(Color v) 955 { 956 setColor(v); 957 } 958 /** 959 Unused for 3D particles. 960 */ 961 @property Gradient colorRamp() 962 { 963 return getColorRamp(); 964 } 965 /// ditto 966 @property void colorRamp(Gradient v) 967 { 968 setColorRamp(v); 969 } 970 /** 971 The rate at which particles lose velocity. 972 */ 973 @property double damping() 974 { 975 return getParam(6); 976 } 977 /// ditto 978 @property void damping(double v) 979 { 980 setParam(6, v); 981 } 982 /** 983 Damping will vary along this $(D Curve). 984 */ 985 @property Curve dampingCurve() 986 { 987 return getParamCurve(6); 988 } 989 /// ditto 990 @property void dampingCurve(Curve v) 991 { 992 setParamCurve(6, v); 993 } 994 /** 995 Damping randomness ratio. 996 */ 997 @property double dampingRandom() 998 { 999 return getParamRandomness(6); 1000 } 1001 /// ditto 1002 @property void dampingRandom(double v) 1003 { 1004 setParamRandomness(6, v); 1005 } 1006 /** 1007 Unit vector specifying the particles' emission direction. 1008 */ 1009 @property Vector3 direction() 1010 { 1011 return getDirection(); 1012 } 1013 /// ditto 1014 @property void direction(Vector3 v) 1015 { 1016 setDirection(v); 1017 } 1018 /** 1019 Particle draw order. Uses $(D draworder) values. 1020 */ 1021 @property CPUParticles.DrawOrder drawOrder() 1022 { 1023 return getDrawOrder(); 1024 } 1025 /// ditto 1026 @property void drawOrder(long v) 1027 { 1028 setDrawOrder(v); 1029 } 1030 /** 1031 The rectangle's extents if $(D emissionShape) is set to $(D constant EMISSION_SHAPE_BOX). 1032 */ 1033 @property Vector3 emissionBoxExtents() 1034 { 1035 return getEmissionBoxExtents(); 1036 } 1037 /// ditto 1038 @property void emissionBoxExtents(Vector3 v) 1039 { 1040 setEmissionBoxExtents(v); 1041 } 1042 /** 1043 Sets the $(D Color)s to modulate particles by when using $(D constant EMISSION_SHAPE_POINTS) or $(D constant EMISSION_SHAPE_DIRECTED_POINTS). 1044 */ 1045 @property PoolColorArray emissionColors() 1046 { 1047 return getEmissionColors(); 1048 } 1049 /// ditto 1050 @property void emissionColors(PoolColorArray v) 1051 { 1052 setEmissionColors(v); 1053 } 1054 /** 1055 Sets the direction the particles will be emitted in when using $(D constant EMISSION_SHAPE_DIRECTED_POINTS). 1056 */ 1057 @property PoolVector3Array emissionNormals() 1058 { 1059 return getEmissionNormals(); 1060 } 1061 /// ditto 1062 @property void emissionNormals(PoolVector3Array v) 1063 { 1064 setEmissionNormals(v); 1065 } 1066 /** 1067 Sets the initial positions to spawn particles when using $(D constant EMISSION_SHAPE_POINTS) or $(D constant EMISSION_SHAPE_DIRECTED_POINTS). 1068 */ 1069 @property PoolVector3Array emissionPoints() 1070 { 1071 return getEmissionPoints(); 1072 } 1073 /// ditto 1074 @property void emissionPoints(PoolVector3Array v) 1075 { 1076 setEmissionPoints(v); 1077 } 1078 /** 1079 Particles will be emitted inside this region. See $(D emissionshape) for possible values. 1080 */ 1081 @property CPUParticles.EmissionShape emissionShape() 1082 { 1083 return getEmissionShape(); 1084 } 1085 /// ditto 1086 @property void emissionShape(long v) 1087 { 1088 setEmissionShape(v); 1089 } 1090 /** 1091 The sphere's radius if $(D emissionshape) is set to $(D constant EMISSION_SHAPE_SPHERE). 1092 */ 1093 @property double emissionSphereRadius() 1094 { 1095 return getEmissionSphereRadius(); 1096 } 1097 /// ditto 1098 @property void emissionSphereRadius(double v) 1099 { 1100 setEmissionSphereRadius(v); 1101 } 1102 /** 1103 If `true`, particles are being emitted. 1104 */ 1105 @property bool emitting() 1106 { 1107 return isEmitting(); 1108 } 1109 /// ditto 1110 @property void emitting(bool v) 1111 { 1112 setEmitting(v); 1113 } 1114 /** 1115 How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. 1116 */ 1117 @property double explosiveness() 1118 { 1119 return getExplosivenessRatio(); 1120 } 1121 /// ditto 1122 @property void explosiveness(double v) 1123 { 1124 setExplosivenessRatio(v); 1125 } 1126 /** 1127 The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. 1128 */ 1129 @property long fixedFps() 1130 { 1131 return getFixedFps(); 1132 } 1133 /// ditto 1134 @property void fixedFps(long v) 1135 { 1136 setFixedFps(v); 1137 } 1138 /** 1139 Align Y axis of particle with the direction of its velocity. 1140 */ 1141 @property bool flagAlignY() 1142 { 1143 return getParticleFlag(0); 1144 } 1145 /// ditto 1146 @property void flagAlignY(bool v) 1147 { 1148 setParticleFlag(0, v); 1149 } 1150 /** 1151 If `true`, particles will not move on the z axis. 1152 */ 1153 @property bool flagDisableZ() 1154 { 1155 return getParticleFlag(2); 1156 } 1157 /// ditto 1158 @property void flagDisableZ(bool v) 1159 { 1160 setParticleFlag(2, v); 1161 } 1162 /** 1163 If `true`, particles rotate around Y axis by $(D angle). 1164 */ 1165 @property bool flagRotateY() 1166 { 1167 return getParticleFlag(1); 1168 } 1169 /// ditto 1170 @property void flagRotateY(bool v) 1171 { 1172 setParticleFlag(1, v); 1173 } 1174 /** 1175 Amount of $(D spread) in Y/Z plane. A value of `1` restricts particles to X/Z plane. 1176 */ 1177 @property double flatness() 1178 { 1179 return getFlatness(); 1180 } 1181 /// ditto 1182 @property void flatness(double v) 1183 { 1184 setFlatness(v); 1185 } 1186 /** 1187 If `true`, results in fractional delta calculation which has a smoother particles display effect. 1188 */ 1189 @property bool fractDelta() 1190 { 1191 return getFractionalDelta(); 1192 } 1193 /// ditto 1194 @property void fractDelta(bool v) 1195 { 1196 setFractionalDelta(v); 1197 } 1198 /** 1199 Gravity applied to every particle. 1200 */ 1201 @property Vector3 gravity() 1202 { 1203 return getGravity(); 1204 } 1205 /// ditto 1206 @property void gravity(Vector3 v) 1207 { 1208 setGravity(v); 1209 } 1210 /** 1211 Initial hue variation applied to each particle. 1212 */ 1213 @property double hueVariation() 1214 { 1215 return getParam(9); 1216 } 1217 /// ditto 1218 @property void hueVariation(double v) 1219 { 1220 setParam(9, v); 1221 } 1222 /** 1223 Each particle's hue will vary along this $(D Curve). 1224 */ 1225 @property Curve hueVariationCurve() 1226 { 1227 return getParamCurve(9); 1228 } 1229 /// ditto 1230 @property void hueVariationCurve(Curve v) 1231 { 1232 setParamCurve(9, v); 1233 } 1234 /** 1235 Hue variation randomness ratio. 1236 */ 1237 @property double hueVariationRandom() 1238 { 1239 return getParamRandomness(9); 1240 } 1241 /// ditto 1242 @property void hueVariationRandom(double v) 1243 { 1244 setParamRandomness(9, v); 1245 } 1246 /** 1247 Initial velocity magnitude for each particle. Direction comes from $(D spread) and the node's orientation. 1248 */ 1249 @property double initialVelocity() 1250 { 1251 return getParam(0); 1252 } 1253 /// ditto 1254 @property void initialVelocity(double v) 1255 { 1256 setParam(0, v); 1257 } 1258 /** 1259 Initial velocity randomness ratio. 1260 */ 1261 @property double initialVelocityRandom() 1262 { 1263 return getParamRandomness(0); 1264 } 1265 /// ditto 1266 @property void initialVelocityRandom(double v) 1267 { 1268 setParamRandomness(0, v); 1269 } 1270 /** 1271 The amount of time each particle will exist (in seconds). 1272 */ 1273 @property double lifetime() 1274 { 1275 return getLifetime(); 1276 } 1277 /// ditto 1278 @property void lifetime(double v) 1279 { 1280 setLifetime(v); 1281 } 1282 /** 1283 Particle lifetime randomness ratio. 1284 */ 1285 @property double lifetimeRandomness() 1286 { 1287 return getLifetimeRandomness(); 1288 } 1289 /// ditto 1290 @property void lifetimeRandomness(double v) 1291 { 1292 setLifetimeRandomness(v); 1293 } 1294 /** 1295 Linear acceleration applied to each particle in the direction of motion. 1296 */ 1297 @property double linearAccel() 1298 { 1299 return getParam(3); 1300 } 1301 /// ditto 1302 @property void linearAccel(double v) 1303 { 1304 setParam(3, v); 1305 } 1306 /** 1307 Each particle's linear acceleration will vary along this $(D Curve). 1308 */ 1309 @property Curve linearAccelCurve() 1310 { 1311 return getParamCurve(3); 1312 } 1313 /// ditto 1314 @property void linearAccelCurve(Curve v) 1315 { 1316 setParamCurve(3, v); 1317 } 1318 /** 1319 Linear acceleration randomness ratio. 1320 */ 1321 @property double linearAccelRandom() 1322 { 1323 return getParamRandomness(3); 1324 } 1325 /// ditto 1326 @property void linearAccelRandom(double v) 1327 { 1328 setParamRandomness(3, v); 1329 } 1330 /** 1331 If `true`, particles use the parent node's coordinate space. If `false`, they use global coordinates. 1332 */ 1333 @property bool localCoords() 1334 { 1335 return getUseLocalCoordinates(); 1336 } 1337 /// ditto 1338 @property void localCoords(bool v) 1339 { 1340 setUseLocalCoordinates(v); 1341 } 1342 /** 1343 The $(D Mesh) used for each particle. If `null`, particles will be spheres. 1344 */ 1345 @property Mesh mesh() 1346 { 1347 return getMesh(); 1348 } 1349 /// ditto 1350 @property void mesh(Mesh v) 1351 { 1352 setMesh(v); 1353 } 1354 /** 1355 If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. 1356 */ 1357 @property bool oneShot() 1358 { 1359 return getOneShot(); 1360 } 1361 /// ditto 1362 @property void oneShot(bool v) 1363 { 1364 setOneShot(v); 1365 } 1366 /** 1367 Orbital velocity applied to each particle. Makes the particles circle around origin in the local XY plane. Specified in number of full rotations around origin per second. 1368 This property is only available when $(D flagDisableZ) is `true`. 1369 */ 1370 @property double orbitVelocity() 1371 { 1372 return getParam(2); 1373 } 1374 /// ditto 1375 @property void orbitVelocity(double v) 1376 { 1377 setParam(2, v); 1378 } 1379 /** 1380 Each particle's orbital velocity will vary along this $(D Curve). 1381 */ 1382 @property Curve orbitVelocityCurve() 1383 { 1384 return getParamCurve(2); 1385 } 1386 /// ditto 1387 @property void orbitVelocityCurve(Curve v) 1388 { 1389 setParamCurve(2, v); 1390 } 1391 /** 1392 Orbital velocity randomness ratio. 1393 */ 1394 @property double orbitVelocityRandom() 1395 { 1396 return getParamRandomness(2); 1397 } 1398 /// ditto 1399 @property void orbitVelocityRandom(double v) 1400 { 1401 setParamRandomness(2, v); 1402 } 1403 /** 1404 Particle system starts as if it had already run for this many seconds. 1405 */ 1406 @property double preprocess() 1407 { 1408 return getPreProcessTime(); 1409 } 1410 /// ditto 1411 @property void preprocess(double v) 1412 { 1413 setPreProcessTime(v); 1414 } 1415 /** 1416 Radial acceleration applied to each particle. Makes particle accelerate away from origin. 1417 */ 1418 @property double radialAccel() 1419 { 1420 return getParam(4); 1421 } 1422 /// ditto 1423 @property void radialAccel(double v) 1424 { 1425 setParam(4, v); 1426 } 1427 /** 1428 Each particle's radial acceleration will vary along this $(D Curve). 1429 */ 1430 @property Curve radialAccelCurve() 1431 { 1432 return getParamCurve(4); 1433 } 1434 /// ditto 1435 @property void radialAccelCurve(Curve v) 1436 { 1437 setParamCurve(4, v); 1438 } 1439 /** 1440 Radial acceleration randomness ratio. 1441 */ 1442 @property double radialAccelRandom() 1443 { 1444 return getParamRandomness(4); 1445 } 1446 /// ditto 1447 @property void radialAccelRandom(double v) 1448 { 1449 setParamRandomness(4, v); 1450 } 1451 /** 1452 Emission lifetime randomness ratio. 1453 */ 1454 @property double randomness() 1455 { 1456 return getRandomnessRatio(); 1457 } 1458 /// ditto 1459 @property void randomness(double v) 1460 { 1461 setRandomnessRatio(v); 1462 } 1463 /** 1464 Initial scale applied to each particle. 1465 */ 1466 @property double scaleAmount() 1467 { 1468 return getParam(8); 1469 } 1470 /// ditto 1471 @property void scaleAmount(double v) 1472 { 1473 setParam(8, v); 1474 } 1475 /** 1476 Each particle's scale will vary along this $(D Curve). 1477 */ 1478 @property Curve scaleAmountCurve() 1479 { 1480 return getParamCurve(8); 1481 } 1482 /// ditto 1483 @property void scaleAmountCurve(Curve v) 1484 { 1485 setParamCurve(8, v); 1486 } 1487 /** 1488 Scale randomness ratio. 1489 */ 1490 @property double scaleAmountRandom() 1491 { 1492 return getParamRandomness(8); 1493 } 1494 /// ditto 1495 @property void scaleAmountRandom(double v) 1496 { 1497 setParamRandomness(8, v); 1498 } 1499 /** 1500 Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. 1501 */ 1502 @property double speedScale() 1503 { 1504 return getSpeedScale(); 1505 } 1506 /// ditto 1507 @property void speedScale(double v) 1508 { 1509 setSpeedScale(v); 1510 } 1511 /** 1512 Each particle's initial direction range from `+spread` to `-spread` degrees. Applied to X/Z plane and Y/Z planes. 1513 */ 1514 @property double spread() 1515 { 1516 return getSpread(); 1517 } 1518 /// ditto 1519 @property void spread(double v) 1520 { 1521 setSpread(v); 1522 } 1523 /** 1524 Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. 1525 */ 1526 @property double tangentialAccel() 1527 { 1528 return getParam(5); 1529 } 1530 /// ditto 1531 @property void tangentialAccel(double v) 1532 { 1533 setParam(5, v); 1534 } 1535 /** 1536 Each particle's tangential acceleration will vary along this $(D Curve). 1537 */ 1538 @property Curve tangentialAccelCurve() 1539 { 1540 return getParamCurve(5); 1541 } 1542 /// ditto 1543 @property void tangentialAccelCurve(Curve v) 1544 { 1545 setParamCurve(5, v); 1546 } 1547 /** 1548 Tangential acceleration randomness ratio. 1549 */ 1550 @property double tangentialAccelRandom() 1551 { 1552 return getParamRandomness(5); 1553 } 1554 /// ditto 1555 @property void tangentialAccelRandom(double v) 1556 { 1557 setParamRandomness(5, v); 1558 } 1559 }