Blender  V2.93
particles.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __PARTICLES_H__
18 #define __PARTICLES_H__
19 
20 #include "util/util_array.h"
21 #include "util/util_types.h"
22 
23 #include "graph/node.h"
24 
26 
27 class Device;
28 class DeviceScene;
29 class Progress;
30 class Scene;
31 
32 /* Particle System */
33 
34 struct Particle {
35  int index;
36  float age;
37  float lifetime;
39  float4 rotation;
40  float size;
43 };
44 
45 class ParticleSystem : public Node {
46  public:
48 
51 
52  void tag_update(Scene *scene);
53 
55 };
56 
57 /* ParticleSystem Manager */
58 
60  bool need_update_;
61 
62  public:
65 
66  void device_update_particles(Device *device,
67  DeviceScene *dscene,
68  Scene *scene,
69  Progress &progress);
70  void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress);
71  void device_free(Device *device, DeviceScene *dscene);
72 
73  void tag_update(Scene *scene);
74 
75  bool need_update() const;
76 };
77 
79 
80 #endif /* __PARTICLES_H__ */
Definition: device.h:293
void device_free(Device *device, DeviceScene *dscene)
Definition: particles.cpp:134
void tag_update(Scene *scene)
Definition: particles.cpp:139
bool need_update() const
Definition: particles.cpp:144
void device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
Definition: particles.cpp:107
void device_update_particles(Device *device, DeviceScene *dscene, Scene *scene, Progress &progress)
Definition: particles.cpp:63
Scene scene
#define CCL_NAMESPACE_END
#define NODE_DECLARE
Definition: node_type.h:148
Definition: node.h:98
array< Particle > particles
Definition: particles.h:54
NODE_DECLARE ParticleSystem()
Definition: particles.cpp:39
void tag_update(Scene *scene)
Definition: particles.cpp:47
float age
Definition: particles.h:36
float lifetime
float3 location
Definition: particles.h:38
float size
Definition: particles.h:40
float4 rotation
Definition: particles.h:39
float3 velocity
Definition: particles.h:41
float3 angular_velocity
Definition: particles.h:42
int index
Definition: particles.h:35