18 # include <openvdb/openvdb.h>
127 const float3 limited_scale = {
128 (scale.
x == 0.0f) ? FLT_EPSILON : scale.
x,
129 (scale.
y == 0.0f) ? FLT_EPSILON : scale.
y,
130 (scale.
z == 0.0f) ? FLT_EPSILON : scale.
z,
138 openvdb::Mat4s vdb_matrix;
139 memcpy(vdb_matrix.asPointer(), matrix,
sizeof(
float[4][4]));
140 openvdb::Mat4d vdb_matrix_d{vdb_matrix};
146 openvdb::GridBase::Ptr grid = BKE_volume_grid_openvdb_for_write(volume, volume_grid,
false);
148 grid_transform.postMult(vdb_matrix_d);
182 params.set_output(
"Geometry", std::move(geometry_set));
void BKE_mesh_calc_normals(struct Mesh *me)
void BKE_mesh_transform(struct Mesh *me, const float mat[4][4], bool do_keys)
void BKE_mesh_translate(struct Mesh *me, const float offset[3], const bool do_keys)
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
#define GEO_NODE_TRANSFORM
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
VolumeGrid * BKE_volume_grid_get_for_write(struct Volume *volume, int grid_index)
int BKE_volume_num_grids(const struct Volume *volume)
bool BKE_volume_load(const struct Volume *volume, const struct Main *bmain)
MINLINE int compare_ff(float a, float b, const float max_diff)
MINLINE void add_v3_v3(float r[3], const float a[3])
struct Main * DEG_get_bmain(const Depsgraph *graph)
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
blender::Span< blender::float4x4 > transforms() const
void transform_mesh(Mesh *mesh, const float3 translation, const float3 rotation, const float3 scale)
static void transform_instances(InstancesComponent &instances, const float3 translation, const float3 rotation, const float3 scale)
static void geo_node_transform_exec(GeoNodeExecParams params)
static void transform_pointcloud(PointCloud *pointcloud, const float3 translation, const float3 rotation, const float3 scale)
static void transform_volume(Volume *volume, const float3 translation, const float3 rotation, const float3 scale, GeoNodeExecParams ¶ms)
static bool use_translate(const float3 rotation, const float3 scale)
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
PointCloud * get_pointcloud_for_write()
Mesh * get_mesh_for_write()
bool has_instances() const
Volume * get_volume_for_write()
bool has_pointcloud() const
Compact definition of a node socket.
NodeGeometryExecFunction geometry_node_execute
float length_squared() const
static float4x4 from_loc_eul_scale(const float3 location, const float3 rotation, const float3 scale)