Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/particles.h
| Show All 11 Lines | |||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #ifndef __PARTICLES_H__ | #ifndef __PARTICLES_H__ | ||||
| #define __PARTICLES_H__ | #define __PARTICLES_H__ | ||||
| #include "util/util_api.h" | |||||
| #include "util/util_array.h" | #include "util/util_array.h" | ||||
| #include "util/util_types.h" | #include "util/util_types.h" | ||||
| #include "graph/node.h" | #include "graph/node.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| class Device; | class Device; | ||||
| Show All 10 Lines | struct Particle { | ||||
| float3 location; | float3 location; | ||||
| float4 rotation; | float4 rotation; | ||||
| float size; | float size; | ||||
| float3 velocity; | float3 velocity; | ||||
| float3 angular_velocity; | float3 angular_velocity; | ||||
| }; | }; | ||||
| class ParticleSystem : public Node { | class ParticleSystem : public Node { | ||||
| GET(array<Particle>, particles) | |||||
| public: | public: | ||||
| NODE_DECLARE | NODE_DECLARE | ||||
| ParticleSystem(); | ParticleSystem(); | ||||
| ~ParticleSystem(); | ~ParticleSystem(); | ||||
| void tag_update(Scene *scene); | void clear() | ||||
| { | |||||
| particles.clear(); | |||||
| } | |||||
| void add_particle(const Particle &pa) | |||||
| { | |||||
| particles.push_back_slow(pa); | |||||
| } | |||||
| array<Particle> particles; | void tag_update(Scene *scene); | ||||
| }; | }; | ||||
| /* ParticleSystem Manager */ | /* ParticleSystem Manager */ | ||||
| class ParticleSystemManager { | class ParticleSystemManager { | ||||
| public: | public: | ||||
| bool need_update; | bool need_update; | ||||
| Show All 16 Lines | |||||