Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-08-21 10:05:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-08-21 10:09:18 +0300
commitc727fc59abe2b7e525bdc6594bbd7ec3285936e0 (patch)
treedfcadf23e28c2464655f4c06a5f94621721fe0c2 /source/blender/blenkernel/intern/particle_system.c
parenta98b02ff941edb1d92892f520641433582754f0d (diff)
BVH-raycast: ensure input direction is unit-length
This was already the case for most users of ray-cast. Doing this avoids 2x normalize calls per ray-cast in many places.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index e340a0ade94..8b925fff415 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2594,7 +2594,7 @@ static int collision_detect(ParticleData *pa, ParticleCollision *col, BVHTreeRay
sub_v3_v3v3(ray_dir, col->co2, col->co1);
hit->index = -1;
- hit->dist = col->original_ray_length = len_v3(ray_dir);
+ hit->dist = col->original_ray_length = normalize_v3(ray_dir);
col->pce.inside = 0;
/* even if particle is stationary we want to check for moving colliders */