void make_local_object(struct Object *ob);
void set_mblur_offs(float blur);
void disable_speed_curve(int val);
+
float bsystem_time(struct Object *ob, struct Object *par, float cfra, float ofs);
void object_to_mat3(struct Object *ob, float mat[][3]);
void object_to_mat4(struct Object *ob, float mat[][4]);
-void ob_parcurve(struct Object *ob, struct Object *par, float mat[][4]);
-void ob_parlimb(struct Object *ob, struct Object *par, float mat[][4]);
-void ob_parbone(struct Object *ob, struct Object *par, float mat[][4]); /* __NLA */
-void give_parvert(struct Object *par, int nr, float *vec);
-void ob_parvert3(struct Object *ob, struct Object *par, float mat[][4]);
+
void set_no_parent_ipo(int val);
-void set_dtime(int dtime);
+
void disable_where_script(short on);
int during_script(void);
void disable_where_scriptlink(short on);
int during_scriptlink(void);
+
void where_is_object_time(struct Object *ob, float ctime);
void where_is_object(struct Object *ob);
void where_is_object_simul(struct Object *ob);
for(i=0, eve= em->verts.first; eve; i++, eve=eve->next) {
float *no = emdm->vertexNos[i];
-
+ /* following Mesh convention; we use vertex coordinate itself for normal in this case */
if (Normalise(no)==0.0) {
VECCOPY(no, vertexCos[i]);
Normalise(no);
/* temp copy, to have ipos etc to work OK */
copyob= *ob;
+ /* don't want parent animation to apply on past object positions */
+ if(!(paf->flag & PAF_STATIC))
+ ob->parent= NULL;
+
for(a=0, pa= paf->keys, counter=0; a<paf->totpart; a++, pa+=paf->totkey, counter++) {
if(paf->flag & PAF_STATIC) {
//if(ctime < pa->time+pa->lifetime) {
- /* to give ipos in object correct offset */
+ /* to give ipos in object correct offset, ob->parent is NULLed */
where_is_object_time(ob, ctime-pa->time);
where_is_particle(paf, pa, ctime, vec);
if(paf->stype==PAF_VECT) {
- where_is_particle(paf, pa, ctime+1.0f, vec1);
- VecSubf(vec1, vec1, vec);
+ /* if particle died, we use previous position */
+ if(ctime > pa->time+pa->lifetime) {
+ where_is_particle(paf, pa, pa->time+pa->lifetime-1.0f, vec1);
+ VecSubf(vec1, vec, vec1);
+ }
+ else {
+ where_is_particle(paf, pa, ctime+1.0f, vec1);
+ VecSubf(vec1, vec1, vec);
+ }
q2= vectoquat(vec1, ob->trackflag, ob->upflag);
QuatToMat3(q2, mat);
int enable_cu_speed= 1;
-void ob_parcurve(Object *ob, Object *par, float mat[][4])
+static void ob_parcurve(Object *ob, Object *par, float mat[][4])
{
Curve *cu;
float q[4], vec[4], dir[3], *quat, x1, ctime;
}
}
-void ob_parbone(Object *ob, Object *par, float mat[][4])
+static void ob_parbone(Object *ob, Object *par, float mat[][4])
{
bPoseChannel *pchan;
bArmature *arm;
VecAddf(mat[3], mat[3], vec);
}
-void give_parvert(Object *par, int nr, float *vec)
+static void give_parvert(Object *par, int nr, float *vec)
{
EditMesh *em = G.editMesh;
EditVert *eve;
else return;
}
-void ob_parvert3(Object *ob, Object *par, float mat[][4])
+static void ob_parvert3(Object *ob, Object *par, float mat[][4])
{
float cmat[3][3], v1[3], v2[3], v3[3], q[4];
no_parent_ipo= val;
}
-static float timefac= 1.0; /* 50 Hz, dtime:2 */
-void set_dtime(int dtime)
-{
- timefac= ((float)(dtime-1))/2.0f;
-}
-
static int during_script_flag=0;
void disable_where_script(short on)
{
if(ob->partype & PARSLOW) {
// include framerate
- fac1= (float)(timefac/(1.0+ fabs(ob->sf)));
+ fac1= (1.0f/(1.0f+ fabs(ob->sf)));
if(fac1>=1.0) return;
fac2= 1.0f-fac1;
EditFaceC *efac=NULL;
EditSelectionC *esec=NULL;
TFace *tface= NULL;
- int i, a;
+ int a;
um= MEM_callocN(sizeof(UndoMesh), "undomesh");
VecAddf(efa->v3->no, efa->v3->no, efa->n);
}
+ /* following Mesh convention; we use vertex coordinate itself for normal in this case */
for(eve= em->verts.first; eve; eve=eve->next) {
if (Normalise(eve->no)==0.0) {
VECCOPY(eve->no, eve->co);