Blender V4.3
scene/pointcloud.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#ifndef __POINTCLOUD_H__
8# define __POINTCLOUD_H__
9
10# include "scene/geometry.h"
11
13
14class PointCloud : public Geometry {
15 public:
17
18 /* PointCloud Point */
19 struct Point {
20 int index;
21
22 void bounds_grow(const float3 *points, const float *radius, BoundBox &bounds) const;
23 void bounds_grow(const float3 *points,
24 const float *radius,
25 const Transform &aligned_space,
26 BoundBox &bounds) const;
27 void bounds_grow(const float4 &point, BoundBox &bounds) const;
28
29 float4 motion_key(const float3 *points,
30 const float *radius,
31 const float4 *point_steps,
32 size_t num_points,
33 size_t num_steps,
34 float time,
35 size_t p) const;
36 float4 point_for_step(const float3 *points,
37 const float *radius,
38 const float4 *point_steps,
39 size_t num_points,
40 size_t num_steps,
41 size_t step,
42 size_t p) const;
43 };
44
48
49 /* Constructor/Destructor */
50 PointCloud();
52
53 /* Geometry */
54 void clear(const bool preserver_shaders = false) override;
55
56 void resize(int numpoints);
57 void reserve(int numpoints);
58 void add_point(float3 loc, float radius, int shader = 0);
59
61
62 void compute_bounds() override;
63 void apply_transform(const Transform &tfm, const bool apply_to_motion) override;
64
65 /* Points */
66 Point get_point(int i) const
67 {
68 Point point = {i};
69 return point;
70 }
71
72 size_t num_points() const
73 {
74 return points.size();
75 }
76
77 size_t num_attributes() const
78 {
79 return 1;
80 }
81
82 /* UDIM */
83 void get_uv_tiles(ustring map, unordered_set<int> &tiles) override;
84
85 PrimitiveType primitive_type() const override;
86
87 /* BVH */
88 void pack(Scene *scene, float4 *packed_points, uint *packed_shader);
89
90 private:
91 friend class BVH2;
92 friend class BVHBuild;
93 friend class BVHSpatialSplit;
94 friend class DiagSplit;
95 friend class EdgeDice;
96 friend class GeometryManager;
97 friend class ObjectManager;
98};
99
101
102#endif /* __POINTCLOUD_H__ */
unsigned int uint
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Definition bvh2.h:36
BoundBox bounds
int motion_step(float time) const
#define CCL_NAMESPACE_END
#define NODE_SOCKET_API_ARRAY(type_, name)
Definition graph/node.h:63
ccl_gpu_kernel_postfix ccl_global KernelWorkTile * tiles
PrimitiveType
#define NODE_DECLARE
Definition node_type.h:142
float4 motion_key(const float3 *points, const float *radius, const float4 *point_steps, size_t num_points, size_t num_steps, float time, size_t p) const
void bounds_grow(const float3 *points, const float *radius, BoundBox &bounds) const
float4 point_for_step(const float3 *points, const float *radius, const float4 *point_steps, size_t num_points, size_t num_steps, size_t step, size_t p) const
size_t num_attributes() const
void pack(Scene *scene, float4 *packed_points, uint *packed_shader)
void reserve(int numpoints)
void clear(const bool preserver_shaders=false) override
void apply_transform(const Transform &tfm, const bool apply_to_motion) override
Point get_point(int i) const
void get_uv_tiles(ustring map, unordered_set< int > &tiles) override
size_t num_points() const
void resize(int numpoints)
void copy_center_to_motion_step(const int motion_step)
void compute_bounds() override
PrimitiveType primitive_type() const override
void add_point(float3 loc, float radius, int shader=0)