Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/mathutils/mathutils_bvhtree.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| lt = BKE_mesh_runtime_looptri_ensure(mesh); | lt = BKE_mesh_runtime_looptri_ensure(mesh); | ||||
| tris_len = (uint)BKE_mesh_runtime_looptri_len(mesh); | tris_len = (uint)BKE_mesh_runtime_looptri_len(mesh); | ||||
| coords_len = (uint)mesh->totvert; | coords_len = (uint)mesh->totvert; | ||||
| coords = MEM_mallocN(sizeof(*coords) * (size_t)coords_len, __func__); | coords = MEM_mallocN(sizeof(*coords) * (size_t)coords_len, __func__); | ||||
| tris = MEM_mallocN(sizeof(*tris) * (size_t)tris_len, __func__); | tris = MEM_mallocN(sizeof(*tris) * (size_t)tris_len, __func__); | ||||
| const MVert *verts = BKE_mesh_verts(mesh); | const float(*positions)[3] = BKE_mesh_positions(mesh); | ||||
| for (int i = 0; i < mesh->totvert; i++) { | for (int i = 0; i < mesh->totvert; i++) { | ||||
| copy_v3_v3(coords[i], verts[i].co); | copy_v3_v3(coords[i], positions[i]); | ||||
| } | } | ||||
| mloop = BKE_mesh_loops(mesh); | mloop = BKE_mesh_loops(mesh); | ||||
| } | } | ||||
| { | { | ||||
| BVHTree *tree; | BVHTree *tree; | ||||
| uint i; | uint i; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||