~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/intern/effect.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2007-05-17 11:47:59 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070517114759-yp4ybrnhp2u7pk66
Tags: 2.44-1
* New upstream release.
* Drop debian/patches/01_64bits_stupidity, not needed anymore: as of this
  version blender is 64 bits safe again. Adjust README.Debian accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*  effect.c
2
2
 * 
3
3
 * 
4
 
 * $Id: effect.c,v 1.105 2006/12/23 11:56:22 ton Exp $
 
4
 * $Id: effect.c,v 1.107 2007/04/04 13:18:28 campbellbarton Exp $
5
5
 *
6
6
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
7
7
 *
571
571
                        distance = VecLength(vect_to_vert);
572
572
 
573
573
                        Crossf(force_vec, ob->obmat[2], vect_to_vert);
574
 
                        Normalise(force_vec);
 
574
                        Normalize(force_vec);
575
575
 
576
576
                        /* Limit minimum distance to vertex so that */
577
577
                        /* the force is not too big */
867
867
        VECSUB(edge1, dv1, dv2);
868
868
                VECSUB(edge2, dv3, dv2);
869
869
                Crossf(d_nvect, edge2, edge1);
870
 
                n_mag = Normalise(d_nvect);
 
870
                n_mag = Normalize(d_nvect);
871
871
                dk_plane = INPR(d_nvect, nv1);
872
872
                dk_point1 = INPR(d_nvect,opco);
873
873
 
880
880
                d_i_co_above[0] = (d_intersect_co[0] + (0.001f * d_nvect[0]));
881
881
                d_i_co_above[1] = (d_intersect_co[1] + (0.001f * d_nvect[1]));
882
882
                d_i_co_above[2] = (d_intersect_co[2] + (0.001f * d_nvect[2]));
883
 
                mag_iv = Normalise(d_intersect_vect);
 
883
                mag_iv = Normalize(d_intersect_vect);
884
884
                VECCOPY(npco, d_intersect_co);
885
885
                
886
886
                VECSUB(vect_to_int, opco, d_intersect_co);
887
 
                first_dist = Normalise(vect_to_int);
 
887
                first_dist = Normalize(vect_to_int);
888
888
 
889
889
                /* Work out the lengths of time before and after collision*/
890
890
                time_before = (life*(first_dist / (mag_iv)));
2017
2017
                        cur= (int)floor(pa->time) + 1 ;         /* + 1 has a reason: (obmat/prevobmat) otherwise comet-tails start too late */
2018
2018
                        
2019
2019
                        if(cur <= paf_end) mcnow= mcache + cur - paf_sta;
2020
 
                        else mcnow= mcache + paf_end - paf_sta + 1;
 
2020
                        else mcnow= mcache + paf_end - paf_sta;
2021
2021
                        
2022
2022
                        if(cur > paf_sta) mcprev= mcnow-1;
2023
2023
                        else mcprev= mcache;
2045
2045
                                VECCOPY(vec, no);
2046
2046
                                Mat3MulVecfl(mcnow->imat, vec);
2047
2047
                        
2048
 
                                Normalise(vec);
 
2048
                                Normalize(vec);
2049
2049
                                VecMulf(vec, paf->normfac);
2050
2050
                                VECADD(pa->no, pa->no, vec);
2051
2051
                        }
2053
2053
                else {
2054
2054
                        if(paf->normfac!=0.0) {
2055
2055
                                VECCOPY(pa->no, no);
2056
 
                                Normalise(pa->no);
 
2056
                                Normalize(pa->no);
2057
2057
                                VecMulf(pa->no, paf->normfac);
2058
2058
                        }
2059
2059
                }