Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_particleinstance.c
| Show First 20 Lines • Show All 409 Lines • ▼ Show 20 Lines | for (k = 0; k < totvert; k++) { | ||||
| if (p < psys->totpart) { | if (p < psys->totpart) { | ||||
| pa = psys->particles + p; | pa = psys->particles + p; | ||||
| } | } | ||||
| else { | else { | ||||
| ChildParticle *cpa = psys->child + (p - psys->totpart); | ChildParticle *cpa = psys->child + (p - psys->totpart); | ||||
| pa = psys->particles + (between ? cpa->pa[0] : cpa->parent); | pa = psys->particles + (between ? cpa->pa[0] : cpa->parent); | ||||
| } | } | ||||
| psys_mat_hair_to_global(sim.ob, sim.psmd->mesh_final, sim.psys->part->from, pa, hairmat); | psys_mat_hair_to_global(sim.ob, | ||||
| BKE_particle_modifier_mesh_final_get(sim.psmd), | |||||
| sim.psys->part->from, | |||||
| pa, | |||||
| hairmat); | |||||
| copy_m3_m4(mat, hairmat); | copy_m3_m4(mat, hairmat); | ||||
| /* to quaternion */ | /* to quaternion */ | ||||
| mat3_to_quat(frame, mat); | mat3_to_quat(frame, mat); | ||||
| if (pimd->rotation > 0.0f || pimd->random_rotation > 0.0f) { | if (pimd->rotation > 0.0f || pimd->random_rotation > 0.0f) { | ||||
| float angle = 2.0f * M_PI * | float angle = 2.0f * M_PI * | ||||
| (pimd->rotation + | (pimd->rotation + | ||||
| pimd->random_rotation * (psys_frand(psys, 19957323 + p) - 0.5f)); | pimd->random_rotation * (psys_frand(psys, 19957323 + p) - 0.5f)); | ||||
| ▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines | |||||