Welcome to mirror list, hosted at ThFree Co, Russian Federation.

particles.h « scene « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2cf3ed656c693e27b675553090583979351b38a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#ifndef __PARTICLES_H__
#define __PARTICLES_H__

#include "util/array.h"
#include "util/types.h"

#include "graph/node.h"

CCL_NAMESPACE_BEGIN

class Device;
class DeviceScene;
class Progress;
class Scene;

/* Particle System */

struct Particle {
  int index;
  float age;
  float lifetime;
  float3 location;
  float4 rotation;
  float size;
  float3 velocity;
  float3 angular_velocity;
};

class ParticleSystem : public Node {
 public:
  NODE_DECLARE

  ParticleSystem();
  ~ParticleSystem();

  void tag_update(Scene *scene);

  array<Particle> particles;
};

/* ParticleSystem Manager */

class ParticleSystemManager {
  bool need_update_;

 public:
  ParticleSystemManager();
  ~ParticleSystemManager();

  void device_update_particles(Device *device,
                               DeviceScene *dscene,
                               Scene *scene,
                               Progress &progress);
  void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress);
  void device_free(Device *device, DeviceScene *dscene);

  void tag_update(Scene *scene);

  bool need_update() const;
};

CCL_NAMESPACE_END

#endif /* __PARTICLES_H__ */