Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/effect.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| if (nearest.index != -1) { | if (nearest.index != -1) { | ||||
| copy_v3_v3(surface_co, nearest.co); | copy_v3_v3(surface_co, nearest.co); | ||||
| if (surface_nor) { | if (surface_nor) { | ||||
| copy_v3_v3(surface_nor, nearest.no); | copy_v3_v3(surface_nor, nearest.no); | ||||
| } | } | ||||
| if (surface_vel) { | if (surface_vel) { | ||||
| const MLoop *mloop = bvhtree->loop; | const int *corner_verts = bvhtree->corner_verts; | ||||
| const MLoopTri *lt = &bvhtree->looptri[nearest.index]; | const MLoopTri *lt = &bvhtree->looptri[nearest.index]; | ||||
| copy_v3_v3(surface_vel, surmd->runtime.vert_velocities[mloop[lt->tri[0]].v]); | copy_v3_v3(surface_vel, surmd->runtime.vert_velocities[corner_verts[lt->tri[0]]]); | ||||
| add_v3_v3(surface_vel, surmd->runtime.vert_velocities[mloop[lt->tri[1]].v]); | add_v3_v3(surface_vel, surmd->runtime.vert_velocities[corner_verts[lt->tri[1]]]); | ||||
| add_v3_v3(surface_vel, surmd->runtime.vert_velocities[mloop[lt->tri[2]].v]); | add_v3_v3(surface_vel, surmd->runtime.vert_velocities[corner_verts[lt->tri[2]]]); | ||||
| mul_v3_fl(surface_vel, (1.0f / 3.0f)); | mul_v3_fl(surface_vel, (1.0f / 3.0f)); | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||