- view bounds (now split from collision bounds) was still being used for bge physics in one place, comparison was incorrectly treating it as a flag too.
- cleanup Object struct - remove pad and unused flags, convert some shot's to char's, saving 24 bytes.
This commit is contained in:
@@ -1107,7 +1107,6 @@ Object *add_only_object(int type, const char *name)
|
|||||||
ob->obstacleRad = 1.;
|
ob->obstacleRad = 1.;
|
||||||
|
|
||||||
/* NT fluid sim defaults */
|
/* NT fluid sim defaults */
|
||||||
ob->fluidsimFlag = 0;
|
|
||||||
ob->fluidsimSettings = NULL;
|
ob->fluidsimSettings = NULL;
|
||||||
|
|
||||||
ob->pc_ids.first = ob->pc_ids.last = NULL;
|
ob->pc_ids.first = ob->pc_ids.last = NULL;
|
||||||
|
|||||||
@@ -8245,7 +8245,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
if(main->versionfile <= 233) {
|
if(main->versionfile <= 233) {
|
||||||
bScreen *sc;
|
bScreen *sc;
|
||||||
Material *ma= main->mat.first;
|
Material *ma= main->mat.first;
|
||||||
Object *ob= main->object.first;
|
/* Object *ob= main->object.first; */
|
||||||
|
|
||||||
while(ma) {
|
while(ma) {
|
||||||
if(ma->rampfac_col==0.0f) ma->rampfac_col= 1.0;
|
if(ma->rampfac_col==0.0f) ma->rampfac_col= 1.0;
|
||||||
@@ -8255,11 +8255,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* this should have been done loooong before! */
|
/* this should have been done loooong before! */
|
||||||
|
#if 0 /* deprecated in 2.5+ */
|
||||||
while(ob) {
|
while(ob) {
|
||||||
if(ob->ipowin==0) ob->ipowin= ID_OB;
|
if(ob->ipowin==0) ob->ipowin= ID_OB;
|
||||||
ob= ob->id.next;
|
ob= ob->id.next;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
for (sc= main->screen.first; sc; sc= sc->id.next) {
|
for (sc= main->screen.first; sc; sc= sc->id.next) {
|
||||||
ScrArea *sa;
|
ScrArea *sa;
|
||||||
for (sa= sc->areabase.first; sa; sa= sa->next) {
|
for (sa= sc->areabase.first; sa; sa= sa->next) {
|
||||||
|
|||||||
@@ -1182,7 +1182,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
|
|||||||
base->object->min_vel= ob->min_vel;
|
base->object->min_vel= ob->min_vel;
|
||||||
base->object->max_vel= ob->max_vel;
|
base->object->max_vel= ob->max_vel;
|
||||||
if (ob->gameflag & OB_BOUNDS) {
|
if (ob->gameflag & OB_BOUNDS) {
|
||||||
base->object->boundtype = ob->boundtype;
|
base->object->collision_boundtype = ob->collision_boundtype;
|
||||||
}
|
}
|
||||||
base->object->margin= ob->margin;
|
base->object->margin= ob->margin;
|
||||||
base->object->bsoft= copy_bulletsoftbody(ob->bsoft);
|
base->object->bsoft= copy_bulletsoftbody(ob->bsoft);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
((vd->drawtype==OB_TEXTURE && dt>OB_SOLID) || \
|
((vd->drawtype==OB_TEXTURE && dt>OB_SOLID) || \
|
||||||
(vd->drawtype==OB_SOLID && vd->flag2 & V3D_SOLID_TEX))
|
(vd->drawtype==OB_SOLID && vd->flag2 & V3D_SOLID_TEX))
|
||||||
|
|
||||||
static void draw_bounding_volume(Scene *scene, Object *ob, short type);
|
static void draw_bounding_volume(Scene *scene, Object *ob, char type);
|
||||||
|
|
||||||
static void drawcube_size(float size);
|
static void drawcube_size(float size);
|
||||||
static void drawcircle_size(float size);
|
static void drawcircle_size(float size);
|
||||||
@@ -5469,7 +5469,7 @@ static void get_local_bounds(Object *ob, float center[3], float size[3])
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void draw_bb_quadric(BoundBox *bb, short type)
|
static void draw_bb_quadric(BoundBox *bb, char type)
|
||||||
{
|
{
|
||||||
float size[3], cent[3];
|
float size[3], cent[3];
|
||||||
GLUquadricObj *qobj = gluNewQuadric();
|
GLUquadricObj *qobj = gluNewQuadric();
|
||||||
@@ -5508,7 +5508,7 @@ static void draw_bb_quadric(BoundBox *bb, short type)
|
|||||||
gluDeleteQuadric(qobj);
|
gluDeleteQuadric(qobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_bounding_volume(Scene *scene, Object *ob, short type)
|
static void draw_bounding_volume(Scene *scene, Object *ob, char type)
|
||||||
{
|
{
|
||||||
BoundBox *bb= NULL;
|
BoundBox *bb= NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -164,8 +164,9 @@ typedef struct Object {
|
|||||||
short transflag, protectflag; /* transformation settings and transform locks */
|
short transflag, protectflag; /* transformation settings and transform locks */
|
||||||
short trackflag, upflag;
|
short trackflag, upflag;
|
||||||
short nlaflag, ipoflag; // xxx depreceated... old animation system
|
short nlaflag, ipoflag; // xxx depreceated... old animation system
|
||||||
short ipowin, scaflag; /* ipowin: blocktype last ipowindow */
|
short scaflag; /* ipowin: blocktype last ipowindow */
|
||||||
short scavisflag, boundtype;
|
char scavisflag;
|
||||||
|
char pad5;
|
||||||
|
|
||||||
int dupon, dupoff, dupsta, dupend;
|
int dupon, dupoff, dupsta, dupend;
|
||||||
|
|
||||||
@@ -193,12 +194,16 @@ typedef struct Object {
|
|||||||
float min_vel; /* clamp the maximum velocity 0.0 is disabled */
|
float min_vel; /* clamp the maximum velocity 0.0 is disabled */
|
||||||
float m_contactProcessingThreshold;
|
float m_contactProcessingThreshold;
|
||||||
float obstacleRad;
|
float obstacleRad;
|
||||||
char pad0[4];
|
|
||||||
|
|
||||||
short rotmode; /* rotation mode - uses defines set out in DNA_action_types.h for PoseChannel rotations... */
|
short rotmode; /* rotation mode - uses defines set out in DNA_action_types.h for PoseChannel rotations... */
|
||||||
|
|
||||||
|
char boundtype; /* bounding box use for drawing */
|
||||||
|
char collision_boundtype; /* bounding box type used for collision */
|
||||||
|
|
||||||
|
char restrictflag; /* for restricting view, select, render etc. accessible in outliner */
|
||||||
|
|
||||||
char dt, dtx;
|
char dt, dtx;
|
||||||
char empty_drawtype, pad1[3];
|
char empty_drawtype;
|
||||||
float empty_drawsize;
|
float empty_drawsize;
|
||||||
float dupfacesca; /* dupliface scale */
|
float dupfacesca; /* dupliface scale */
|
||||||
|
|
||||||
@@ -243,14 +248,10 @@ typedef struct Object {
|
|||||||
struct SoftBody *soft; /* if exists, saved in file */
|
struct SoftBody *soft; /* if exists, saved in file */
|
||||||
struct Group *dup_group; /* object duplicator for group */
|
struct Group *dup_group; /* object duplicator for group */
|
||||||
|
|
||||||
short fluidsimFlag; /* NT toggle fluidsim participation on/off */
|
char body_type; /* for now used to temporarily holds the type of collision object */
|
||||||
|
char shapeflag; /* flag for pinning */
|
||||||
short restrictflag; /* for restricting view, select, render etc. accessible in outliner */
|
short shapenr; /* current shape key for menu or pinned */
|
||||||
|
|
||||||
short shapenr, shapeflag; /* current shape key for menu or pinned, flag for pinning */
|
|
||||||
float smoothresh; /* smoothresh is phong interpolation ray_shadow correction in render */
|
float smoothresh; /* smoothresh is phong interpolation ray_shadow correction in render */
|
||||||
short recalco; /* recalco for temp storage of ob->recalc, bad design warning */
|
|
||||||
short body_type; /* for now used to temporarily holds the type of collision object */
|
|
||||||
|
|
||||||
struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store additional settings */
|
struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store additional settings */
|
||||||
|
|
||||||
@@ -265,9 +266,6 @@ typedef struct Object {
|
|||||||
ListBase *duplilist; /* for temporary dupli list storage, only for use by RNA API */
|
ListBase *duplilist; /* for temporary dupli list storage, only for use by RNA API */
|
||||||
|
|
||||||
float ima_ofs[2]; /* offset for image empties */
|
float ima_ofs[2]; /* offset for image empties */
|
||||||
|
|
||||||
short collision_boundtype; /* bounding box type used for collision */
|
|
||||||
char pad3[6];
|
|
||||||
} Object;
|
} Object;
|
||||||
|
|
||||||
/* Warning, this is not used anymore because hooks are now modifiers */
|
/* Warning, this is not used anymore because hooks are now modifiers */
|
||||||
|
|||||||
@@ -1648,7 +1648,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
objprop.m_concave = (blenderobject->boundtype & 4) != 0;
|
objprop.m_concave = (blenderobject->collision_boundtype == OB_BOUND_TRIANGLE_MESH);
|
||||||
|
|
||||||
switch (physics_engine)
|
switch (physics_engine)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user