Use BOUNDBOX_DIRTY to mark BB as need to be updated

This commit is contained in:
Sergey Sharybin
2013-08-19 08:03:40 +00:00
parent e326d2de67
commit cfe7349f4e
5 changed files with 11 additions and 11 deletions

View File

@@ -391,7 +391,7 @@ void BKE_curve_boundbox_calc(Curve *cu, float r_loc[3], float r_size[3])
BKE_boundbox_init_from_minmax(bb, min, max);
bb->flag &= ~BOUNDBOX_INVALID;
bb->flag &= ~BOUNDBOX_DIRTY;
}
BoundBox *BKE_curve_boundbox_get(Object *ob)
@@ -401,7 +401,7 @@ BoundBox *BKE_curve_boundbox_get(Object *ob)
if (ob->bb)
return ob->bb;
if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_INVALID)) {
if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_DIRTY)) {
BKE_curve_texspace_calc(cu);
}
@@ -430,7 +430,7 @@ void BKE_curve_texspace_calc(Curve *cu)
void BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_rot[3], float r_size[3])
{
if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_INVALID)) {
if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_DIRTY)) {
BKE_curve_texspace_calc(cu);
}

View File

@@ -658,7 +658,7 @@ void BKE_mesh_boundbox_calc(Mesh *me, float r_loc[3], float r_size[3])
BKE_boundbox_init_from_minmax(bb, min, max);
bb->flag &= ~BOUNDBOX_INVALID;
bb->flag &= ~BOUNDBOX_DIRTY;
}
void BKE_mesh_texspace_calc(Mesh *me)
@@ -688,7 +688,7 @@ BoundBox *BKE_mesh_boundbox_get(Object *ob)
if (ob->bb)
return ob->bb;
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_INVALID)) {
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) {
BKE_mesh_texspace_calc(me);
}
@@ -697,7 +697,7 @@ BoundBox *BKE_mesh_boundbox_get(Object *ob)
void BKE_mesh_texspace_get(Mesh *me, float r_loc[3], float r_rot[3], float r_size[3])
{
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_INVALID)) {
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) {
BKE_mesh_texspace_calc(me);
}

View File

@@ -259,14 +259,14 @@ void BKE_object_free_derived_caches(Object *ob)
Mesh *me = ob->data;
if (me->bb) {
me->bb->flag |= BOUNDBOX_INVALID;
me->bb->flag |= BOUNDBOX_DIRTY;
}
}
else if (ELEM3(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
Curve *cu = ob->data;
if (cu->bb) {
cu->bb->flag |= BOUNDBOX_INVALID;
cu->bb->flag |= BOUNDBOX_DIRTY;
}
}

View File

@@ -102,7 +102,7 @@ typedef struct BoundBox {
/* boundbox flag */
enum {
BOUNDBOX_DISABLED = (1 << 0),
BOUNDBOX_INVALID = (1 << 1),
BOUNDBOX_DIRTY = (1 << 1),
};
typedef struct Object {

View File

@@ -575,7 +575,7 @@ static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3])
{
Mesh *me = (Mesh *)ptr->data;
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_INVALID)) {
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) {
BKE_mesh_texspace_calc(me);
}
@@ -586,7 +586,7 @@ static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float values[3])
{
Mesh *me = (Mesh *)ptr->data;
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_INVALID)) {
if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) {
BKE_mesh_texspace_calc(me);
}