X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_particle%2Fplant.cpp;h=2ae6e7b74df01aa8f6a65362f2f7081a8076b255;hb=a08fceee694fe4adf35a99f968f42fc84c27dd20;hp=69816f6fa7768ba82e367246cf38108c0387559f;hpb=16b3beced25134bef064705568ecb893a6be4e79;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_particle/plant.cpp b/synfig-core/trunk/src/modules/mod_particle/plant.cpp index 69816f6..2ae6e7b 100644 --- a/synfig-core/trunk/src/modules/mod_particle/plant.cpp +++ b/synfig-core/trunk/src/modules/mod_particle/plant.cpp @@ -1,20 +1,21 @@ -/* === S I N F G =========================================================== */ +/* === S Y N F I G ========================================================= */ /*! \file bline.cpp ** \brief Template ** ** $Id: plant.cpp,v 1.2 2005/01/13 06:48:39 darco Exp $ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -28,23 +29,23 @@ # include #endif -#include +#include #include "plant.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include -#include +#include #endif @@ -55,18 +56,18 @@ using namespace etl; #define SAMPLES 300 #define ROUND_END_FACTOR (4) #define CUSP_THRESHOLD (0.15) -#define NO_LOOP_COOKIE sinfg::Vector(84951305,7836658) +#define NO_LOOP_COOKIE synfig::Vector(84951305,7836658) #define EPSILON (0.000000001) #define CUSP_TANGENT_ADJUST (0.025) /* === G L O B A L S ======================================================= */ -SINFG_LAYER_INIT(Plant); -SINFG_LAYER_SET_NAME(Plant,"plant"); -SINFG_LAYER_SET_LOCAL_NAME(Plant,_("Plant")); -SINFG_LAYER_SET_CATEGORY(Plant,_("Particle Systems")); -SINFG_LAYER_SET_VERSION(Plant,"0.1"); -SINFG_LAYER_SET_CVS_ID(Plant,"$Id: plant.cpp,v 1.2 2005/01/13 06:48:39 darco Exp $"); +SYNFIG_LAYER_INIT(Plant); +SYNFIG_LAYER_SET_NAME(Plant,"plant"); +SYNFIG_LAYER_SET_LOCAL_NAME(Plant,_("Plant")); +SYNFIG_LAYER_SET_CATEGORY(Plant,_("Particle Systems")); +SYNFIG_LAYER_SET_VERSION(Plant,"0.1"); +SYNFIG_LAYER_SET_CVS_ID(Plant,"$Id: plant.cpp,v 1.2 2005/01/13 06:48:39 darco Exp $"); /* === P R O C E D U R E S ================================================= */ @@ -106,7 +107,7 @@ Plant::Plant(): } void -Plant::branch(int n,int depth,float t, float stunt_growth, sinfg::Point position,sinfg::Vector vel)const +Plant::branch(int n,int depth,float t, float stunt_growth, synfig::Point position,synfig::Vector vel)const { float next_split((1.0-t)/(splits-depth)+t/*+random_factor*random(40+depth,t*splits,0,0)/splits*/); for(;t=1.0-stunt_growth)return; - sinfg::Real sin_v=sinfg::Angle::cos(split_angle).get(); - sinfg::Real cos_v=sinfg::Angle::sin(split_angle).get(); + synfig::Real sin_v=synfig::Angle::cos(split_angle).get(); + synfig::Real cos_v=synfig::Angle::sin(split_angle).get(); - sinfg::Vector velocity1(vel[0]*sin_v-vel[1]*cos_v+random_factor*random(2,30+n+depth,t*splits,0.0f,0.0f),vel[0]*cos_v+vel[1]*sin_v+random_factor*random(2,32+n+depth,t*splits,0.0f,0.0f)); - sinfg::Vector velocity2(vel[0]*sin_v+vel[1]*cos_v+random_factor*random(2,31+n+depth,t*splits,0.0f,0.0f),-vel[0]*cos_v+vel[1]*sin_v+random_factor*random(2,33+n+depth,t*splits,0.0f,0.0f)); + synfig::Vector velocity1(vel[0]*sin_v-vel[1]*cos_v+random_factor*random(2,30+n+depth,t*splits,0.0f,0.0f),vel[0]*cos_v+vel[1]*sin_v+random_factor*random(2,32+n+depth,t*splits,0.0f,0.0f)); + synfig::Vector velocity2(vel[0]*sin_v+vel[1]*cos_v+random_factor*random(2,31+n+depth,t*splits,0.0f,0.0f),-vel[0]*cos_v+vel[1]*sin_v+random_factor*random(2,33+n+depth,t*splits,0.0f,0.0f)); Plant::branch(n,depth+1,t,stunt_growth,position,velocity1); Plant::branch(n,depth+1,t,stunt_growth,position,velocity2); @@ -139,7 +140,7 @@ Plant::branch(int n,int depth,float t, float stunt_growth, sinfg::Point position void Plant::calc_bounding_rect()const { - std::vector::const_iterator iter,next; + std::vector::const_iterator iter,next; bounding_rect=Rect::zero(); @@ -179,7 +180,7 @@ Plant::sync()const if(bline.size()<=2) return; - std::vector::const_iterator iter,next; + std::vector::const_iterator iter,next; etl::hermite curve;