35 using bke::GeometryInstanceGroup;
43 if (!position_attribute) {
50 for (
const float3 &position : positions) {
64 if (volume ==
nullptr) {
69 openvdb::GridBase::ConstPtr grid = BKE_volume_grid_openvdb_for_read(volume, volume_grid);
72 openvdb::GridBase::ConstPtr instance_grid = BKE_volume_grid_shallow_transform(grid,
76 if (BKE_volume_grid_bounds(instance_grid, grid_min, grid_max)) {
83 UNUSED_VARS(volume_component, transforms, r_min, r_max);
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
#define GEO_NODE_BOUNDING_BOX
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
const VolumeGrid * BKE_volume_grid_get_for_read(const struct Volume *volume, int grid_index)
int BKE_volume_num_grids(const struct Volume *volume)
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
static uint8 component(Color32 c, uint i)
NSNotificationCenter * center
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
const Volume * get_for_read() const
void geometry_set_gather_instances(const GeometrySet &geometry_set, Vector< GeometryInstanceGroup > &r_instance_groups)
std::unique_ptr< ReadAttribute > ReadAttributePtr
void transform_mesh(Mesh *mesh, const float3 translation, const float3 rotation, const float3 scale)
static void compute_geometry_set_instances_boundbox(const GeometrySet &geometry_set, float3 &r_min, float3 &r_max)
static void geo_node_bounding_box_exec(GeoNodeExecParams params)
static void compute_min_max_from_volume_and_transforms(const VolumeComponent &volume_component, Span< float4x4 > transforms, float3 &r_min, float3 &r_max)
Mesh * create_cube_mesh(const float size)
static void compute_min_max_from_position_and_transform(const GeometryComponent &component, Span< float4x4 > transforms, float3 &r_min, float3 &r_max)
static bNodeSocketTemplate geo_node_bounding_box_out[]
static bNodeSocketTemplate geo_node_bounding_box_in[]
void register_node_type_geo_bounding_box()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
void compute_boundbox_without_instances(blender::float3 *r_min, blender::float3 *r_max) const
static GeometrySet create_with_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
bool has(const GeometryComponentType component_type) const
const GeometryComponent * get_component_for_read(GeometryComponentType component_type) const
bool has_instances() const
Compact definition of a node socket.
NodeGeometryExecFunction geometry_node_execute