Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/lattice_deform_test.cc
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | static void test_lattice_deform_init(LatticeDeformTestContext *ctx, | ||||
| /* Generate random input data between -5 and 5. */ | /* Generate random input data between -5 and 5. */ | ||||
| ctx->coords = (float(*)[3])MEM_malloc_arrayN(sizeof(float[3]), num_items, __func__); | ctx->coords = (float(*)[3])MEM_malloc_arrayN(sizeof(float[3]), num_items, __func__); | ||||
| for (uint32_t index = 0; index < num_items; index++) { | for (uint32_t index = 0; index < num_items; index++) { | ||||
| ctx->coords[index][0] = (rng->get_float() - 0.5f) * 10; | ctx->coords[index][0] = (rng->get_float() - 0.5f) * 10; | ||||
| ctx->coords[index][1] = (rng->get_float() - 0.5f) * 10; | ctx->coords[index][1] = (rng->get_float() - 0.5f) * 10; | ||||
| ctx->coords[index][2] = (rng->get_float() - 0.5f) * 10; | ctx->coords[index][2] = (rng->get_float() - 0.5f) * 10; | ||||
| } | } | ||||
| IDType_ID_LT.init_data(&ctx->lattice.id); | IDType_ID_LT.init_data(&ctx->lattice.id); | ||||
| strcpy(ctx->lattice.id.name, "LTLattice"); | |||||
| IDType_ID_OB.init_data(&ctx->ob_lattice.id); | IDType_ID_OB.init_data(&ctx->ob_lattice.id); | ||||
| ctx->ob_lattice.type = OB_LATTICE; | ctx->ob_lattice.type = OB_LATTICE; | ||||
| ctx->ob_lattice.data = &ctx->lattice; | ctx->ob_lattice.data = &ctx->lattice; | ||||
| IDType_ID_OB.init_data(&ctx->ob_mesh.id); | IDType_ID_OB.init_data(&ctx->ob_mesh.id); | ||||
| IDType_ID_ME.init_data(&ctx->mesh.id); | IDType_ID_ME.init_data(&ctx->mesh.id); | ||||
| ctx->ob_mesh.type = OB_MESH; | ctx->ob_mesh.type = OB_MESH; | ||||
| ctx->ob_mesh.data = &ctx->mesh; | ctx->ob_mesh.data = &ctx->mesh; | ||||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||