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:
authorTon Roosendaal <ton@blender.org>2006-11-29 15:44:48 +0300
committerTon Roosendaal <ton@blender.org>2006-11-29 15:44:48 +0300
commit3b23677425b98193fe520c3c00539c984470974b (patch)
tree0f7ccb24b59a9948a5e23262aec65851630526ce /source/blender/blenkernel
parenteb03a578a30622ae3dea4f56201934bd0efa093b (diff)
Duplicator feature:
Vertex/Face/Frame duplication now draws using OpenGL display lists. Makes drawing go much faster (2-5 times, depending on size of duplicated object). This system uses boundbox checks too, so outside of view it draws faster. Note for face duplication: I've fixe a bug for incorrect alignment when the parent was rotated when a parenting happened, the 'inverse parent correction matrix' then messed up alignment. For face duplication it now works OK, but for vertex-dupli not... need a way to fix this backwards compatible.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_object.h1
-rw-r--r--source/blender/blenkernel/intern/anim.c8
-rw-r--r--source/blender/blenkernel/intern/object.c10
3 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index fde33723cc4..9ad20b6a586 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -109,6 +109,7 @@ void what_does_parent(struct Object *ob);
struct BoundBox *unit_boundbox(void);
void boundbox_set_from_min_max(struct BoundBox *bb, float min[3], float max[3]);
struct BoundBox *object_get_boundbox(struct Object *ob);
+void object_boundbox_flag(struct Object *ob, int flag, int set);
void minmax_object(struct Object *ob, float *min, float *max);
void solve_tracking (struct Object *ob, float targetmat[][4]);
void solve_constraints (struct Object *ob, short obtype, void *obdata, float ctime);
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 11099ac0d72..ad97128bb37 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -464,7 +464,7 @@ static void face_duplilist(ListBase *lb, Scene *sce, Object *par)
DerivedMesh *dm;
MFace *mface;
MVert *mvert;
- float pmat[4][4];
+ float pmat[4][4], imat[3][3];
int lay, totface, a;
Mat4CpyMat4(pmat, par->obmat);
@@ -499,6 +499,7 @@ static void face_duplilist(ListBase *lb, Scene *sce, Object *par)
if(ob==par) {
ob= base->object;
+ Mat3CpyMat4(imat, ob->parentinv);
/* mballs have a different dupli handling */
if(ob->type!=OB_MBALL) ob->flag |= OB_DONE; /* doesnt render */
@@ -508,7 +509,7 @@ static void face_duplilist(ListBase *lb, Scene *sce, Object *par)
float *v2= mvert[ mface[a].v2 ].co;
float *v3= mvert[ mface[a].v3 ].co;
float *v4= mface[a].v4?mvert[ mface[a].v4 ].co:NULL;
- float cent[3], quat[4], mat[3][3], tmat[4][4], obmat[4][4];
+ float cent[3], quat[4], mat[3][3], mat3[3][3], tmat[4][4], obmat[4][4];
/* translation */
if(v4)
@@ -534,6 +535,9 @@ static void face_duplilist(ListBase *lb, Scene *sce, Object *par)
Mat3MulFloat(mat[0], size);
}
+ Mat3CpyMat3(mat3, mat);
+ Mat3MulMat3(mat, imat, mat3);
+
Mat4CpyMat4(tmat, obmat);
Mat4MulMat43(obmat, tmat, mat);
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c75c2a0238c..abe7cd4d38d 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1890,6 +1890,16 @@ BoundBox *object_get_boundbox(Object *ob)
return bb;
}
+/* used to temporally disable/enable boundbox */
+void object_boundbox_flag(Object *ob, int flag, int set)
+{
+ BoundBox *bb= object_get_boundbox(ob);
+ if(bb) {
+ if(set) bb->flag |= flag;
+ else bb->flag &= ~flag;
+ }
+}
+
void minmax_object(Object *ob, float *min, float *max)
{
BoundBox bb;