forked from bartvdbraak/blender
moved source and text to american spelling
* colour -> color * centre -> center * normalise -> normalize * modelling -> modeling
This commit is contained in:
parent
203e6ed82b
commit
afdd54fa37
@ -389,9 +389,9 @@ processEvent(
|
|||||||
}
|
}
|
||||||
if (m_translation_settings[m_current_object].m_moving) {
|
if (m_translation_settings[m_current_object].m_moving) {
|
||||||
|
|
||||||
// project current objects bounding box centre into screen space.
|
// project current objects bounding box center into screen space.
|
||||||
// unproject mouse point into object space using z-value from
|
// unproject mouse point into object space using z-value from
|
||||||
// projected bounding box centre.
|
// projected bounding box center.
|
||||||
|
|
||||||
GHOST_Rect bounds;
|
GHOST_Rect bounds;
|
||||||
m_window->getClientBounds(bounds);
|
m_window->getClientBounds(bounds);
|
||||||
@ -612,9 +612,9 @@ InitOpenGl(
|
|||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|
||||||
// centre of the box + 3* depth of box
|
// center of the box + 3* depth of box
|
||||||
|
|
||||||
MT_Vector3 centre = (min + max) * 0.5;
|
MT_Vector3 center = (min + max) * 0.5;
|
||||||
MT_Vector3 diag = max - min;
|
MT_Vector3 diag = max - min;
|
||||||
|
|
||||||
float depth = diag.length();
|
float depth = diag.length();
|
||||||
@ -629,8 +629,8 @@ InitOpenGl(
|
|||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
gluLookAt(
|
gluLookAt(
|
||||||
centre.x(), centre.y(), centre.z() + distance*depth, //eye
|
center.x(), center.y(), center.z() + distance*depth, //eye
|
||||||
centre.x(), centre.y(), centre.z(), //centre
|
center.x(), center.y(), center.z(), //center
|
||||||
0.0, 1.0, 0.
|
0.0, 1.0, 0.
|
||||||
); /* up is in positive Y direction */
|
); /* up is in positive Y direction */
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ RecursiveTreeBuild(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// all of the nodes were on one side of the box centre
|
// all of the nodes were on one side of the box center
|
||||||
// I'm not sure if this case ever gets reached?
|
// I'm not sure if this case ever gets reached?
|
||||||
if (mid == 0 || mid == n)
|
if (mid == 0 || mid == n)
|
||||||
{
|
{
|
||||||
|
@ -107,9 +107,9 @@ init(MT_Vector3 min,MT_Vector3 max)
|
|||||||
/* Setup the view of the cube. */
|
/* Setup the view of the cube. */
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
|
||||||
// centre of the box + 3* depth of box
|
// center of the box + 3* depth of box
|
||||||
|
|
||||||
MT_Vector3 centre = (min + max) * 0.5;
|
MT_Vector3 center = (min + max) * 0.5;
|
||||||
MT_Vector3 diag = max - min;
|
MT_Vector3 diag = max - min;
|
||||||
|
|
||||||
float depth = diag.length();
|
float depth = diag.length();
|
||||||
@ -125,8 +125,8 @@ init(MT_Vector3 min,MT_Vector3 max)
|
|||||||
|
|
||||||
|
|
||||||
gluLookAt(
|
gluLookAt(
|
||||||
centre.x(), centre.y(), centre.z() + distance*depth, /* eye is at (0,0,5) */
|
center.x(), center.y(), center.z() + distance*depth, /* eye is at (0,0,5) */
|
||||||
centre.x(), centre.y(), centre.z(), /* center is at (0,0,0) */
|
center.x(), center.y(), center.z(), /* center is at (0,0,0) */
|
||||||
0.0, 1.0, 0.); /* up is in positive Y direction */
|
0.0, 1.0, 0.); /* up is in positive Y direction */
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -96,7 +96,7 @@ void make_editMesh(void);
|
|||||||
struct EditMesh;
|
struct EditMesh;
|
||||||
void free_editMesh(struct EditMesh *);
|
void free_editMesh(struct EditMesh *);
|
||||||
void free_editArmature(void);
|
void free_editArmature(void);
|
||||||
void docentre_new(void);
|
void docenter_new(void);
|
||||||
int saveover(char *str);
|
int saveover(char *str);
|
||||||
|
|
||||||
/* image.c */
|
/* image.c */
|
||||||
|
@ -142,7 +142,7 @@ Material defmaterial;
|
|||||||
void load_editMesh(void){}
|
void load_editMesh(void){}
|
||||||
void make_editMesh(void){}
|
void make_editMesh(void){}
|
||||||
void free_editMesh(struct EditMesh *em){}
|
void free_editMesh(struct EditMesh *em){}
|
||||||
void docentre_new(void){}
|
void docenter_new(void){}
|
||||||
int saveover(char *str){ return 0;}
|
int saveover(char *str){ return 0;}
|
||||||
|
|
||||||
/* image.c */
|
/* image.c */
|
||||||
|
@ -1001,9 +1001,9 @@ static DerivedMesh *getEditMeshDerivedMesh(EditMesh *em, Object *ob,
|
|||||||
float *no = emdm->vertexNos[i];
|
float *no = emdm->vertexNos[i];
|
||||||
/* following Mesh convention; we use vertex coordinate itself
|
/* following Mesh convention; we use vertex coordinate itself
|
||||||
* for normal in this case */
|
* for normal in this case */
|
||||||
if (Normalise(no)==0.0) {
|
if (Normalize(no)==0.0) {
|
||||||
VECCOPY(no, vertexCos[i]);
|
VECCOPY(no, vertexCos[i]);
|
||||||
Normalise(no);
|
Normalize(no);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2498,7 +2498,7 @@ void writeBobjgz(char *filename, struct Object *ob, int useGlobalCoords, int app
|
|||||||
EulToMat3(ob->rot, rotmat);
|
EulToMat3(ob->rot, rotmat);
|
||||||
for(i=0; i<wri;i++) {
|
for(i=0; i<wri;i++) {
|
||||||
VECCOPY(vec, mvert[i].no);
|
VECCOPY(vec, mvert[i].no);
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
if(useGlobalCoords) { Mat3MulVecfl(rotmat, vec); }
|
if(useGlobalCoords) { Mat3MulVecfl(rotmat, vec); }
|
||||||
for(j=0; j<3; j++) {
|
for(j=0; j<3; j++) {
|
||||||
wrf = vec[j];
|
wrf = vec[j];
|
||||||
|
@ -438,7 +438,7 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan)
|
|||||||
Mat4MulVecfl(imat, h1);
|
Mat4MulVecfl(imat, h1);
|
||||||
/* if previous bone is B-bone too, use average handle direction */
|
/* if previous bone is B-bone too, use average handle direction */
|
||||||
if(prev->bone->segments>1) h1[1]-= length;
|
if(prev->bone->segments>1) h1[1]-= length;
|
||||||
Normalise(h1);
|
Normalize(h1);
|
||||||
VecMulf(h1, -hlength1);
|
VecMulf(h1, -hlength1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -466,7 +466,7 @@ Mat4 *b_bone_spline_setup(bPoseChannel *pchan)
|
|||||||
roll= atan2(mat3[2][0], mat3[2][2]);
|
roll= atan2(mat3[2][0], mat3[2][2]);
|
||||||
|
|
||||||
/* and only now negate handle */
|
/* and only now negate handle */
|
||||||
Normalise(h2);
|
Normalize(h2);
|
||||||
VecMulf(h2, -hlength2);
|
VecMulf(h2, -hlength2);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -548,7 +548,7 @@ float distfactor_to_bone (float vec[3], float b1[3], float b2[3], float rad1, fl
|
|||||||
float hsqr, a, l, rad;
|
float hsqr, a, l, rad;
|
||||||
|
|
||||||
VecSubf (bdelta, b2, b1);
|
VecSubf (bdelta, b2, b1);
|
||||||
l = Normalise (bdelta);
|
l = Normalize (bdelta);
|
||||||
|
|
||||||
VecSubf (pdelta, vec, b1);
|
VecSubf (pdelta, vec, b1);
|
||||||
|
|
||||||
@ -964,14 +964,14 @@ void vec_roll_to_mat3(float *vec, float roll, float mat[][3])
|
|||||||
float rMatrix[3][3], bMatrix[3][3];
|
float rMatrix[3][3], bMatrix[3][3];
|
||||||
|
|
||||||
VECCOPY (nor, vec);
|
VECCOPY (nor, vec);
|
||||||
Normalise (nor);
|
Normalize (nor);
|
||||||
|
|
||||||
/* Find Axis & Amount for bone matrix*/
|
/* Find Axis & Amount for bone matrix*/
|
||||||
Crossf (axis,target,nor);
|
Crossf (axis,target,nor);
|
||||||
|
|
||||||
if (Inpf(axis,axis) > 0.0000000000001) {
|
if (Inpf(axis,axis) > 0.0000000000001) {
|
||||||
/* if nor is *not* a multiple of target ... */
|
/* if nor is *not* a multiple of target ... */
|
||||||
Normalise (axis);
|
Normalize (axis);
|
||||||
|
|
||||||
theta= NormalizedVecAngle2(target, nor);
|
theta= NormalizedVecAngle2(target, nor);
|
||||||
|
|
||||||
|
@ -780,7 +780,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
|
|||||||
/* setup starting time, direction vector and accumulated time */
|
/* setup starting time, direction vector and accumulated time */
|
||||||
starttime= painter->accumtime;
|
starttime= painter->accumtime;
|
||||||
Vec2Subf(dmousepos, pos, painter->lastmousepos);
|
Vec2Subf(dmousepos, pos, painter->lastmousepos);
|
||||||
len= Normalise2(dmousepos);
|
len= Normalize2(dmousepos);
|
||||||
painter->accumtime += curtime - painter->lasttime;
|
painter->accumtime += curtime - painter->lasttime;
|
||||||
|
|
||||||
/* do paint op over unpainted time distance */
|
/* do paint op over unpainted time distance */
|
||||||
@ -815,7 +815,7 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
|
|||||||
/* setup starting distance, direction vector and accumulated distance */
|
/* setup starting distance, direction vector and accumulated distance */
|
||||||
startdistance= painter->accumdistance;
|
startdistance= painter->accumdistance;
|
||||||
Vec2Subf(dmousepos, pos, painter->lastmousepos);
|
Vec2Subf(dmousepos, pos, painter->lastmousepos);
|
||||||
len= Normalise2(dmousepos);
|
len= Normalize2(dmousepos);
|
||||||
painter->accumdistance += len;
|
painter->accumdistance += len;
|
||||||
|
|
||||||
/* do paint op over unpainted distance */
|
/* do paint op over unpainted distance */
|
||||||
|
@ -1002,9 +1002,9 @@ void CDDM_calc_normals(DerivedMesh *dm)
|
|||||||
for(i = 0; i < numVerts; i++, mv++) {
|
for(i = 0; i < numVerts; i++, mv++) {
|
||||||
float *no = temp_nors[i];
|
float *no = temp_nors[i];
|
||||||
|
|
||||||
if (Normalise(no) == 0.0) {
|
if (Normalize(no) == 0.0) {
|
||||||
VECCOPY(no, mv->co);
|
VECCOPY(no, mv->co);
|
||||||
Normalise(no);
|
Normalize(no);
|
||||||
}
|
}
|
||||||
|
|
||||||
mv->no[0] = (short)(no[0] * 32767.0);
|
mv->no[0] = (short)(no[0] * 32767.0);
|
||||||
|
@ -891,7 +891,7 @@ static void vectomat(float *vec, float *target_up, short axis, short upflag, sho
|
|||||||
int right_index;
|
int right_index;
|
||||||
|
|
||||||
VecCopyf(n, vec);
|
VecCopyf(n, vec);
|
||||||
if(Normalise(n) == 0.0) {
|
if(Normalize(n) == 0.0) {
|
||||||
n[0] = 0.0;
|
n[0] = 0.0;
|
||||||
n[1] = 0.0;
|
n[1] = 0.0;
|
||||||
n[2] = 1.0;
|
n[2] = 1.0;
|
||||||
@ -919,15 +919,15 @@ static void vectomat(float *vec, float *target_up, short axis, short upflag, sho
|
|||||||
VecSubf(proj, u, proj); /* then onto the plane */
|
VecSubf(proj, u, proj); /* then onto the plane */
|
||||||
/* proj specifies the transformation of the up axis */
|
/* proj specifies the transformation of the up axis */
|
||||||
|
|
||||||
if(Normalise(proj) == 0.0) { /* degenerate projection */
|
if(Normalize(proj) == 0.0) { /* degenerate projection */
|
||||||
proj[0] = 0.0;
|
proj[0] = 0.0;
|
||||||
proj[1] = 1.0;
|
proj[1] = 1.0;
|
||||||
proj[2] = 0.0;
|
proj[2] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* normalised cross product of n and proj specifies transformation of the right axis */
|
/* Normalized cross product of n and proj specifies transformation of the right axis */
|
||||||
Crossf(right, proj, n);
|
Crossf(right, proj, n);
|
||||||
Normalise(right);
|
Normalize(right);
|
||||||
|
|
||||||
if(axis != upflag) {
|
if(axis != upflag) {
|
||||||
right_index = 3 - axis - upflag;
|
right_index = 3 - axis - upflag;
|
||||||
@ -1220,7 +1220,7 @@ short get_constraint_target_matrix (bConstraint *con, short ownertype, void* own
|
|||||||
if(data->followflag){
|
if(data->followflag){
|
||||||
quat= vectoquat(dir, (short) data->trackflag, (short) data->upflag);
|
quat= vectoquat(dir, (short) data->trackflag, (short) data->upflag);
|
||||||
|
|
||||||
Normalise(dir);
|
Normalize(dir);
|
||||||
q[0]= (float)cos(0.5*vec[3]);
|
q[0]= (float)cos(0.5*vec[3]);
|
||||||
x1= (float)sin(0.5*vec[3]);
|
x1= (float)sin(0.5*vec[3]);
|
||||||
q[1]= -x1*dir[0];
|
q[1]= -x1*dir[0];
|
||||||
@ -1528,13 +1528,13 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[0]);
|
Projf(vec2, vec, ob->obmat[0]);
|
||||||
VecSubf(totmat[1], vec, vec2);
|
VecSubf(totmat[1], vec, vec2);
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
|
|
||||||
/* the x axis is fixed*/
|
/* the x axis is fixed*/
|
||||||
totmat[0][0] = ob->obmat[0][0];
|
totmat[0][0] = ob->obmat[0][0];
|
||||||
totmat[0][1] = ob->obmat[0][1];
|
totmat[0][1] = ob->obmat[0][1];
|
||||||
totmat[0][2] = ob->obmat[0][2];
|
totmat[0][2] = ob->obmat[0][2];
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1546,13 +1546,13 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[0]);
|
Projf(vec2, vec, ob->obmat[0]);
|
||||||
VecSubf(totmat[2], vec, vec2);
|
VecSubf(totmat[2], vec, vec2);
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
|
|
||||||
/* the x axis is fixed*/
|
/* the x axis is fixed*/
|
||||||
totmat[0][0] = ob->obmat[0][0];
|
totmat[0][0] = ob->obmat[0][0];
|
||||||
totmat[0][1] = ob->obmat[0][1];
|
totmat[0][1] = ob->obmat[0][1];
|
||||||
totmat[0][2] = ob->obmat[0][2];
|
totmat[0][2] = ob->obmat[0][2];
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1564,14 +1564,14 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[0]);
|
Projf(vec2, vec, ob->obmat[0]);
|
||||||
VecSubf(totmat[1], vec, vec2);
|
VecSubf(totmat[1], vec, vec2);
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
VecMulf(totmat[1],-1);
|
VecMulf(totmat[1],-1);
|
||||||
|
|
||||||
/* the x axis is fixed*/
|
/* the x axis is fixed*/
|
||||||
totmat[0][0] = ob->obmat[0][0];
|
totmat[0][0] = ob->obmat[0][0];
|
||||||
totmat[0][1] = ob->obmat[0][1];
|
totmat[0][1] = ob->obmat[0][1];
|
||||||
totmat[0][2] = ob->obmat[0][2];
|
totmat[0][2] = ob->obmat[0][2];
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1583,14 +1583,14 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[0]);
|
Projf(vec2, vec, ob->obmat[0]);
|
||||||
VecSubf(totmat[2], vec, vec2);
|
VecSubf(totmat[2], vec, vec2);
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
VecMulf(totmat[2],-1);
|
VecMulf(totmat[2],-1);
|
||||||
|
|
||||||
/* the x axis is fixed*/
|
/* the x axis is fixed*/
|
||||||
totmat[0][0] = ob->obmat[0][0];
|
totmat[0][0] = ob->obmat[0][0];
|
||||||
totmat[0][1] = ob->obmat[0][1];
|
totmat[0][1] = ob->obmat[0][1];
|
||||||
totmat[0][2] = ob->obmat[0][2];
|
totmat[0][2] = ob->obmat[0][2];
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1615,13 +1615,13 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[1]);
|
Projf(vec2, vec, ob->obmat[1]);
|
||||||
VecSubf(totmat[0], vec, vec2);
|
VecSubf(totmat[0], vec, vec2);
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
|
|
||||||
/* the y axis is fixed*/
|
/* the y axis is fixed*/
|
||||||
totmat[1][0] = ob->obmat[1][0];
|
totmat[1][0] = ob->obmat[1][0];
|
||||||
totmat[1][1] = ob->obmat[1][1];
|
totmat[1][1] = ob->obmat[1][1];
|
||||||
totmat[1][2] = ob->obmat[1][2];
|
totmat[1][2] = ob->obmat[1][2];
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1633,13 +1633,13 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[1]);
|
Projf(vec2, vec, ob->obmat[1]);
|
||||||
VecSubf(totmat[2], vec, vec2);
|
VecSubf(totmat[2], vec, vec2);
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
|
|
||||||
/* the y axis is fixed*/
|
/* the y axis is fixed*/
|
||||||
totmat[1][0] = ob->obmat[1][0];
|
totmat[1][0] = ob->obmat[1][0];
|
||||||
totmat[1][1] = ob->obmat[1][1];
|
totmat[1][1] = ob->obmat[1][1];
|
||||||
totmat[1][2] = ob->obmat[1][2];
|
totmat[1][2] = ob->obmat[1][2];
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1651,14 +1651,14 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[1]);
|
Projf(vec2, vec, ob->obmat[1]);
|
||||||
VecSubf(totmat[0], vec, vec2);
|
VecSubf(totmat[0], vec, vec2);
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
VecMulf(totmat[0],-1);
|
VecMulf(totmat[0],-1);
|
||||||
|
|
||||||
/* the y axis is fixed*/
|
/* the y axis is fixed*/
|
||||||
totmat[1][0] = ob->obmat[1][0];
|
totmat[1][0] = ob->obmat[1][0];
|
||||||
totmat[1][1] = ob->obmat[1][1];
|
totmat[1][1] = ob->obmat[1][1];
|
||||||
totmat[1][2] = ob->obmat[1][2];
|
totmat[1][2] = ob->obmat[1][2];
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1670,14 +1670,14 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[1]);
|
Projf(vec2, vec, ob->obmat[1]);
|
||||||
VecSubf(totmat[2], vec, vec2);
|
VecSubf(totmat[2], vec, vec2);
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
VecMulf(totmat[2],-1);
|
VecMulf(totmat[2],-1);
|
||||||
|
|
||||||
/* the y axis is fixed*/
|
/* the y axis is fixed*/
|
||||||
totmat[1][0] = ob->obmat[1][0];
|
totmat[1][0] = ob->obmat[1][0];
|
||||||
totmat[1][1] = ob->obmat[1][1];
|
totmat[1][1] = ob->obmat[1][1];
|
||||||
totmat[1][2] = ob->obmat[1][2];
|
totmat[1][2] = ob->obmat[1][2];
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
|
|
||||||
/* the z axis gets mapped onto
|
/* the z axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1702,13 +1702,13 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[2]);
|
Projf(vec2, vec, ob->obmat[2]);
|
||||||
VecSubf(totmat[0], vec, vec2);
|
VecSubf(totmat[0], vec, vec2);
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
|
|
||||||
/* the z axis is fixed*/
|
/* the z axis is fixed*/
|
||||||
totmat[2][0] = ob->obmat[2][0];
|
totmat[2][0] = ob->obmat[2][0];
|
||||||
totmat[2][1] = ob->obmat[2][1];
|
totmat[2][1] = ob->obmat[2][1];
|
||||||
totmat[2][2] = ob->obmat[2][2];
|
totmat[2][2] = ob->obmat[2][2];
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
|
|
||||||
/* the x axis gets mapped onto
|
/* the x axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1720,13 +1720,13 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[2]);
|
Projf(vec2, vec, ob->obmat[2]);
|
||||||
VecSubf(totmat[1], vec, vec2);
|
VecSubf(totmat[1], vec, vec2);
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
|
|
||||||
/* the z axis is fixed*/
|
/* the z axis is fixed*/
|
||||||
totmat[2][0] = ob->obmat[2][0];
|
totmat[2][0] = ob->obmat[2][0];
|
||||||
totmat[2][1] = ob->obmat[2][1];
|
totmat[2][1] = ob->obmat[2][1];
|
||||||
totmat[2][2] = ob->obmat[2][2];
|
totmat[2][2] = ob->obmat[2][2];
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
|
|
||||||
/* the x axis gets mapped onto
|
/* the x axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1738,14 +1738,14 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[2]);
|
Projf(vec2, vec, ob->obmat[2]);
|
||||||
VecSubf(totmat[0], vec, vec2);
|
VecSubf(totmat[0], vec, vec2);
|
||||||
Normalise(totmat[0]);
|
Normalize(totmat[0]);
|
||||||
VecMulf(totmat[0],-1);
|
VecMulf(totmat[0],-1);
|
||||||
|
|
||||||
/* the z axis is fixed*/
|
/* the z axis is fixed*/
|
||||||
totmat[2][0] = ob->obmat[2][0];
|
totmat[2][0] = ob->obmat[2][0];
|
||||||
totmat[2][1] = ob->obmat[2][1];
|
totmat[2][1] = ob->obmat[2][1];
|
||||||
totmat[2][2] = ob->obmat[2][2];
|
totmat[2][2] = ob->obmat[2][2];
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
|
|
||||||
/* the x axis gets mapped onto
|
/* the x axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1757,14 +1757,14 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* Projection of Vector on the plane */
|
/* Projection of Vector on the plane */
|
||||||
Projf(vec2, vec, ob->obmat[2]);
|
Projf(vec2, vec, ob->obmat[2]);
|
||||||
VecSubf(totmat[1], vec, vec2);
|
VecSubf(totmat[1], vec, vec2);
|
||||||
Normalise(totmat[1]);
|
Normalize(totmat[1]);
|
||||||
VecMulf(totmat[1],-1);
|
VecMulf(totmat[1],-1);
|
||||||
|
|
||||||
/* the z axis is fixed*/
|
/* the z axis is fixed*/
|
||||||
totmat[2][0] = ob->obmat[2][0];
|
totmat[2][0] = ob->obmat[2][0];
|
||||||
totmat[2][1] = ob->obmat[2][1];
|
totmat[2][1] = ob->obmat[2][1];
|
||||||
totmat[2][2] = ob->obmat[2][2];
|
totmat[2][2] = ob->obmat[2][2];
|
||||||
Normalise(totmat[2]);
|
Normalize(totmat[2]);
|
||||||
|
|
||||||
/* the x axis gets mapped onto
|
/* the x axis gets mapped onto
|
||||||
a third orthogonal vector */
|
a third orthogonal vector */
|
||||||
@ -1793,9 +1793,9 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
tmpmat[0][0] = ob->obmat[0][0];tmpmat[0][1] = ob->obmat[0][1];tmpmat[0][2] = ob->obmat[0][2];
|
tmpmat[0][0] = ob->obmat[0][0];tmpmat[0][1] = ob->obmat[0][1];tmpmat[0][2] = ob->obmat[0][2];
|
||||||
tmpmat[1][0] = ob->obmat[1][0];tmpmat[1][1] = ob->obmat[1][1];tmpmat[1][2] = ob->obmat[1][2];
|
tmpmat[1][0] = ob->obmat[1][0];tmpmat[1][1] = ob->obmat[1][1];tmpmat[1][2] = ob->obmat[1][2];
|
||||||
tmpmat[2][0] = ob->obmat[2][0];tmpmat[2][1] = ob->obmat[2][1];tmpmat[2][2] = ob->obmat[2][2];
|
tmpmat[2][0] = ob->obmat[2][0];tmpmat[2][1] = ob->obmat[2][1];tmpmat[2][2] = ob->obmat[2][2];
|
||||||
Normalise(tmpmat[0]);
|
Normalize(tmpmat[0]);
|
||||||
Normalise(tmpmat[1]);
|
Normalize(tmpmat[1]);
|
||||||
Normalise(tmpmat[2]);
|
Normalize(tmpmat[2]);
|
||||||
Mat3Inv(invmat,tmpmat);
|
Mat3Inv(invmat,tmpmat);
|
||||||
Mat3MulMat3(tmpmat,totmat,invmat);
|
Mat3MulMat3(tmpmat,totmat,invmat);
|
||||||
totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2];
|
totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2];
|
||||||
@ -1865,20 +1865,20 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
xx[0] = ob->obmat[0][0];
|
xx[0] = ob->obmat[0][0];
|
||||||
xx[1] = ob->obmat[0][1];
|
xx[1] = ob->obmat[0][1];
|
||||||
xx[2] = ob->obmat[0][2];
|
xx[2] = ob->obmat[0][2];
|
||||||
Normalise(xx);
|
Normalize(xx);
|
||||||
|
|
||||||
/* store Z orientation before destroying obmat */
|
/* store Z orientation before destroying obmat */
|
||||||
zz[0] = ob->obmat[2][0];
|
zz[0] = ob->obmat[2][0];
|
||||||
zz[1] = ob->obmat[2][1];
|
zz[1] = ob->obmat[2][1];
|
||||||
zz[2] = ob->obmat[2][2];
|
zz[2] = ob->obmat[2][2];
|
||||||
Normalise(zz);
|
Normalize(zz);
|
||||||
|
|
||||||
VecSubf(vec, ob->obmat[3], targetmat[3]);
|
VecSubf(vec, ob->obmat[3], targetmat[3]);
|
||||||
vec[0] /= size[0];
|
vec[0] /= size[0];
|
||||||
vec[1] /= size[1];
|
vec[1] /= size[1];
|
||||||
vec[2] /= size[2];
|
vec[2] /= size[2];
|
||||||
|
|
||||||
dist = Normalise(vec);
|
dist = Normalize(vec);
|
||||||
//dist = VecLenf( ob->obmat[3], targetmat[3]);
|
//dist = VecLenf( ob->obmat[3], targetmat[3]);
|
||||||
|
|
||||||
if (data->orglength == 0) data->orglength = dist;
|
if (data->orglength == 0) data->orglength = dist;
|
||||||
@ -1920,7 +1920,7 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
ob->obmat[2][2]=size[2]*scale[2];
|
ob->obmat[2][2]=size[2]*scale[2];
|
||||||
|
|
||||||
VecSubf(vec, ob->obmat[3], targetmat[3]);
|
VecSubf(vec, ob->obmat[3], targetmat[3]);
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
/* new Y aligns object target connection*/
|
/* new Y aligns object target connection*/
|
||||||
totmat[1][0] = -vec[0];
|
totmat[1][0] = -vec[0];
|
||||||
totmat[1][1] = -vec[1];
|
totmat[1][1] = -vec[1];
|
||||||
@ -1930,7 +1930,7 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* build new Z vector */
|
/* build new Z vector */
|
||||||
/* othogonal to "new Y" "old X! plane */
|
/* othogonal to "new Y" "old X! plane */
|
||||||
Crossf(orth, vec, xx);
|
Crossf(orth, vec, xx);
|
||||||
Normalise(orth);
|
Normalize(orth);
|
||||||
|
|
||||||
/* new Z*/
|
/* new Z*/
|
||||||
totmat[2][0] = orth[0];
|
totmat[2][0] = orth[0];
|
||||||
@ -1939,7 +1939,7 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
|
|
||||||
/* we decided to keep X plane*/
|
/* we decided to keep X plane*/
|
||||||
Crossf(xx,orth, vec);
|
Crossf(xx,orth, vec);
|
||||||
Normalise(xx);
|
Normalize(xx);
|
||||||
totmat[0][0] = xx[0];
|
totmat[0][0] = xx[0];
|
||||||
totmat[0][1] = xx[1];
|
totmat[0][1] = xx[1];
|
||||||
totmat[0][2] = xx[2];
|
totmat[0][2] = xx[2];
|
||||||
@ -1948,7 +1948,7 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
/* build new X vector */
|
/* build new X vector */
|
||||||
/* othogonal to "new Y" "old Z! plane */
|
/* othogonal to "new Y" "old Z! plane */
|
||||||
Crossf(orth, vec, zz);
|
Crossf(orth, vec, zz);
|
||||||
Normalise(orth);
|
Normalize(orth);
|
||||||
|
|
||||||
/* new X*/
|
/* new X*/
|
||||||
totmat[0][0] = -orth[0];
|
totmat[0][0] = -orth[0];
|
||||||
@ -1957,7 +1957,7 @@ void evaluate_constraint (bConstraint *constraint, Object *ob, short ownertype,
|
|||||||
|
|
||||||
/* we decided to keep Z */
|
/* we decided to keep Z */
|
||||||
Crossf(zz,orth, vec);
|
Crossf(zz,orth, vec);
|
||||||
Normalise(zz);
|
Normalize(zz);
|
||||||
totmat[2][0] = zz[0];
|
totmat[2][0] = zz[0];
|
||||||
totmat[2][1] = zz[1];
|
totmat[2][1] = zz[1];
|
||||||
totmat[2][2] = zz[2];
|
totmat[2][2] = zz[2];
|
||||||
|
@ -1778,7 +1778,7 @@ void makeBevelList(Object *ob)
|
|||||||
|
|
||||||
quat= vectoquat(vec, 5, 1);
|
quat= vectoquat(vec, 5, 1);
|
||||||
|
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
q[0]= (float)cos(0.5*bevp1->alfa);
|
q[0]= (float)cos(0.5*bevp1->alfa);
|
||||||
x1= (float)sin(0.5*bevp1->alfa);
|
x1= (float)sin(0.5*bevp1->alfa);
|
||||||
q[1]= x1*vec[0];
|
q[1]= x1*vec[0];
|
||||||
@ -1808,7 +1808,7 @@ void makeBevelList(Object *ob)
|
|||||||
vec[1]= bevp2->y - bevp0->y;
|
vec[1]= bevp2->y - bevp0->y;
|
||||||
vec[2]= bevp2->z - bevp0->z;
|
vec[2]= bevp2->z - bevp0->z;
|
||||||
|
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
|
|
||||||
quat= vectoquat(vec, 5, 1);
|
quat= vectoquat(vec, 5, 1);
|
||||||
|
|
||||||
@ -2107,8 +2107,8 @@ void calchandleNurb(BezTriple *bezt, BezTriple *prev, BezTriple *next, int mode)
|
|||||||
|
|
||||||
VecSubf(h1, p2-3, p2);
|
VecSubf(h1, p2-3, p2);
|
||||||
VecSubf(h2, p2, p2+3);
|
VecSubf(h2, p2, p2+3);
|
||||||
len1= Normalise(h1);
|
len1= Normalize(h1);
|
||||||
len2= Normalise(h2);
|
len2= Normalize(h2);
|
||||||
|
|
||||||
vz= INPR(h1, h2);
|
vz= INPR(h1, h2);
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ void addnormalsDispList(Object *ob, ListBase *lb)
|
|||||||
a= dl->parts*dl->nr;
|
a= dl->parts*dl->nr;
|
||||||
v1= ndata;
|
v1= ndata;
|
||||||
while(a--) {
|
while(a--) {
|
||||||
Normalise(v1);
|
Normalize(v1);
|
||||||
v1+= 3;
|
v1+= 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -525,7 +525,7 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un
|
|||||||
vn[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
vn[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||||
vn[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
vn[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||||
vn[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
vn[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||||
Normalise(vn);
|
Normalize(vn);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; i<totface; i++) {
|
for (i=0; i<totface; i++) {
|
||||||
@ -555,7 +555,7 @@ static void mesh_create_shadedColors(Render *re, Object *ob, int onlyForMesh, un
|
|||||||
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
|
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
|
||||||
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
|
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
|
||||||
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
|
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
|
|
||||||
for (j=0; j<nverts; j++) {
|
for (j=0; j<nverts; j++) {
|
||||||
MVert *mv= &mvert[vidx[j]];
|
MVert *mv= &mvert[vidx[j]];
|
||||||
@ -666,7 +666,7 @@ void shadeDispList(Base *base)
|
|||||||
n1[0]= imat[0][0]*dl->nors[0]+imat[0][1]*dl->nors[1]+imat[0][2]*dl->nors[2];
|
n1[0]= imat[0][0]*dl->nors[0]+imat[0][1]*dl->nors[1]+imat[0][2]*dl->nors[2];
|
||||||
n1[1]= imat[1][0]*dl->nors[0]+imat[1][1]*dl->nors[1]+imat[1][2]*dl->nors[2];
|
n1[1]= imat[1][0]*dl->nors[0]+imat[1][1]*dl->nors[1]+imat[1][2]*dl->nors[2];
|
||||||
n1[2]= imat[2][0]*dl->nors[0]+imat[2][1]*dl->nors[1]+imat[2][2]*dl->nors[2];
|
n1[2]= imat[2][0]*dl->nors[0]+imat[2][1]*dl->nors[1]+imat[2][2]*dl->nors[2];
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
|
|
||||||
fp= dl->verts;
|
fp= dl->verts;
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ void shadeDispList(Base *base)
|
|||||||
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
|
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
|
||||||
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
|
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
|
||||||
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
|
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
|
|
||||||
fastshade(vec, n1, fp, ma, (char *)col1, NULL);
|
fastshade(vec, n1, fp, ma, (char *)col1, NULL);
|
||||||
|
|
||||||
@ -732,7 +732,7 @@ void shadeDispList(Base *base)
|
|||||||
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
|
n1[0]= imat[0][0]*nor[0]+imat[0][1]*nor[1]+imat[0][2]*nor[2];
|
||||||
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
|
n1[1]= imat[1][0]*nor[0]+imat[1][1]*nor[1]+imat[1][2]*nor[2];
|
||||||
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
|
n1[2]= imat[2][0]*nor[0]+imat[2][1]*nor[1]+imat[2][2]*nor[2];
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
|
|
||||||
fastshade(vec, n1, fp, ma, (char *)col1, NULL);
|
fastshade(vec, n1, fp, ma, (char *)col1, NULL);
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ void pdDoEffectors(ListBase *lb, float *opco, float *force, float *speed, float
|
|||||||
distance = VecLength(vect_to_vert);
|
distance = VecLength(vect_to_vert);
|
||||||
|
|
||||||
Crossf(force_vec, ob->obmat[2], vect_to_vert);
|
Crossf(force_vec, ob->obmat[2], vect_to_vert);
|
||||||
Normalise(force_vec);
|
Normalize(force_vec);
|
||||||
|
|
||||||
/* Limit minimum distance to vertex so that */
|
/* Limit minimum distance to vertex so that */
|
||||||
/* the force is not too big */
|
/* the force is not too big */
|
||||||
@ -867,7 +867,7 @@ static int pdDoDeflection(RNG *rng, float opco[3], float npco[3], float opno[3],
|
|||||||
VECSUB(edge1, dv1, dv2);
|
VECSUB(edge1, dv1, dv2);
|
||||||
VECSUB(edge2, dv3, dv2);
|
VECSUB(edge2, dv3, dv2);
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
n_mag = Normalise(d_nvect);
|
n_mag = Normalize(d_nvect);
|
||||||
dk_plane = INPR(d_nvect, nv1);
|
dk_plane = INPR(d_nvect, nv1);
|
||||||
dk_point1 = INPR(d_nvect,opco);
|
dk_point1 = INPR(d_nvect,opco);
|
||||||
|
|
||||||
@ -880,11 +880,11 @@ static int pdDoDeflection(RNG *rng, float opco[3], float npco[3], float opno[3],
|
|||||||
d_i_co_above[0] = (d_intersect_co[0] + (0.001f * d_nvect[0]));
|
d_i_co_above[0] = (d_intersect_co[0] + (0.001f * d_nvect[0]));
|
||||||
d_i_co_above[1] = (d_intersect_co[1] + (0.001f * d_nvect[1]));
|
d_i_co_above[1] = (d_intersect_co[1] + (0.001f * d_nvect[1]));
|
||||||
d_i_co_above[2] = (d_intersect_co[2] + (0.001f * d_nvect[2]));
|
d_i_co_above[2] = (d_intersect_co[2] + (0.001f * d_nvect[2]));
|
||||||
mag_iv = Normalise(d_intersect_vect);
|
mag_iv = Normalize(d_intersect_vect);
|
||||||
VECCOPY(npco, d_intersect_co);
|
VECCOPY(npco, d_intersect_co);
|
||||||
|
|
||||||
VECSUB(vect_to_int, opco, d_intersect_co);
|
VECSUB(vect_to_int, opco, d_intersect_co);
|
||||||
first_dist = Normalise(vect_to_int);
|
first_dist = Normalize(vect_to_int);
|
||||||
|
|
||||||
/* Work out the lengths of time before and after collision*/
|
/* Work out the lengths of time before and after collision*/
|
||||||
time_before = (life*(first_dist / (mag_iv)));
|
time_before = (life*(first_dist / (mag_iv)));
|
||||||
@ -2045,7 +2045,7 @@ void build_particle_system(Object *ob)
|
|||||||
VECCOPY(vec, no);
|
VECCOPY(vec, no);
|
||||||
Mat3MulVecfl(mcnow->imat, vec);
|
Mat3MulVecfl(mcnow->imat, vec);
|
||||||
|
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
VecMulf(vec, paf->normfac);
|
VecMulf(vec, paf->normfac);
|
||||||
VECADD(pa->no, pa->no, vec);
|
VECADD(pa->no, pa->no, vec);
|
||||||
}
|
}
|
||||||
@ -2053,7 +2053,7 @@ void build_particle_system(Object *ob)
|
|||||||
else {
|
else {
|
||||||
if(paf->normfac!=0.0) {
|
if(paf->normfac!=0.0) {
|
||||||
VECCOPY(pa->no, no);
|
VECCOPY(pa->no, no);
|
||||||
Normalise(pa->no);
|
Normalize(pa->no);
|
||||||
VecMulf(pa->no, paf->normfac);
|
VecMulf(pa->no, paf->normfac);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2250,7 +2250,7 @@ static void displist_to_objects(ListBase *lbase)
|
|||||||
/* irst this: is still active */
|
/* irst this: is still active */
|
||||||
if(ivsurf) {
|
if(ivsurf) {
|
||||||
where_is_object(ivsurf);
|
where_is_object(ivsurf);
|
||||||
docentre_new();
|
docenter_new();
|
||||||
}
|
}
|
||||||
|
|
||||||
dl= lbase->first;
|
dl= lbase->first;
|
||||||
@ -3944,7 +3944,7 @@ static void dxf_read_ellipse(int noob)
|
|||||||
x = a * sin(phi);
|
x = a * sin(phi);
|
||||||
y = b * cos(phi);
|
y = b * cos(phi);
|
||||||
|
|
||||||
#ifndef DEBUG_CENTRE
|
#ifndef DEBUG_CENTER
|
||||||
epoint[0] = center[0] + x*cos(theta) - y*sin(theta);
|
epoint[0] = center[0] + x*cos(theta) - y*sin(theta);
|
||||||
epoint[1] = center[1] + x*sin(theta) + y*cos(theta);
|
epoint[1] = center[1] + x*sin(theta) + y*cos(theta);
|
||||||
epoint[2] = center[2];
|
epoint[2] = center[2];
|
||||||
|
@ -943,7 +943,7 @@ struct chartrans *text_to_curve(Object *ob, int mode)
|
|||||||
|
|
||||||
Mat3CpyMat4(cmat, cu->textoncurve->obmat);
|
Mat3CpyMat4(cmat, cu->textoncurve->obmat);
|
||||||
Mat3MulMat3(cmat, cmat, imat3);
|
Mat3MulMat3(cmat, cmat, imat3);
|
||||||
sizefac= Normalise(cmat[0])/cu->fsize;
|
sizefac= Normalize(cmat[0])/cu->fsize;
|
||||||
|
|
||||||
minx=miny= 1.0e20f;
|
minx=miny= 1.0e20f;
|
||||||
maxx=maxy= -1.0e20f;
|
maxx=maxy= -1.0e20f;
|
||||||
@ -983,7 +983,7 @@ struct chartrans *text_to_curve(Object *ob, int mode)
|
|||||||
ct= chartransdata;
|
ct= chartransdata;
|
||||||
for (i=0; i<=slen; i++, ct++) {
|
for (i=0; i<=slen; i++, ct++) {
|
||||||
|
|
||||||
/* rotate around centre character */
|
/* rotate around center character */
|
||||||
ascii = mem[i];
|
ascii = mem[i];
|
||||||
|
|
||||||
// Find the character
|
// Find the character
|
||||||
|
@ -405,7 +405,7 @@ static ImBuf *add_ibuf_size(int width, int height, char *name, short uvtestgrid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 2nd pass, coloured + */
|
/* 2nd pass, colored + */
|
||||||
rect= (unsigned char*)ibuf->rect;
|
rect= (unsigned char*)ibuf->rect;
|
||||||
|
|
||||||
for(y=0; y<ibuf->y; y++) {
|
for(y=0; y<ibuf->y; y++) {
|
||||||
|
@ -585,7 +585,7 @@ static float *calc_curve_deform(Object *par, float *co, short axis, CurveDeform
|
|||||||
|
|
||||||
/* the tilt */
|
/* the tilt */
|
||||||
if(loc[3]!=0.0) {
|
if(loc[3]!=0.0) {
|
||||||
Normalise(dir);
|
Normalize(dir);
|
||||||
q[0]= (float)cos(0.5*loc[3]);
|
q[0]= (float)cos(0.5*loc[3]);
|
||||||
fac= (float)sin(0.5*loc[3]);
|
fac= (float)sin(0.5*loc[3]);
|
||||||
q[1]= -fac*dir[0];
|
q[1]= -fac*dir[0];
|
||||||
|
@ -1072,9 +1072,9 @@ void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces,
|
|||||||
MVert *mv= &mverts[i];
|
MVert *mv= &mverts[i];
|
||||||
float *no= tnorms[i];
|
float *no= tnorms[i];
|
||||||
|
|
||||||
if (Normalise(no)==0.0) {
|
if (Normalize(no)==0.0) {
|
||||||
VECCOPY(no, mv->co);
|
VECCOPY(no, mv->co);
|
||||||
Normalise(no);
|
Normalize(no);
|
||||||
}
|
}
|
||||||
|
|
||||||
mv->no[0]= (short)(no[0]*32767.0);
|
mv->no[0]= (short)(no[0]*32767.0);
|
||||||
|
@ -1268,7 +1268,7 @@ static void ob_parcurve(Object *ob, Object *par, float mat[][4])
|
|||||||
quat= vectoquat(dir, ob->trackflag, ob->upflag);
|
quat= vectoquat(dir, ob->trackflag, ob->upflag);
|
||||||
|
|
||||||
/* the tilt */
|
/* the tilt */
|
||||||
Normalise(dir);
|
Normalize(dir);
|
||||||
q[0]= (float)cos(0.5*vec[3]);
|
q[0]= (float)cos(0.5*vec[3]);
|
||||||
x1= (float)sin(0.5*vec[3]);
|
x1= (float)sin(0.5*vec[3]);
|
||||||
q[1]= -x1*dir[0];
|
q[1]= -x1*dir[0];
|
||||||
|
@ -1201,7 +1201,7 @@ int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_
|
|||||||
VECSUB(edge1, nv1, nv2);
|
VECSUB(edge1, nv1, nv2);
|
||||||
VECSUB(edge2, nv3, nv2);
|
VECSUB(edge2, nv3, nv2);
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
Normalise(d_nvect);
|
Normalize(d_nvect);
|
||||||
if (
|
if (
|
||||||
LineIntersectsTriangle(nv1, nv2, face_v1, face_v2, face_v3, &t) ||
|
LineIntersectsTriangle(nv1, nv2, face_v1, face_v2, face_v3, &t) ||
|
||||||
LineIntersectsTriangle(nv2, nv3, face_v1, face_v2, face_v3, &t) ||
|
LineIntersectsTriangle(nv2, nv3, face_v1, face_v2, face_v3, &t) ||
|
||||||
@ -1215,7 +1215,7 @@ int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_
|
|||||||
VECSUB(edge1, nv3, nv4);
|
VECSUB(edge1, nv3, nv4);
|
||||||
VECSUB(edge2, nv1, nv4);
|
VECSUB(edge2, nv1, nv4);
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
Normalise(d_nvect);
|
Normalize(d_nvect);
|
||||||
if (
|
if (
|
||||||
LineIntersectsTriangle(nv1, nv3, face_v1, face_v2, face_v3, &t) ||
|
LineIntersectsTriangle(nv1, nv3, face_v1, face_v2, face_v3, &t) ||
|
||||||
LineIntersectsTriangle(nv3, nv4, face_v1, face_v2, face_v3, &t) ||
|
LineIntersectsTriangle(nv3, nv4, face_v1, face_v2, face_v3, &t) ||
|
||||||
@ -1401,7 +1401,7 @@ int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp
|
|||||||
VECSUB(edge2, nv3, nv2);
|
VECSUB(edge2, nv3, nv2);
|
||||||
|
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
Normalise(d_nvect);
|
Normalize(d_nvect);
|
||||||
if ( LineIntersectsTriangle(edge_v1, edge_v2, nv1, nv2, nv3, &t)){
|
if ( LineIntersectsTriangle(edge_v1, edge_v2, nv1, nv2, nv3, &t)){
|
||||||
float v1[3],v2[3];
|
float v1[3],v2[3];
|
||||||
float intrusiondepth,i1,i2;
|
float intrusiondepth,i1,i2;
|
||||||
@ -1420,7 +1420,7 @@ int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp
|
|||||||
VECSUB(edge2, nv1, nv4);
|
VECSUB(edge2, nv1, nv4);
|
||||||
|
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
Normalise(d_nvect);
|
Normalize(d_nvect);
|
||||||
if (LineIntersectsTriangle( edge_v1, edge_v2,nv1, nv3, nv4, &t)){
|
if (LineIntersectsTriangle( edge_v1, edge_v2,nv1, nv3, nv4, &t)){
|
||||||
float v1[3],v2[3];
|
float v1[3],v2[3];
|
||||||
float intrusiondepth,i1,i2;
|
float intrusiondepth,i1,i2;
|
||||||
@ -1496,7 +1496,7 @@ void scan_for_ext_spring_forces(Object *ob,float timenow)
|
|||||||
else{
|
else{
|
||||||
VECADD(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
|
VECADD(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
|
||||||
}
|
}
|
||||||
f = Normalise(vel);
|
f = Normalize(vel);
|
||||||
f = -0.0001f*f*f*sb->aeroedge;
|
f = -0.0001f*f*f*sb->aeroedge;
|
||||||
/* todo add a nice angle dependant function */
|
/* todo add a nice angle dependant function */
|
||||||
/* look up one at bergman scheafer */
|
/* look up one at bergman scheafer */
|
||||||
@ -1504,7 +1504,7 @@ void scan_for_ext_spring_forces(Object *ob,float timenow)
|
|||||||
VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
|
VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
|
||||||
Projf(pr,vel,sp);
|
Projf(pr,vel,sp);
|
||||||
VECSUB(vel,vel,pr);
|
VECSUB(vel,vel,pr);
|
||||||
Normalise(vel);
|
Normalize(vel);
|
||||||
Vec3PlusStVec(bs->ext_force,f,vel);
|
Vec3PlusStVec(bs->ext_force,f,vel);
|
||||||
}
|
}
|
||||||
/* --- springs seeing wind */
|
/* --- springs seeing wind */
|
||||||
@ -1673,7 +1673,7 @@ int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *
|
|||||||
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
||||||
|
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
n_mag = Normalise(d_nvect);
|
n_mag = Normalize(d_nvect);
|
||||||
facedist = Inpf(dv1,d_nvect);
|
facedist = Inpf(dv1,d_nvect);
|
||||||
|
|
||||||
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
|
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
|
||||||
@ -1703,7 +1703,7 @@ int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *
|
|||||||
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
||||||
|
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
n_mag = Normalise(d_nvect);
|
n_mag = Normalize(d_nvect);
|
||||||
facedist = Inpf(dv1,d_nvect);
|
facedist = Inpf(dv1,d_nvect);
|
||||||
|
|
||||||
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
|
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
|
||||||
@ -1741,7 +1741,7 @@ int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *
|
|||||||
if (ci) *intrusion /= ci;
|
if (ci) *intrusion /= ci;
|
||||||
if (deflected){
|
if (deflected){
|
||||||
VECCOPY(facenormal,force);
|
VECCOPY(facenormal,force);
|
||||||
Normalise(facenormal);
|
Normalize(facenormal);
|
||||||
}
|
}
|
||||||
return deflected;
|
return deflected;
|
||||||
}
|
}
|
||||||
@ -1882,7 +1882,7 @@ int sb_detect_vertex_collisionCachedEx(float opco[3], float facenormal[3], float
|
|||||||
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
||||||
|
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
n_mag = Normalise(d_nvect);
|
n_mag = Normalize(d_nvect);
|
||||||
facedist = Inpf(dv1,d_nvect);
|
facedist = Inpf(dv1,d_nvect);
|
||||||
|
|
||||||
if ((facedist > closestinside) && (facedist < outerfacethickness)){
|
if ((facedist > closestinside) && (facedist < outerfacethickness)){
|
||||||
@ -1926,7 +1926,7 @@ int sb_detect_vertex_collisionCachedEx(float opco[3], float facenormal[3], float
|
|||||||
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
|
||||||
|
|
||||||
Crossf(d_nvect, edge2, edge1);
|
Crossf(d_nvect, edge2, edge1);
|
||||||
n_mag = Normalise(d_nvect);
|
n_mag = Normalize(d_nvect);
|
||||||
facedist = Inpf(dv1,d_nvect);
|
facedist = Inpf(dv1,d_nvect);
|
||||||
|
|
||||||
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
|
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
|
||||||
@ -1983,7 +1983,7 @@ int sb_detect_vertex_collisionCachedEx(float opco[3], float facenormal[3], float
|
|||||||
*/
|
*/
|
||||||
if (deflected ==1){
|
if (deflected ==1){
|
||||||
VECCOPY(facenormal,force);
|
VECCOPY(facenormal,force);
|
||||||
Normalise(facenormal);
|
Normalize(facenormal);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
facenormal[0] = facenormal[1] = facenormal[2] = 0.0f;
|
facenormal[0] = facenormal[1] = facenormal[2] = 0.0f;
|
||||||
@ -2075,7 +2075,7 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow)
|
|||||||
/* mathematically it is completly nuts, but performace is pretty much (3) times faster */
|
/* mathematically it is completly nuts, but performace is pretty much (3) times faster */
|
||||||
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
|
if ((ABS(def[0]) > compare) || (ABS(def[1]) > compare) || (ABS(def[2]) > compare)) continue;
|
||||||
|
|
||||||
distance = Normalise(def);
|
distance = Normalize(def);
|
||||||
if (distance < compare ){
|
if (distance < compare ){
|
||||||
/* exclude body points attached with a spring */
|
/* exclude body points attached with a spring */
|
||||||
attached = 0;
|
attached = 0;
|
||||||
@ -2219,12 +2219,12 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow)
|
|||||||
if (( (sb->totpoint-a) == bs->v1) ){
|
if (( (sb->totpoint-a) == bs->v1) ){
|
||||||
actspringlen= VecLenf( (bproot+bs->v2)->pos, bp->pos);
|
actspringlen= VecLenf( (bproot+bs->v2)->pos, bp->pos);
|
||||||
VecSubf(sd,(bproot+bs->v2)->pos, bp->pos);
|
VecSubf(sd,(bproot+bs->v2)->pos, bp->pos);
|
||||||
Normalise(sd);
|
Normalize(sd);
|
||||||
|
|
||||||
/* friction stuff V1 */
|
/* friction stuff V1 */
|
||||||
VecSubf(velgoal,bp->vec,(bproot+bs->v2)->vec);
|
VecSubf(velgoal,bp->vec,(bproot+bs->v2)->vec);
|
||||||
kd = sb->infrict * sb_fric_force_scale(ob);
|
kd = sb->infrict * sb_fric_force_scale(ob);
|
||||||
absvel = Normalise(velgoal);
|
absvel = Normalize(velgoal);
|
||||||
projvel = ABS(Inpf(sd,velgoal));
|
projvel = ABS(Inpf(sd,velgoal));
|
||||||
kd *= absvel * projvel;
|
kd *= absvel * projvel;
|
||||||
Vec3PlusStVec(bp->force,-kd,velgoal);
|
Vec3PlusStVec(bp->force,-kd,velgoal);
|
||||||
@ -2242,12 +2242,12 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow)
|
|||||||
if (( (sb->totpoint-a) == bs->v2) ){
|
if (( (sb->totpoint-a) == bs->v2) ){
|
||||||
actspringlen= VecLenf( (bproot+bs->v1)->pos, bp->pos);
|
actspringlen= VecLenf( (bproot+bs->v1)->pos, bp->pos);
|
||||||
VecSubf(sd,bp->pos,(bproot+bs->v1)->pos);
|
VecSubf(sd,bp->pos,(bproot+bs->v1)->pos);
|
||||||
Normalise(sd);
|
Normalize(sd);
|
||||||
|
|
||||||
/* friction stuff V2 */
|
/* friction stuff V2 */
|
||||||
VecSubf(velgoal,bp->vec,(bproot+bs->v1)->vec);
|
VecSubf(velgoal,bp->vec,(bproot+bs->v1)->vec);
|
||||||
kd = sb->infrict * sb_fric_force_scale(ob);
|
kd = sb->infrict * sb_fric_force_scale(ob);
|
||||||
absvel = Normalise(velgoal);
|
absvel = Normalize(velgoal);
|
||||||
projvel = ABS(Inpf(sd,velgoal));
|
projvel = ABS(Inpf(sd,velgoal));
|
||||||
kd *= absvel * projvel;
|
kd *= absvel * projvel;
|
||||||
Vec3PlusStVec(bp->force,-kd,velgoal);
|
Vec3PlusStVec(bp->force,-kd,velgoal);
|
||||||
|
@ -118,10 +118,10 @@ static void recalculate_verseface_normals(VNode *vnode)
|
|||||||
vface = vface->next;
|
vface = vface->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we have to normalise all vertex normals */
|
/* we have to normalize all vertex normals */
|
||||||
vvert = vert_layer->dl.lb.first;
|
vvert = vert_layer->dl.lb.first;
|
||||||
while(vvert) {
|
while(vvert) {
|
||||||
Normalise(vvert->no);
|
Normalize(vvert->no);
|
||||||
vvert = vvert->next;
|
vvert = vvert->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -478,7 +478,7 @@ FloatLerpf(
|
|||||||
float fac
|
float fac
|
||||||
);
|
);
|
||||||
float
|
float
|
||||||
Normalise(
|
Normalize(
|
||||||
float *n
|
float *n
|
||||||
);
|
);
|
||||||
float
|
float
|
||||||
@ -944,7 +944,7 @@ Inp2f(
|
|||||||
float *v2
|
float *v2
|
||||||
);
|
);
|
||||||
float
|
float
|
||||||
Normalise2(
|
Normalize2(
|
||||||
float *n
|
float *n
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ int MTC_Mat4Invert(float inverse[][4], float mat[][4]);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Make the set of mat orthonormal (mat should already be orthogonal)?
|
* Make the set of mat orthonormal (mat should already be orthogonal)?
|
||||||
* (doesn't appear to normalise properly?)
|
* (doesn't appear to normalize properly?)
|
||||||
*/
|
*/
|
||||||
void MTC_Mat4Ortho(float mat[][4]);
|
void MTC_Mat4Ortho(float mat[][4]);
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ void MTC_swapInt(int *i1, int *i2);
|
|||||||
|
|
||||||
void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]);
|
void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]);
|
||||||
void MTC_cross3Double(double v1[3], double v2[3], double v3[3]);
|
void MTC_cross3Double(double v1[3], double v2[3], double v3[3]);
|
||||||
float MTC_normalise3DF(float n[3]);
|
float MTC_normalize3DF(float n[3]);
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
#endif /* VECTOROPS_H */
|
#endif /* VECTOROPS_H */
|
||||||
|
@ -95,12 +95,12 @@ float sasqrt(float fac)
|
|||||||
return (float)sqrt(fac);
|
return (float)sqrt(fac);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Normalise(float *n)
|
float Normalize(float *n)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
|
|
||||||
d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
|
d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
|
||||||
/* A larger value causes normalise errors in a scaled down models with camera xtreme close */
|
/* A larger value causes normalize errors in a scaled down models with camera xtreme close */
|
||||||
if(d>1.0e-35F) {
|
if(d>1.0e-35F) {
|
||||||
d= (float)sqrt(d);
|
d= (float)sqrt(d);
|
||||||
|
|
||||||
@ -1220,7 +1220,7 @@ void Mat3ToQuat_is_ok( float wmat[][3], float *q)
|
|||||||
nor[0] = mat[2][1]; /* cross product with (0,0,1) */
|
nor[0] = mat[2][1]; /* cross product with (0,0,1) */
|
||||||
nor[1] = -mat[2][0];
|
nor[1] = -mat[2][0];
|
||||||
nor[2] = 0.0;
|
nor[2] = 0.0;
|
||||||
Normalise(nor);
|
Normalize(nor);
|
||||||
|
|
||||||
co= mat[2][2];
|
co= mat[2][2];
|
||||||
angle= 0.5f*saacos(co);
|
angle= 0.5f*saacos(co);
|
||||||
@ -1341,7 +1341,7 @@ float *vectoquat( float *vec, short axis, short upflag)
|
|||||||
}
|
}
|
||||||
co/= len1;
|
co/= len1;
|
||||||
|
|
||||||
Normalise(nor);
|
Normalize(nor);
|
||||||
|
|
||||||
angle= 0.5f*saacos(co);
|
angle= 0.5f*saacos(co);
|
||||||
si= (float)sin(angle);
|
si= (float)sin(angle);
|
||||||
@ -1414,14 +1414,14 @@ void VecUpMat3old( float *vec, float mat[][3], short axis)
|
|||||||
mat[coz][0]= vec[0];
|
mat[coz][0]= vec[0];
|
||||||
mat[coz][1]= vec[1];
|
mat[coz][1]= vec[1];
|
||||||
mat[coz][2]= vec[2];
|
mat[coz][2]= vec[2];
|
||||||
Normalise((float *)mat[coz]);
|
Normalize((float *)mat[coz]);
|
||||||
|
|
||||||
inp= mat[coz][0]*up[0] + mat[coz][1]*up[1] + mat[coz][2]*up[2];
|
inp= mat[coz][0]*up[0] + mat[coz][1]*up[1] + mat[coz][2]*up[2];
|
||||||
mat[coy][0]= up[0] - inp*mat[coz][0];
|
mat[coy][0]= up[0] - inp*mat[coz][0];
|
||||||
mat[coy][1]= up[1] - inp*mat[coz][1];
|
mat[coy][1]= up[1] - inp*mat[coz][1];
|
||||||
mat[coy][2]= up[2] - inp*mat[coz][2];
|
mat[coy][2]= up[2] - inp*mat[coz][2];
|
||||||
|
|
||||||
Normalise((float *)mat[coy]);
|
Normalize((float *)mat[coy]);
|
||||||
|
|
||||||
Crossf(mat[cox], mat[coy], mat[coz]);
|
Crossf(mat[cox], mat[coy], mat[coz]);
|
||||||
|
|
||||||
@ -1460,14 +1460,14 @@ void VecUpMat3(float *vec, float mat[][3], short axis)
|
|||||||
mat[coz][0]= vec[0];
|
mat[coz][0]= vec[0];
|
||||||
mat[coz][1]= vec[1];
|
mat[coz][1]= vec[1];
|
||||||
mat[coz][2]= vec[2];
|
mat[coz][2]= vec[2];
|
||||||
Normalise((float *)mat[coz]);
|
Normalize((float *)mat[coz]);
|
||||||
|
|
||||||
inp= mat[coz][2];
|
inp= mat[coz][2];
|
||||||
mat[coy][0]= - inp*mat[coz][0];
|
mat[coy][0]= - inp*mat[coz][0];
|
||||||
mat[coy][1]= - inp*mat[coz][1];
|
mat[coy][1]= - inp*mat[coz][1];
|
||||||
mat[coy][2]= 1.0f - inp*mat[coz][2];
|
mat[coy][2]= 1.0f - inp*mat[coz][2];
|
||||||
|
|
||||||
Normalise((float *)mat[coy]);
|
Normalize((float *)mat[coy]);
|
||||||
|
|
||||||
Crossf(mat[cox], mat[coy], mat[coz]);
|
Crossf(mat[cox], mat[coy], mat[coz]);
|
||||||
|
|
||||||
@ -1751,20 +1751,20 @@ void i_lookat(float vx, float vy, float vz, float px, float py, float pz, float
|
|||||||
|
|
||||||
void Mat3Ortho(float mat[][3])
|
void Mat3Ortho(float mat[][3])
|
||||||
{
|
{
|
||||||
Normalise(mat[0]);
|
Normalize(mat[0]);
|
||||||
Normalise(mat[1]);
|
Normalize(mat[1]);
|
||||||
Normalise(mat[2]);
|
Normalize(mat[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mat4Ortho(float mat[][4])
|
void Mat4Ortho(float mat[][4])
|
||||||
{
|
{
|
||||||
float len;
|
float len;
|
||||||
|
|
||||||
len= Normalise(mat[0]);
|
len= Normalize(mat[0]);
|
||||||
if(len!=0.0) mat[0][3]/= len;
|
if(len!=0.0) mat[0][3]/= len;
|
||||||
len= Normalise(mat[1]);
|
len= Normalize(mat[1]);
|
||||||
if(len!=0.0) mat[1][3]/= len;
|
if(len!=0.0) mat[1][3]/= len;
|
||||||
len= Normalise(mat[2]);
|
len= Normalize(mat[2]);
|
||||||
if(len!=0.0) mat[2][3]/= len;
|
if(len!=0.0) mat[2][3]/= len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1876,7 +1876,7 @@ void CalcNormShort( short *v1, short *v2, short *v3, float *n) /* is also cross
|
|||||||
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
||||||
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
||||||
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
||||||
Normalise(n);
|
Normalize(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalcNormLong( int* v1, int*v2, int*v3, float *n)
|
void CalcNormLong( int* v1, int*v2, int*v3, float *n)
|
||||||
@ -1892,7 +1892,7 @@ void CalcNormLong( int* v1, int*v2, int*v3, float *n)
|
|||||||
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
||||||
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
||||||
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
||||||
Normalise(n);
|
Normalize(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
float CalcNormFloat( float *v1, float *v2, float *v3, float *n)
|
float CalcNormFloat( float *v1, float *v2, float *v3, float *n)
|
||||||
@ -1908,7 +1908,7 @@ float CalcNormFloat( float *v1, float *v2, float *v3, float *n)
|
|||||||
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
||||||
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
||||||
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
||||||
return Normalise(n);
|
return Normalize(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
float CalcNormFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
|
float CalcNormFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
|
||||||
@ -1928,7 +1928,7 @@ float CalcNormFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
|
|||||||
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
||||||
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
||||||
|
|
||||||
return Normalise(n);
|
return Normalize(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2022,12 +2022,12 @@ float AreaQ3Dfl( float *v1, float *v2, float *v3, float *v4) /* only convex Qu
|
|||||||
VecSubf(vec1, v2, v1);
|
VecSubf(vec1, v2, v1);
|
||||||
VecSubf(vec2, v4, v1);
|
VecSubf(vec2, v4, v1);
|
||||||
Crossf(n, vec1, vec2);
|
Crossf(n, vec1, vec2);
|
||||||
len= Normalise(n);
|
len= Normalize(n);
|
||||||
|
|
||||||
VecSubf(vec1, v4, v3);
|
VecSubf(vec1, v4, v3);
|
||||||
VecSubf(vec2, v2, v3);
|
VecSubf(vec2, v2, v3);
|
||||||
Crossf(n, vec1, vec2);
|
Crossf(n, vec1, vec2);
|
||||||
len+= Normalise(n);
|
len+= Normalize(n);
|
||||||
|
|
||||||
return (len/2.0f);
|
return (len/2.0f);
|
||||||
}
|
}
|
||||||
@ -2039,7 +2039,7 @@ float AreaT3Dfl( float *v1, float *v2, float *v3) /* Triangles */
|
|||||||
VecSubf(vec1, v3, v2);
|
VecSubf(vec1, v3, v2);
|
||||||
VecSubf(vec2, v1, v2);
|
VecSubf(vec2, v1, v2);
|
||||||
Crossf(n, vec1, vec2);
|
Crossf(n, vec1, vec2);
|
||||||
len= Normalise(n);
|
len= Normalize(n);
|
||||||
|
|
||||||
return (len/2.0f);
|
return (len/2.0f);
|
||||||
}
|
}
|
||||||
@ -2403,7 +2403,7 @@ void VecRotToQuat( float *vec, float phi, float *quat)
|
|||||||
quat[2]= vec[1];
|
quat[2]= vec[1];
|
||||||
quat[3]= vec[2];
|
quat[3]= vec[2];
|
||||||
|
|
||||||
if( Normalise(quat+1) == 0.0) {
|
if( Normalize(quat+1) == 0.0) {
|
||||||
QuatOne(quat);
|
QuatOne(quat);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2424,8 +2424,8 @@ float VecAngle3(float *v1, float *v2, float *v3)
|
|||||||
|
|
||||||
VecSubf(vec1, v2, v1);
|
VecSubf(vec1, v2, v1);
|
||||||
VecSubf(vec2, v2, v3);
|
VecSubf(vec2, v2, v3);
|
||||||
Normalise(vec1);
|
Normalize(vec1);
|
||||||
Normalise(vec2);
|
Normalize(vec2);
|
||||||
|
|
||||||
return NormalizedVecAngle2(vec1, vec2) * 180.0/M_PI;
|
return NormalizedVecAngle2(vec1, vec2) * 180.0/M_PI;
|
||||||
}
|
}
|
||||||
@ -2437,8 +2437,8 @@ float VecAngle2(float *v1, float *v2)
|
|||||||
|
|
||||||
VecCopyf(vec1, v1);
|
VecCopyf(vec1, v1);
|
||||||
VecCopyf(vec2, v2);
|
VecCopyf(vec2, v2);
|
||||||
Normalise(vec1);
|
Normalize(vec1);
|
||||||
Normalise(vec2);
|
Normalize(vec2);
|
||||||
|
|
||||||
return NormalizedVecAngle2(vec1, vec2)* 180.0/M_PI;
|
return NormalizedVecAngle2(vec1, vec2)* 180.0/M_PI;
|
||||||
}
|
}
|
||||||
@ -2585,11 +2585,11 @@ void Mat3ToSize( float mat[][3], float *size)
|
|||||||
float vec[3];
|
float vec[3];
|
||||||
|
|
||||||
VecCopyf(vec, mat[0]);
|
VecCopyf(vec, mat[0]);
|
||||||
size[0]= Normalise(vec);
|
size[0]= Normalize(vec);
|
||||||
VecCopyf(vec, mat[1]);
|
VecCopyf(vec, mat[1]);
|
||||||
size[1]= Normalise(vec);
|
size[1]= Normalize(vec);
|
||||||
VecCopyf(vec, mat[2]);
|
VecCopyf(vec, mat[2]);
|
||||||
size[2]= Normalise(vec);
|
size[2]= Normalize(vec);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2599,11 +2599,11 @@ void Mat4ToSize( float mat[][4], float *size)
|
|||||||
|
|
||||||
|
|
||||||
VecCopyf(vec, mat[0]);
|
VecCopyf(vec, mat[0]);
|
||||||
size[0]= Normalise(vec);
|
size[0]= Normalize(vec);
|
||||||
VecCopyf(vec, mat[1]);
|
VecCopyf(vec, mat[1]);
|
||||||
size[1]= Normalise(vec);
|
size[1]= Normalize(vec);
|
||||||
VecCopyf(vec, mat[2]);
|
VecCopyf(vec, mat[2]);
|
||||||
size[2]= Normalise(vec);
|
size[2]= Normalize(vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************* SPECIALS ******************* */
|
/* ************* SPECIALS ******************* */
|
||||||
@ -2619,7 +2619,7 @@ void triatoquat( float *v1, float *v2, float *v3, float *quat)
|
|||||||
n[0]= vec[1];
|
n[0]= vec[1];
|
||||||
n[1]= -vec[0];
|
n[1]= -vec[0];
|
||||||
n[2]= 0.0;
|
n[2]= 0.0;
|
||||||
Normalise(n);
|
Normalize(n);
|
||||||
|
|
||||||
if(n[0]==0.0 && n[1]==0.0) n[0]= 1.0;
|
if(n[0]==0.0 && n[1]==0.0) n[0]= 1.0;
|
||||||
|
|
||||||
@ -2639,7 +2639,7 @@ void triatoquat( float *v1, float *v2, float *v3, float *quat)
|
|||||||
|
|
||||||
/* what angle has this line with x-axis? */
|
/* what angle has this line with x-axis? */
|
||||||
vec[2]= 0.0;
|
vec[2]= 0.0;
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
|
|
||||||
angle= (float)(0.5*atan2(vec[1], vec[0]));
|
angle= (float)(0.5*atan2(vec[1], vec[0]));
|
||||||
co= (float)cos(angle);
|
co= (float)cos(angle);
|
||||||
@ -2700,7 +2700,7 @@ float Inp2f(float *v1, float *v2)
|
|||||||
return v1[0]*v2[0]+v1[1]*v2[1];
|
return v1[0]*v2[0]+v1[1]*v2[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
float Normalise2(float *n)
|
float Normalize2(float *n)
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
|
|
||||||
|
@ -267,11 +267,11 @@ void MTC_Mat4Ortho(float mat[][4])
|
|||||||
{
|
{
|
||||||
float len;
|
float len;
|
||||||
|
|
||||||
len= MTC_normalise3DF(mat[0]);
|
len= MTC_normalize3DF(mat[0]);
|
||||||
if(len!=0.0) mat[0][3]/= len;
|
if(len!=0.0) mat[0][3]/= len;
|
||||||
len= MTC_normalise3DF(mat[1]);
|
len= MTC_normalize3DF(mat[1]);
|
||||||
if(len!=0.0) mat[1][3]/= len;
|
if(len!=0.0) mat[1][3]/= len;
|
||||||
len= MTC_normalise3DF(mat[2]);
|
len= MTC_normalize3DF(mat[2]);
|
||||||
if(len!=0.0) mat[2][3]/= len;
|
if(len!=0.0) mat[2][3]/= len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,12 +141,12 @@ void MTC_diff3DFF(double v1[3], float v2[3], float v3[3])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
float MTC_normalise3DF(float n[3])
|
float MTC_normalize3DF(float n[3])
|
||||||
{
|
{
|
||||||
float d;
|
float d;
|
||||||
|
|
||||||
d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
|
d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
|
||||||
/* FLT_EPSILON is too large! A larger value causes normalise errors in */
|
/* FLT_EPSILON is too large! A larger value causes normalize errors in */
|
||||||
/* a scaled down utah teapot */
|
/* a scaled down utah teapot */
|
||||||
if(d>0.0000000000001) {
|
if(d>0.0000000000001) {
|
||||||
|
|
||||||
|
@ -389,16 +389,16 @@ void IMB_rect_from_float(struct ImBuf *ibuf);
|
|||||||
void IMB_float_from_rect(struct ImBuf *ibuf);
|
void IMB_float_from_rect(struct ImBuf *ibuf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the ordering of the colour bytes pointed to by rect from
|
* Change the ordering of the color bytes pointed to by rect from
|
||||||
* rgba to abgr. size * 4 colour bytes are reordered.
|
* rgba to abgr. size * 4 color bytes are reordered.
|
||||||
*
|
*
|
||||||
* @attention Defined in imageprocess.c
|
* @attention Defined in imageprocess.c
|
||||||
*/
|
*/
|
||||||
void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf);
|
void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the ordering of the colour bytes pointed to by rect from
|
* Change the ordering of the color bytes pointed to by rect from
|
||||||
* rgba to abgr. size * 4 colour bytes are reordered.
|
* rgba to abgr. size * 4 color bytes are reordered.
|
||||||
*
|
*
|
||||||
* @attention Defined in imageprocess.c
|
* @attention Defined in imageprocess.c
|
||||||
*/
|
*/
|
||||||
@ -492,14 +492,14 @@ void IMB_dit0(struct ImBuf * ibuf, short ofs, short bits);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* boolean toggle that tells whether or not to
|
* boolean toggle that tells whether or not to
|
||||||
* scale the colour map in the y-direction.
|
* scale the color map in the y-direction.
|
||||||
*
|
*
|
||||||
* @attention declared in hamx.c
|
* @attention declared in hamx.c
|
||||||
*/
|
*/
|
||||||
extern int scalecmapY;
|
extern int scalecmapY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This 'matrix' defines the transformation from rgb to bw colour
|
* This 'matrix' defines the transformation from rgb to bw color
|
||||||
* maps. You need to do a sort of dot-product for that. It is a matrix
|
* maps. You need to do a sort of dot-product for that. It is a matrix
|
||||||
* with fixed coefficients, extracted from some book.
|
* with fixed coefficients, extracted from some book.
|
||||||
*
|
*
|
||||||
|
@ -61,7 +61,7 @@ void lattice_foreachScreenVert(void (*func)(void *userData, struct BPoint *bp, i
|
|||||||
void nurbs_foreachScreenVert(void (*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, int x, int y), void *userData);
|
void nurbs_foreachScreenVert(void (*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, int x, int y), void *userData);
|
||||||
|
|
||||||
void drawcircball(int mode, float *cent, float rad, float tmat[][4]);
|
void drawcircball(int mode, float *cent, float rad, float tmat[][4]);
|
||||||
void get_local_bounds(struct Object *ob, float *centre, float *size);
|
void get_local_bounds(struct Object *ob, float *center, float *size);
|
||||||
|
|
||||||
/* drawing flags: */
|
/* drawing flags: */
|
||||||
#define DRAW_PICKING 1
|
#define DRAW_PICKING 1
|
||||||
|
@ -65,9 +65,9 @@ void exit_editmode(int flag);
|
|||||||
void check_editmode(int type);
|
void check_editmode(int type);
|
||||||
void enter_editmode(int wc);
|
void enter_editmode(int wc);
|
||||||
|
|
||||||
void docentre(int centremode);
|
void docenter(int centermode);
|
||||||
void docentre_new(void);
|
void docenter_new(void);
|
||||||
void docentre_cursor(void);
|
void docenter_cursor(void);
|
||||||
void movetolayer(void);
|
void movetolayer(void);
|
||||||
void special_editmenu(void);
|
void special_editmenu(void);
|
||||||
void convertmenu(void);
|
void convertmenu(void);
|
||||||
|
@ -48,7 +48,7 @@ void image_changed(struct SpaceImage *sima, int dotile);
|
|||||||
void image_home(void);
|
void image_home(void);
|
||||||
void image_viewmove(int mode);
|
void image_viewmove(int mode);
|
||||||
void image_viewzoom(unsigned short event, int invert);
|
void image_viewzoom(unsigned short event, int invert);
|
||||||
void image_viewcentre(void);
|
void image_viewcenter(void);
|
||||||
void uvco_to_areaco(float *vec, short *mval);
|
void uvco_to_areaco(float *vec, short *mval);
|
||||||
void uvco_to_areaco_noclip(float *vec, int *mval);
|
void uvco_to_areaco_noclip(float *vec, int *mval);
|
||||||
void what_image(struct SpaceImage *sima);
|
void what_image(struct SpaceImage *sima);
|
||||||
|
@ -76,7 +76,7 @@ void adduplicate_armature(void);
|
|||||||
void addvert_armature(void);
|
void addvert_armature(void);
|
||||||
void add_primitiveArmature(int type);
|
void add_primitiveArmature(int type);
|
||||||
void apply_rot_armature (struct Object *ob, float mat[3][3]);
|
void apply_rot_armature (struct Object *ob, float mat[3][3]);
|
||||||
void docentre_armature (struct Object *ob, int centremode);
|
void docenter_armature (struct Object *ob, int centermode);
|
||||||
|
|
||||||
void clear_armature(struct Object *ob, char mode);
|
void clear_armature(struct Object *ob, char mode);
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* This define converts a numerical value to the equivalent 24-bit
|
* This define converts a numerical value to the equivalent 24-bit
|
||||||
* colour, while not being endian-sensitive. On little-endians, this
|
* color, while not being endian-sensitive. On little-endians, this
|
||||||
* is the same as doing a 'naive'indexing, on big-endian, it is not!
|
* is the same as doing a 'naive'indexing, on big-endian, it is not!
|
||||||
* */
|
* */
|
||||||
#define cpack(x) glColor3ub( ((x)&0xFF), (((x)>>8)&0xFF), (((x)>>16)&0xFF) )
|
#define cpack(x) glColor3ub( ((x)&0xFF), (((x)>>8)&0xFF), (((x)>>16)&0xFF) )
|
||||||
|
@ -52,7 +52,7 @@ struct ScrArea;
|
|||||||
#define UI_LEFT 4
|
#define UI_LEFT 4
|
||||||
#define UI_RIGHT 8
|
#define UI_RIGHT 8
|
||||||
#define UI_DIRECTION 15
|
#define UI_DIRECTION 15
|
||||||
#define UI_CENTRE 16
|
#define UI_CENTER 16
|
||||||
#define UI_SHIFT_FLIPPED 32
|
#define UI_SHIFT_FLIPPED 32
|
||||||
|
|
||||||
/* uiBlock->autofill */
|
/* uiBlock->autofill */
|
||||||
|
@ -85,10 +85,10 @@ void setviewmatrixview3d(void);
|
|||||||
float *give_cursor(void);
|
float *give_cursor(void);
|
||||||
unsigned int free_localbit(void);
|
unsigned int free_localbit(void);
|
||||||
void initlocalview(void);
|
void initlocalview(void);
|
||||||
void centreview(void);
|
void centerview(void);
|
||||||
void restore_localviewdata(struct View3D *vd);
|
void restore_localviewdata(struct View3D *vd);
|
||||||
void endlocalview(struct ScrArea *sa);
|
void endlocalview(struct ScrArea *sa);
|
||||||
void view3d_home(int centre);
|
void view3d_home(int center);
|
||||||
short view3d_opengl_select(unsigned int *buffer, unsigned int buffsize, short x1, short y1, short x2, short y2);
|
short view3d_opengl_select(unsigned int *buffer, unsigned int buffsize, short x1, short y1, short x2, short y2);
|
||||||
void view3d_align_axis_to_vector(struct View3D *v3d, int axisidx, float vec[3]);
|
void view3d_align_axis_to_vector(struct View3D *v3d, int axisidx, float vec[3]);
|
||||||
|
|
||||||
|
@ -358,9 +358,9 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
|
|||||||
#define B_SETSMOOTH 2012
|
#define B_SETSMOOTH 2012
|
||||||
#define B_SETSOLID 2013
|
#define B_SETSOLID 2013
|
||||||
#define B_AUTOTEX 2014
|
#define B_AUTOTEX 2014
|
||||||
#define B_DOCENTRE 2015
|
#define B_DOCENTER 2015
|
||||||
#define B_DOCENTRENEW 2016
|
#define B_DOCENTERNEW 2016
|
||||||
#define B_DOCENTRECURSOR 2017
|
#define B_DOCENTERCURSOR 2017
|
||||||
|
|
||||||
/* 20 values! */
|
/* 20 values! */
|
||||||
#define B_OBLAY 2019
|
#define B_OBLAY 2019
|
||||||
|
@ -82,7 +82,7 @@ typedef struct TransCon {
|
|||||||
float mtx[3][3]; /* Matrix of the Constraint space */
|
float mtx[3][3]; /* Matrix of the Constraint space */
|
||||||
float imtx[3][3]; /* Inverse Matrix of the Constraint space */
|
float imtx[3][3]; /* Inverse Matrix of the Constraint space */
|
||||||
float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
|
float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
|
||||||
float center[3]; /* transformation centre to define where to draw the view widget
|
float center[3]; /* transformation center to define where to draw the view widget
|
||||||
ALWAYS in global space. Unlike the transformation center */
|
ALWAYS in global space. Unlike the transformation center */
|
||||||
short imval[2]; /* initial mouse value for visual calculation */
|
short imval[2]; /* initial mouse value for visual calculation */
|
||||||
/* the one in TransInfo is not garanty to stay the same (Rotates change it) */
|
/* the one in TransInfo is not garanty to stay the same (Rotates change it) */
|
||||||
|
@ -171,7 +171,7 @@ typedef struct RenderData {
|
|||||||
float ctime; /* use for calcutions */
|
float ctime; /* use for calcutions */
|
||||||
float framelen, blurfac;
|
float framelen, blurfac;
|
||||||
|
|
||||||
/** For UR edge rendering: give the edges this colour */
|
/** For UR edge rendering: give the edges this color */
|
||||||
float edgeR, edgeG, edgeB;
|
float edgeR, edgeG, edgeB;
|
||||||
|
|
||||||
short fullscreen, xplay, yplay, freqplay; /* standalone player */
|
short fullscreen, xplay, yplay, freqplay; /* standalone player */
|
||||||
|
@ -99,7 +99,7 @@ typedef struct View3D {
|
|||||||
struct RetopoViewData *retopo_view_data;
|
struct RetopoViewData *retopo_view_data;
|
||||||
struct ViewDepths *depths;
|
struct ViewDepths *depths;
|
||||||
|
|
||||||
char ob_centre_bone[32]; /* optional string for armature bone to define centre */
|
char ob_centre_bone[32]; /* optional string for armature bone to define center */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The drawing mode for the 3d display. Set to OB_WIRE, OB_SOLID,
|
* The drawing mode for the 3d display. Set to OB_WIRE, OB_SOLID,
|
||||||
@ -176,7 +176,7 @@ typedef struct View3D {
|
|||||||
|
|
||||||
|
|
||||||
/* View3D->around */
|
/* View3D->around */
|
||||||
#define V3D_CENTRE 0
|
#define V3D_CENTER 0
|
||||||
#define V3D_CENTROID 3
|
#define V3D_CENTROID 3
|
||||||
#define V3D_CURSOR 1
|
#define V3D_CURSOR 1
|
||||||
#define V3D_LOCAL 2
|
#define V3D_LOCAL 2
|
||||||
|
@ -46,9 +46,9 @@ struct MTex;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* World defines general modelling data such as a background fill,
|
* World defines general modeling data such as a background fill,
|
||||||
* gravity, colour model, stars, etc. It mixes game-data, rendering
|
* gravity, color model, stars, etc. It mixes game-data, rendering
|
||||||
* data and modelling data. */
|
* data and modeling data. */
|
||||||
typedef struct World {
|
typedef struct World {
|
||||||
ID id;
|
ID id;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ static void node_shader_exec_camera(void *data, bNode *node, bNodeStack **in, bN
|
|||||||
|
|
||||||
VECCOPY(out[0]->vec, shi->co); /* get view vector */
|
VECCOPY(out[0]->vec, shi->co); /* get view vector */
|
||||||
out[1]->vec[0]= fabs(shi->co[2]); /* get view z-depth */
|
out[1]->vec[0]= fabs(shi->co[2]); /* get view z-depth */
|
||||||
out[2]->vec[0]= Normalise(out[0]->vec); /* get view distance */
|
out[2]->vec[0]= Normalize(out[0]->vec); /* get view distance */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
|
|||||||
/* retrieve normal */
|
/* retrieve normal */
|
||||||
if(in[MAT_IN_NORMAL]->hasinput) {
|
if(in[MAT_IN_NORMAL]->hasinput) {
|
||||||
nodestack_get_vec(shi->vn, SOCK_VECTOR, in[MAT_IN_NORMAL]);
|
nodestack_get_vec(shi->vn, SOCK_VECTOR, in[MAT_IN_NORMAL]);
|
||||||
Normalise(shi->vn);
|
Normalize(shi->vn);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
VECCOPY(shi->vn, shi->vno);
|
VECCOPY(shi->vn, shi->vno);
|
||||||
|
@ -70,7 +70,7 @@ static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in,
|
|||||||
out[0]->vec[1]= vec1[1] + vec2[1];
|
out[0]->vec[1]= vec1[1] + vec2[1];
|
||||||
out[0]->vec[2]= vec1[2] + vec2[2];
|
out[0]->vec[2]= vec1[2] + vec2[2];
|
||||||
|
|
||||||
out[1]->vec[0] = Normalise( out[0]->vec );
|
out[1]->vec[0] = Normalize( out[0]->vec );
|
||||||
}
|
}
|
||||||
else if(node->custom1 == 3) { /* Dot product */
|
else if(node->custom1 == 3) { /* Dot product */
|
||||||
out[1]->vec[0]= (vec1[0] * vec2[0]) + (vec1[1] * vec2[1]) + (vec1[2] * vec2[2]);
|
out[1]->vec[0]= (vec1[0] * vec2[0]) + (vec1[1] * vec2[1]) + (vec1[2] * vec2[2]);
|
||||||
@ -80,7 +80,7 @@ static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in,
|
|||||||
out[0]->vec[1]= (vec1[2] * vec2[0]) - (vec1[0] * vec2[2]);
|
out[0]->vec[1]= (vec1[2] * vec2[0]) - (vec1[0] * vec2[2]);
|
||||||
out[0]->vec[2]= (vec1[0] * vec2[1]) - (vec1[1] * vec2[0]);
|
out[0]->vec[2]= (vec1[0] * vec2[1]) - (vec1[1] * vec2[0]);
|
||||||
|
|
||||||
out[1]->vec[0] = Normalise( out[0]->vec );
|
out[1]->vec[0] = Normalize( out[0]->vec );
|
||||||
}
|
}
|
||||||
else if(node->custom1 == 5) { /* Normalize */
|
else if(node->custom1 == 5) { /* Normalize */
|
||||||
if(in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
|
if(in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */
|
||||||
@ -94,7 +94,7 @@ static void node_shader_exec_vect_math(void *data, bNode *node, bNodeStack **in,
|
|||||||
out[0]->vec[2]= vec2[2];
|
out[0]->vec[2]= vec2[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
out[1]->vec[0] = Normalise( out[0]->vec );
|
out[1]->vec[0] = Normalize( out[0]->vec );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1389,7 +1389,7 @@ PyObject *M_Mathutils_Intersect( PyObject * self, PyObject * args )
|
|||||||
VECCOPY(v3, vec3->vec);
|
VECCOPY(v3, vec3->vec);
|
||||||
|
|
||||||
VECCOPY(dir, ray->vec);
|
VECCOPY(dir, ray->vec);
|
||||||
Normalise(dir);
|
Normalize(dir);
|
||||||
|
|
||||||
VECCOPY(orig, ray_off->vec);
|
VECCOPY(orig, ray_off->vec);
|
||||||
|
|
||||||
@ -1485,9 +1485,9 @@ PyObject *M_Mathutils_LineIntersect( PyObject * self, PyObject * args )
|
|||||||
VecSubf(b, v4, v3);
|
VecSubf(b, v4, v3);
|
||||||
|
|
||||||
VECCOPY(dir1, a);
|
VECCOPY(dir1, a);
|
||||||
Normalise(dir1);
|
Normalize(dir1);
|
||||||
VECCOPY(dir2, b);
|
VECCOPY(dir2, b);
|
||||||
Normalise(dir2);
|
Normalize(dir2);
|
||||||
d = Inpf(dir1, dir2);
|
d = Inpf(dir1, dir2);
|
||||||
if (d == 1.0f || d == -1.0f) {
|
if (d == 1.0f || d == -1.0f) {
|
||||||
/* colinear */
|
/* colinear */
|
||||||
@ -1577,18 +1577,18 @@ PyObject *M_Mathutils_QuadNormal( PyObject * self, PyObject * args )
|
|||||||
VecSubf(e2, v3, v2);
|
VecSubf(e2, v3, v2);
|
||||||
|
|
||||||
Crossf(n1, e2, e1);
|
Crossf(n1, e2, e1);
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
|
|
||||||
/* find vectors for two edges sharing v4 */
|
/* find vectors for two edges sharing v4 */
|
||||||
VecSubf(e1, v3, v4);
|
VecSubf(e1, v3, v4);
|
||||||
VecSubf(e2, v1, v4);
|
VecSubf(e2, v1, v4);
|
||||||
|
|
||||||
Crossf(n2, e2, e1);
|
Crossf(n2, e2, e1);
|
||||||
Normalise(n2);
|
Normalize(n2);
|
||||||
|
|
||||||
/* adding and averaging the normals of both triangles */
|
/* adding and averaging the normals of both triangles */
|
||||||
VecAddf(n1, n2, n1);
|
VecAddf(n1, n2, n1);
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
|
|
||||||
return newVectorObject(n1, 3, Py_NEW);
|
return newVectorObject(n1, 3, Py_NEW);
|
||||||
}
|
}
|
||||||
@ -1620,7 +1620,7 @@ PyObject *M_Mathutils_TriangleNormal( PyObject * self, PyObject * args )
|
|||||||
VecSubf(e2, v3, v2);
|
VecSubf(e2, v3, v2);
|
||||||
|
|
||||||
Crossf(n, e2, e1);
|
Crossf(n, e2, e1);
|
||||||
Normalise(n);
|
Normalize(n);
|
||||||
|
|
||||||
return newVectorObject(n, 3, Py_NEW);
|
return newVectorObject(n, 3, Py_NEW);
|
||||||
}
|
}
|
||||||
|
@ -1018,7 +1018,7 @@ static int MVert_setNormal( BPy_MVert * self, VectorObject * value )
|
|||||||
for( i=0; i<3 ; ++i)
|
for( i=0; i<3 ; ++i)
|
||||||
normal[i] = value->vec[i];
|
normal[i] = value->vec[i];
|
||||||
|
|
||||||
Normalise(normal);
|
Normalize(normal);
|
||||||
|
|
||||||
for( i=0; i<3 ; ++i)
|
for( i=0; i<3 ; ++i)
|
||||||
v->no[i] = (short)(normal[i]*32767.0);
|
v->no[i] = (short)(normal[i]*32767.0);
|
||||||
@ -5857,7 +5857,7 @@ static PyObject *Mesh_transform( BPy_Mesh *self, PyObject *args )
|
|||||||
vec[0] = nx*invmat[0][0] + ny*invmat[0][1] + nz*invmat[0][2];
|
vec[0] = nx*invmat[0][0] + ny*invmat[0][1] + nz*invmat[0][2];
|
||||||
vec[1] = nx*invmat[1][0] + ny*invmat[1][1] + nz*invmat[1][2];
|
vec[1] = nx*invmat[1][0] + ny*invmat[1][1] + nz*invmat[1][2];
|
||||||
vec[2] = nx*invmat[2][0] + ny*invmat[2][1] + nz*invmat[2][2];
|
vec[2] = nx*invmat[2][0] + ny*invmat[2][1] + nz*invmat[2][2];
|
||||||
Normalise( vec );
|
Normalize( vec );
|
||||||
mv->no[0] = (short)(vec[0] * 32767.0);
|
mv->no[0] = (short)(vec[0] * 32767.0);
|
||||||
mv->no[1] = (short)(vec[1] * 32767.0);
|
mv->no[1] = (short)(vec[1] * 32767.0);
|
||||||
mv->no[2] = (short)(vec[2] * 32767.0);
|
mv->no[2] = (short)(vec[2] * 32767.0);
|
||||||
|
@ -234,8 +234,8 @@ static char NMesh_hasFaceUV_doc[] =
|
|||||||
The optional argument sets the textured faces flag";
|
The optional argument sets the textured faces flag";
|
||||||
|
|
||||||
static char NMesh_hasVertexColours_doc[] =
|
static char NMesh_hasVertexColours_doc[] =
|
||||||
"(flag = None) - returns 1 if Mesh has vertex colours.\n\
|
"(flag = None) - returns 1 if Mesh has vertex colors.\n\
|
||||||
The optional argument sets the vertex colour flag";
|
The optional argument sets the vertex color flag";
|
||||||
|
|
||||||
static char NMesh_getVertexInfluences_doc[] =
|
static char NMesh_getVertexInfluences_doc[] =
|
||||||
"Return a list of the influences of bones in the vertex \n\
|
"Return a list of the influences of bones in the vertex \n\
|
||||||
@ -4171,7 +4171,7 @@ static PyObject *NMesh_transform (PyObject *self, PyObject *args)
|
|||||||
mv->no[0] = vx*invmat[0][0] + vy*invmat[0][1] + vz*invmat[0][2];
|
mv->no[0] = vx*invmat[0][0] + vy*invmat[0][1] + vz*invmat[0][2];
|
||||||
mv->no[1] = vx*invmat[1][0] + vy*invmat[1][1] + vz*invmat[1][2];
|
mv->no[1] = vx*invmat[1][0] + vy*invmat[1][1] + vz*invmat[1][2];
|
||||||
mv->no[2] = vx*invmat[2][0] + vy*invmat[2][1] + vz*invmat[2][2];
|
mv->no[2] = vx*invmat[2][0] + vy*invmat[2][1] + vz*invmat[2][2];
|
||||||
Normalise(mv->no);
|
Normalize(mv->no);
|
||||||
Py_DECREF(mv);
|
Py_DECREF(mv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ static PyObject *Quaternion_getattr(QuaternionObject * self, char *name)
|
|||||||
for(x = 0; x < 3; x++) {
|
for(x = 0; x < 3; x++) {
|
||||||
vec[x] = (float)(self->quat[x + 1] / mag);
|
vec[x] = (float)(self->quat[x + 1] / mag);
|
||||||
}
|
}
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
//If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations
|
//If the axis of rotation is 0,0,0 set it to 1,0,0 - for zero-degree rotations
|
||||||
if( EXPP_FloatsAreEqual(vec[0], 0.0f, 10) &&
|
if( EXPP_FloatsAreEqual(vec[0], 0.0f, 10) &&
|
||||||
EXPP_FloatsAreEqual(vec[1], 0.0f, 10) &&
|
EXPP_FloatsAreEqual(vec[1], 0.0f, 10) &&
|
||||||
|
@ -2292,7 +2292,7 @@ static PyMethodDef BPy_RenderData_methods[] = {
|
|||||||
METH_NOARGS,
|
METH_NOARGS,
|
||||||
"() - enable premultiply alpha"},
|
"() - enable premultiply alpha"},
|
||||||
{"enableKey", ( PyCFunction ) RenderData_EnableKey, METH_NOARGS,
|
{"enableKey", ( PyCFunction ) RenderData_EnableKey, METH_NOARGS,
|
||||||
"() - enable alpha and colour values remain unchanged"},
|
"() - enable alpha and color values remain unchanged"},
|
||||||
{"enableShadow", ( PyCFunction ) RenderData_EnableShadow, METH_VARARGS,
|
{"enableShadow", ( PyCFunction ) RenderData_EnableShadow, METH_VARARGS,
|
||||||
"(bool) - enable/disable shadow calculation"},
|
"(bool) - enable/disable shadow calculation"},
|
||||||
{"enablePanorama", ( PyCFunction ) RenderData_EnablePanorama,
|
{"enablePanorama", ( PyCFunction ) RenderData_EnablePanorama,
|
||||||
|
@ -317,7 +317,7 @@ void drawsquare(float *cent, float size, short cox, short coy)
|
|||||||
|
|
||||||
void drawlimits()
|
void drawlimits()
|
||||||
{
|
{
|
||||||
/* centre around cent */
|
/* center around cent */
|
||||||
short cox=0, coy=1;
|
short cox=0, coy=1;
|
||||||
|
|
||||||
if((RG.flag & 3)==2) coy= 2;
|
if((RG.flag & 3)==2) coy= 2;
|
||||||
|
@ -82,20 +82,20 @@ float calcStokefactor(RPatch *shoot, RPatch *rp, RNode *rn, float *area)
|
|||||||
VecSubf(vec[2], shoot->cent, rn->v3);
|
VecSubf(vec[2], shoot->cent, rn->v3);
|
||||||
VecSubf(vec[3], shoot->cent, rn->v4);
|
VecSubf(vec[3], shoot->cent, rn->v4);
|
||||||
|
|
||||||
Normalise(vec[0]);
|
Normalize(vec[0]);
|
||||||
Normalise(vec[1]);
|
Normalize(vec[1]);
|
||||||
Normalise(vec[2]);
|
Normalize(vec[2]);
|
||||||
Normalise(vec[3]);
|
Normalize(vec[3]);
|
||||||
|
|
||||||
/* cross product */
|
/* cross product */
|
||||||
Crossf(cross[0], vec[0], vec[1]);
|
Crossf(cross[0], vec[0], vec[1]);
|
||||||
Crossf(cross[1], vec[1], vec[2]);
|
Crossf(cross[1], vec[1], vec[2]);
|
||||||
Crossf(cross[2], vec[2], vec[3]);
|
Crossf(cross[2], vec[2], vec[3]);
|
||||||
Crossf(cross[3], vec[3], vec[0]);
|
Crossf(cross[3], vec[3], vec[0]);
|
||||||
Normalise(cross[0]);
|
Normalize(cross[0]);
|
||||||
Normalise(cross[1]);
|
Normalize(cross[1]);
|
||||||
Normalise(cross[2]);
|
Normalize(cross[2]);
|
||||||
Normalise(cross[3]);
|
Normalize(cross[3]);
|
||||||
|
|
||||||
/* angles */
|
/* angles */
|
||||||
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
|
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
|
||||||
@ -126,17 +126,17 @@ float calcStokefactor(RPatch *shoot, RPatch *rp, RNode *rn, float *area)
|
|||||||
VecSubf(vec[1], shoot->cent, rn->v2);
|
VecSubf(vec[1], shoot->cent, rn->v2);
|
||||||
VecSubf(vec[2], shoot->cent, rn->v3);
|
VecSubf(vec[2], shoot->cent, rn->v3);
|
||||||
|
|
||||||
Normalise(vec[0]);
|
Normalize(vec[0]);
|
||||||
Normalise(vec[1]);
|
Normalize(vec[1]);
|
||||||
Normalise(vec[2]);
|
Normalize(vec[2]);
|
||||||
|
|
||||||
/* cross product */
|
/* cross product */
|
||||||
Crossf(cross[0], vec[0], vec[1]);
|
Crossf(cross[0], vec[0], vec[1]);
|
||||||
Crossf(cross[1], vec[1], vec[2]);
|
Crossf(cross[1], vec[1], vec[2]);
|
||||||
Crossf(cross[2], vec[2], vec[0]);
|
Crossf(cross[2], vec[2], vec[0]);
|
||||||
Normalise(cross[0]);
|
Normalize(cross[0]);
|
||||||
Normalise(cross[1]);
|
Normalize(cross[1]);
|
||||||
Normalise(cross[2]);
|
Normalize(cross[2]);
|
||||||
|
|
||||||
/* angles */
|
/* angles */
|
||||||
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
|
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
|
||||||
@ -322,7 +322,7 @@ int makeformfactors(RPatch *shoot)
|
|||||||
vec[1]= (float)BLI_drand();
|
vec[1]= (float)BLI_drand();
|
||||||
vec[2]= (float)BLI_drand();
|
vec[2]= (float)BLI_drand();
|
||||||
Crossf(up, shoot->norm, vec);
|
Crossf(up, shoot->norm, vec);
|
||||||
len= Normalise(up);
|
len= Normalize(up);
|
||||||
/* this safety for input normals that are zero or illegal sized */
|
/* this safety for input normals that are zero or illegal sized */
|
||||||
if(a>3) return 0;
|
if(a>3) return 0;
|
||||||
} while(len==0.0 || len>1.0);
|
} while(len==0.0 || len>1.0);
|
||||||
|
@ -124,9 +124,9 @@ void triaweight(Face *face, int *w1, int *w2, int *w3)
|
|||||||
n3[0]= face->v1[0]-face->v3[0];
|
n3[0]= face->v1[0]-face->v3[0];
|
||||||
n3[1]= face->v1[1]-face->v3[1];
|
n3[1]= face->v1[1]-face->v3[1];
|
||||||
n3[2]= face->v1[2]-face->v3[2];
|
n3[2]= face->v1[2]-face->v3[2];
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
Normalise(n2);
|
Normalize(n2);
|
||||||
Normalise(n3);
|
Normalize(n3);
|
||||||
temp= 32.0/(PI);
|
temp= 32.0/(PI);
|
||||||
*w1= 0.5+temp*acos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]);
|
*w1= 0.5+temp*acos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]);
|
||||||
*w2= 0.5+temp*acos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
*w2= 0.5+temp*acos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
||||||
@ -785,7 +785,7 @@ void rad_addmesh(void)
|
|||||||
|
|
||||||
BLI_ghash_free(verthash, NULL, NULL);
|
BLI_ghash_free(verthash, NULL, NULL);
|
||||||
|
|
||||||
/* boundbox and centre new */
|
/* boundbox and center new */
|
||||||
INIT_MINMAX(min, max);
|
INIT_MINMAX(min, max);
|
||||||
|
|
||||||
mvert= me->mvert;
|
mvert= me->mvert;
|
||||||
|
@ -177,7 +177,7 @@ static void makeformfactors_rr(Render *re, VlakRen *shoot)
|
|||||||
|
|
||||||
VecSubf(vec, shoot->v1->co, shoot->radface->cent);
|
VecSubf(vec, shoot->v1->co, shoot->radface->cent);
|
||||||
Crossf(up, shoot->radface->norm, vec);
|
Crossf(up, shoot->radface->norm, vec);
|
||||||
len= Normalise(up);
|
len= Normalize(up);
|
||||||
|
|
||||||
VECCOPY(hemitop.up, up);
|
VECCOPY(hemitop.up, up);
|
||||||
VECCOPY(hemiside.up, shoot->radface->norm);
|
VECCOPY(hemiside.up, shoot->radface->norm);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
/* pixelshading.h
|
/* pixelshading.h
|
||||||
*
|
*
|
||||||
* These functions determine what actual colour a pixel will have.
|
* These functions determine what actual color a pixel will have.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -549,12 +549,12 @@ static void calc_vertexnormals(Render *re, int startvert, int startvlak, int do_
|
|||||||
vlr->flag |= R_NOPUNOFLIP;
|
vlr->flag |= R_NOPUNOFLIP;
|
||||||
|
|
||||||
VecSubf(n1, v2->co, v1->co);
|
VecSubf(n1, v2->co, v1->co);
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
VecSubf(n2, v3->co, v2->co);
|
VecSubf(n2, v3->co, v2->co);
|
||||||
Normalise(n2);
|
Normalize(n2);
|
||||||
if(v4==NULL) {
|
if(v4==NULL) {
|
||||||
VecSubf(n3, v1->co, v3->co);
|
VecSubf(n3, v1->co, v3->co);
|
||||||
Normalise(n3);
|
Normalize(n3);
|
||||||
|
|
||||||
fac1= saacos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]);
|
fac1= saacos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]);
|
||||||
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
||||||
@ -562,9 +562,9 @@ static void calc_vertexnormals(Render *re, int startvert, int startvlak, int do_
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VecSubf(n3, v4->co, v3->co);
|
VecSubf(n3, v4->co, v3->co);
|
||||||
Normalise(n3);
|
Normalize(n3);
|
||||||
VecSubf(n4, v1->co, v4->co);
|
VecSubf(n4, v1->co, v4->co);
|
||||||
Normalise(n4);
|
Normalize(n4);
|
||||||
|
|
||||||
fac1= saacos(-n4[0]*n1[0]-n4[1]*n1[1]-n4[2]*n1[2]);
|
fac1= saacos(-n4[0]*n1[0]-n4[1]*n1[1]-n4[2]*n1[2]);
|
||||||
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
||||||
@ -623,10 +623,10 @@ static void calc_vertexnormals(Render *re, int startvert, int startvlak, int do_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* normalise vertex normals */
|
/* normalize vertex normals */
|
||||||
for(a=startvert; a<re->totvert; a++) {
|
for(a=startvert; a<re->totvert; a++) {
|
||||||
VertRen *ver= RE_findOrAddVert(re, a);
|
VertRen *ver= RE_findOrAddVert(re, a);
|
||||||
Normalise(ver->n);
|
Normalize(ver->n);
|
||||||
if(do_tangent) {
|
if(do_tangent) {
|
||||||
float *tav= RE_vertren_get_tangent(re, ver, 0);
|
float *tav= RE_vertren_get_tangent(re, ver, 0);
|
||||||
if (tav) {
|
if (tav) {
|
||||||
@ -635,7 +635,7 @@ static void calc_vertexnormals(Render *re, int startvert, int startvlak, int do_
|
|||||||
tav[0] -= ver->n[0]*tdn;
|
tav[0] -= ver->n[0]*tdn;
|
||||||
tav[1] -= ver->n[1]*tdn;
|
tav[1] -= ver->n[1]*tdn;
|
||||||
tav[2] -= ver->n[2]*tdn;
|
tav[2] -= ver->n[2]*tdn;
|
||||||
Normalise(tav);
|
Normalize(tav);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -685,21 +685,21 @@ static void calc_fluidsimnormals(Render *re, int startvert, int startvlak, int d
|
|||||||
vlr->flag |= R_NOPUNOFLIP;
|
vlr->flag |= R_NOPUNOFLIP;
|
||||||
|
|
||||||
VecSubf(n1, v2->co, v1->co);
|
VecSubf(n1, v2->co, v1->co);
|
||||||
Normalise(n1);
|
Normalize(n1);
|
||||||
VecSubf(n2, v3->co, v2->co);
|
VecSubf(n2, v3->co, v2->co);
|
||||||
Normalise(n2);
|
Normalize(n2);
|
||||||
if(v4==NULL) {
|
if(v4==NULL) {
|
||||||
VecSubf(n3, v1->co, v3->co);
|
VecSubf(n3, v1->co, v3->co);
|
||||||
Normalise(n3);
|
Normalize(n3);
|
||||||
fac1= saacos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]);
|
fac1= saacos(-n1[0]*n3[0]-n1[1]*n3[1]-n1[2]*n3[2]);
|
||||||
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
||||||
fac3= saacos(-n2[0]*n3[0]-n2[1]*n3[1]-n2[2]*n3[2]);
|
fac3= saacos(-n2[0]*n3[0]-n2[1]*n3[1]-n2[2]*n3[2]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VecSubf(n3, v4->co, v3->co);
|
VecSubf(n3, v4->co, v3->co);
|
||||||
Normalise(n3);
|
Normalize(n3);
|
||||||
VecSubf(n4, v1->co, v4->co);
|
VecSubf(n4, v1->co, v4->co);
|
||||||
Normalise(n4);
|
Normalize(n4);
|
||||||
|
|
||||||
fac1= saacos(-n4[0]*n1[0]-n4[1]*n1[1]-n4[2]*n1[2]);
|
fac1= saacos(-n4[0]*n1[0]-n4[1]*n1[1]-n4[2]*n1[2]);
|
||||||
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
fac2= saacos(-n1[0]*n2[0]-n1[1]*n2[1]-n1[2]*n2[2]);
|
||||||
@ -738,13 +738,13 @@ static void calc_fluidsimnormals(Render *re, int startvert, int startvlak, int d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* normalise vertex normals */
|
/* normalize vertex normals */
|
||||||
for(a=startvert; a<re->totvert; a++) {
|
for(a=startvert; a<re->totvert; a++) {
|
||||||
VertRen *ver= RE_findOrAddVert(re, a);
|
VertRen *ver= RE_findOrAddVert(re, a);
|
||||||
Normalise(ver->n);
|
Normalize(ver->n);
|
||||||
if(do_tangent) {
|
if(do_tangent) {
|
||||||
float *tav= RE_vertren_get_tangent(re, ver, 0);
|
float *tav= RE_vertren_get_tangent(re, ver, 0);
|
||||||
if(tav) Normalise(tav);
|
if(tav) Normalize(tav);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1025,10 +1025,10 @@ static void make_render_halos(Render *re, Object *ob, Mesh *me, int totvert, MVe
|
|||||||
nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||||
nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||||
nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||||
Normalise(nor);
|
Normalize(nor);
|
||||||
|
|
||||||
VECCOPY(view, vec);
|
VECCOPY(view, vec);
|
||||||
Normalise(view);
|
Normalize(view);
|
||||||
|
|
||||||
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
|
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
|
||||||
if(zn>=0.0) hasize= 0.0;
|
if(zn>=0.0) hasize= 0.0;
|
||||||
@ -1180,10 +1180,10 @@ static void render_particle_system(Render *re, Object *ob, Object *par, PartEff
|
|||||||
nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||||
nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||||
nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||||
Normalise(nor);
|
Normalize(nor);
|
||||||
|
|
||||||
VECCOPY(view, vec);
|
VECCOPY(view, vec);
|
||||||
Normalise(view);
|
Normalize(view);
|
||||||
|
|
||||||
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
|
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
|
||||||
if(zn>=0.0) hasize= 0.0;
|
if(zn>=0.0) hasize= 0.0;
|
||||||
@ -1195,7 +1195,7 @@ static void render_particle_system(Render *re, Object *ob, Object *par, PartEff
|
|||||||
har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed);
|
har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed);
|
||||||
if(har && ma->mode & MA_HALO_SHADE) {
|
if(har && ma->mode & MA_HALO_SHADE) {
|
||||||
VecSubf(har->no, vec, vec1);
|
VecSubf(har->no, vec, vec1);
|
||||||
Normalise(har->no);
|
Normalize(har->no);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(har) har->lay= ob->lay;
|
if(har) har->lay= ob->lay;
|
||||||
@ -1227,7 +1227,7 @@ static void static_particle_strand(Render *re, Object *ob, Material *ma, float *
|
|||||||
int flag;
|
int flag;
|
||||||
|
|
||||||
VecSubf(nor, vec, vec1);
|
VecSubf(nor, vec, vec1);
|
||||||
Normalise(nor); // nor needed as tangent
|
Normalize(nor); // nor needed as tangent
|
||||||
Crossf(cross, vec, nor);
|
Crossf(cross, vec, nor);
|
||||||
|
|
||||||
/* turn cross in pixelsize */
|
/* turn cross in pixelsize */
|
||||||
@ -1405,7 +1405,7 @@ static void render_static_particle_system(Render *re, Object *ob, PartEff *paf)
|
|||||||
VECCOPY(v1->co, vec);
|
VECCOPY(v1->co, vec);
|
||||||
|
|
||||||
VecSubf(vlr->n, vec, vec1);
|
VecSubf(vlr->n, vec, vec1);
|
||||||
Normalise(vlr->n);
|
Normalize(vlr->n);
|
||||||
VECCOPY(v1->n, vlr->n);
|
VECCOPY(v1->n, vlr->n);
|
||||||
|
|
||||||
vlr->mat= ma;
|
vlr->mat= ma;
|
||||||
@ -1433,10 +1433,10 @@ static void render_static_particle_system(Render *re, Object *ob, PartEff *paf)
|
|||||||
nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
nor[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||||
nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
nor[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||||
nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
nor[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||||
Normalise(nor);
|
Normalize(nor);
|
||||||
|
|
||||||
VECCOPY(view, vec);
|
VECCOPY(view, vec);
|
||||||
Normalise(view);
|
Normalize(view);
|
||||||
|
|
||||||
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
|
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
|
||||||
if(zn>=0.0) hasize= 0.0;
|
if(zn>=0.0) hasize= 0.0;
|
||||||
@ -1448,7 +1448,7 @@ static void render_static_particle_system(Render *re, Object *ob, PartEff *paf)
|
|||||||
har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed);
|
har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed);
|
||||||
if(har && (ma->mode & MA_HALO_SHADE)) {
|
if(har && (ma->mode & MA_HALO_SHADE)) {
|
||||||
VecSubf(har->no, vec, vec1);
|
VecSubf(har->no, vec, vec1);
|
||||||
Normalise(har->no);
|
Normalize(har->no);
|
||||||
har->lay= ob->lay;
|
har->lay= ob->lay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1583,7 +1583,7 @@ static void init_render_mball(Render *re, Object *ob)
|
|||||||
ver->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
ver->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||||
ver->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
ver->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||||
ver->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
ver->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||||
Normalise(ver->n);
|
Normalize(ver->n);
|
||||||
//if(ob->transflag & OB_NEG_SCALE) VecMulf(ver->n. -1.0);
|
//if(ob->transflag & OB_NEG_SCALE) VecMulf(ver->n. -1.0);
|
||||||
|
|
||||||
if(need_orco) ver->orco= data;
|
if(need_orco) ver->orco= data;
|
||||||
@ -2045,7 +2045,7 @@ static void init_render_mesh(Render *re, Object *ob, Object *par, int only_verts
|
|||||||
vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
vlr->n[0]= imat[0][0]*xn+imat[0][1]*yn+imat[0][2]*zn;
|
||||||
vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
vlr->n[1]= imat[1][0]*xn+imat[1][1]*yn+imat[1][2]*zn;
|
||||||
vlr->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
vlr->n[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
|
||||||
Normalise(vlr->n);
|
Normalize(vlr->n);
|
||||||
|
|
||||||
vlr->mat= ma;
|
vlr->mat= ma;
|
||||||
vlr->flag= 0;
|
vlr->flag= 0;
|
||||||
@ -2222,7 +2222,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
|
|||||||
lar->vec[0]= -mat[2][0];
|
lar->vec[0]= -mat[2][0];
|
||||||
lar->vec[1]= -mat[2][1];
|
lar->vec[1]= -mat[2][1];
|
||||||
lar->vec[2]= -mat[2][2];
|
lar->vec[2]= -mat[2][2];
|
||||||
Normalise(lar->vec);
|
Normalize(lar->vec);
|
||||||
lar->co[0]= mat[3][0];
|
lar->co[0]= mat[3][0];
|
||||||
lar->co[1]= mat[3][1];
|
lar->co[1]= mat[3][1];
|
||||||
lar->co[2]= mat[3][2];
|
lar->co[2]= mat[3][2];
|
||||||
@ -2304,9 +2304,9 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
|
|||||||
|
|
||||||
if(lar->type==LA_SPOT) {
|
if(lar->type==LA_SPOT) {
|
||||||
|
|
||||||
Normalise(lar->imat[0]);
|
Normalize(lar->imat[0]);
|
||||||
Normalise(lar->imat[1]);
|
Normalize(lar->imat[1]);
|
||||||
Normalise(lar->imat[2]);
|
Normalize(lar->imat[2]);
|
||||||
|
|
||||||
xn= saacos(lar->spotsi);
|
xn= saacos(lar->spotsi);
|
||||||
xn= sin(xn)/cos(xn);
|
xn= sin(xn)/cos(xn);
|
||||||
@ -2556,7 +2556,7 @@ static int dl_surf_to_renderdata(Render *re, Object *ob, DispList *dl, Material
|
|||||||
}
|
}
|
||||||
for(a = startvert; a < re->totvert; a++) {
|
for(a = startvert; a < re->totvert; a++) {
|
||||||
ver= RE_findOrAddVert(re, a);
|
ver= RE_findOrAddVert(re, a);
|
||||||
Normalise(ver->n);
|
Normalize(ver->n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2663,7 +2663,7 @@ static void init_render_curve(Render *re, Object *ob, int only_verts)
|
|||||||
n[0]= ob->imat[0][2];
|
n[0]= ob->imat[0][2];
|
||||||
n[1]= ob->imat[1][2];
|
n[1]= ob->imat[1][2];
|
||||||
n[2]= ob->imat[2][2];
|
n[2]= ob->imat[2][2];
|
||||||
Normalise(n);
|
Normalize(n);
|
||||||
|
|
||||||
for(a=0; a<dl->nr; a++, data+=3) {
|
for(a=0; a<dl->nr; a++, data+=3) {
|
||||||
ver= RE_findOrAddVert(re, re->totvert++);
|
ver= RE_findOrAddVert(re, re->totvert++);
|
||||||
@ -2804,7 +2804,7 @@ static void init_render_curve(Render *re, Object *ob, int only_verts)
|
|||||||
}
|
}
|
||||||
for(a=startvert; a<re->totvert; a++) {
|
for(a=startvert; a<re->totvert; a++) {
|
||||||
ver= RE_findOrAddVert(re, a);
|
ver= RE_findOrAddVert(re, a);
|
||||||
len= Normalise(ver->n);
|
len= Normalize(ver->n);
|
||||||
if(len==0.0) ver->flag= 1; /* flag abuse, its only used in zbuf now */
|
if(len==0.0) ver->flag= 1; /* flag abuse, its only used in zbuf now */
|
||||||
else ver->flag= 0;
|
else ver->flag= 0;
|
||||||
}
|
}
|
||||||
@ -3207,7 +3207,7 @@ void init_render_world(Render *re)
|
|||||||
cp[3]= 1;
|
cp[3]= 1;
|
||||||
|
|
||||||
VECCOPY(re->grvec, re->viewmat[2]);
|
VECCOPY(re->grvec, re->viewmat[2]);
|
||||||
Normalise(re->grvec);
|
Normalize(re->grvec);
|
||||||
Mat3CpyMat4(re->imat, re->viewinv);
|
Mat3CpyMat4(re->imat, re->viewinv);
|
||||||
|
|
||||||
for(a=0; a<MAX_MTEX; a++)
|
for(a=0; a<MAX_MTEX; a++)
|
||||||
|
@ -249,7 +249,7 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
|
|||||||
ver->n[0]= imat[0][0]*xn+imat[1][0]*yn+imat[2][0]*zn;
|
ver->n[0]= imat[0][0]*xn+imat[1][0]*yn+imat[2][0]*zn;
|
||||||
ver->n[1]= imat[0][1]*xn+imat[1][1]*yn+imat[2][1]*zn;
|
ver->n[1]= imat[0][1]*xn+imat[1][1]*yn+imat[2][1]*zn;
|
||||||
ver->n[2]= imat[0][2]*xn+imat[1][2]*yn+imat[2][2]*zn;
|
ver->n[2]= imat[0][2]*xn+imat[1][2]*yn+imat[2][2]*zn;
|
||||||
Normalise(ver->n);
|
Normalize(ver->n);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(a=0; a<re->tothalo; a++) {
|
for(a=0; a<re->tothalo; a++) {
|
||||||
@ -270,7 +270,7 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode)
|
|||||||
vlr->n[0]= imat[0][0]*xn+imat[1][0]*yn+imat[2][0]*zn;
|
vlr->n[0]= imat[0][0]*xn+imat[1][0]*yn+imat[2][0]*zn;
|
||||||
vlr->n[1]= imat[0][1]*xn+imat[1][1]*yn+imat[2][1]*zn;
|
vlr->n[1]= imat[0][1]*xn+imat[1][1]*yn+imat[2][1]*zn;
|
||||||
vlr->n[2]= imat[0][2]*xn+imat[1][2]*yn+imat[2][2]*zn;
|
vlr->n[2]= imat[0][2]*xn+imat[1][2]*yn+imat[2][2]*zn;
|
||||||
Normalise(vlr->n);
|
Normalize(vlr->n);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_normalflags(re);
|
set_normalflags(re);
|
||||||
|
@ -57,9 +57,9 @@ static float gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
|
|||||||
static float gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
static float gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
||||||
static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
|
static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
|
||||||
static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
||||||
static float colour_domain_table[RE_GAMMA_TABLE_SIZE + 1];
|
static float color_domain_table[RE_GAMMA_TABLE_SIZE + 1];
|
||||||
static float colour_step;
|
static float color_step;
|
||||||
static float inv_colour_step;
|
static float inv_color_step;
|
||||||
static float valid_gamma;
|
static float valid_gamma;
|
||||||
static float valid_inv_gamma;
|
static float valid_inv_gamma;
|
||||||
|
|
||||||
@ -70,15 +70,15 @@ float gammaCorrect(float c)
|
|||||||
int i;
|
int i;
|
||||||
float res = 0.0;
|
float res = 0.0;
|
||||||
|
|
||||||
i = floor(c * inv_colour_step);
|
i = floor(c * inv_color_step);
|
||||||
/* Clip to range [0,1]: outside, just do the complete calculation. */
|
/* Clip to range [0,1]: outside, just do the complete calculation. */
|
||||||
/* We may have some performance problems here. Stretching up the LUT */
|
/* We may have some performance problems here. Stretching up the LUT */
|
||||||
/* may help solve that, by exchanging LUT size for the interpolation. */
|
/* may help solve that, by exchanging LUT size for the interpolation. */
|
||||||
/* Negative colours are explicitly handled. */
|
/* Negative colors are explicitly handled. */
|
||||||
if (i < 0) res = -pow(abs(c), valid_gamma);
|
if (i < 0) res = -pow(abs(c), valid_gamma);
|
||||||
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
|
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
|
||||||
else res = gamma_range_table[i] +
|
else res = gamma_range_table[i] +
|
||||||
( (c - colour_domain_table[i]) * gamfactor_table[i]);
|
( (c - color_domain_table[i]) * gamfactor_table[i]);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
} /* end of float gammaCorrect(float col) */
|
} /* end of float gammaCorrect(float col) */
|
||||||
@ -90,12 +90,12 @@ float invGammaCorrect(float col)
|
|||||||
int i;
|
int i;
|
||||||
float res = 0.0;
|
float res = 0.0;
|
||||||
|
|
||||||
i = floor(col*inv_colour_step);
|
i = floor(col*inv_color_step);
|
||||||
/* Negative colours are explicitly handled. */
|
/* Negative colors are explicitly handled. */
|
||||||
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
|
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
|
||||||
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
|
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
|
||||||
else res = inv_gamma_range_table[i] +
|
else res = inv_gamma_range_table[i] +
|
||||||
( (col - colour_domain_table[i]) * inv_gamfactor_table[i]);
|
( (col - color_domain_table[i]) * inv_gamfactor_table[i]);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
} /* end of float invGammaCorrect(float col) */
|
} /* end of float invGammaCorrect(float col) */
|
||||||
@ -110,15 +110,15 @@ void makeGammaTables(float gamma)
|
|||||||
|
|
||||||
valid_gamma = gamma;
|
valid_gamma = gamma;
|
||||||
valid_inv_gamma = 1.0 / gamma;
|
valid_inv_gamma = 1.0 / gamma;
|
||||||
colour_step = 1.0 / RE_GAMMA_TABLE_SIZE;
|
color_step = 1.0 / RE_GAMMA_TABLE_SIZE;
|
||||||
inv_colour_step = (float) RE_GAMMA_TABLE_SIZE;
|
inv_color_step = (float) RE_GAMMA_TABLE_SIZE;
|
||||||
|
|
||||||
/* We could squeeze out the two range tables to gain some memory. */
|
/* We could squeeze out the two range tables to gain some memory. */
|
||||||
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) {
|
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) {
|
||||||
colour_domain_table[i] = i * colour_step;
|
color_domain_table[i] = i * color_step;
|
||||||
gamma_range_table[i] = pow(colour_domain_table[i],
|
gamma_range_table[i] = pow(color_domain_table[i],
|
||||||
valid_gamma);
|
valid_gamma);
|
||||||
inv_gamma_range_table[i] = pow(colour_domain_table[i],
|
inv_gamma_range_table[i] = pow(color_domain_table[i],
|
||||||
valid_inv_gamma);
|
valid_inv_gamma);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,16 +126,16 @@ void makeGammaTables(float gamma)
|
|||||||
/* rounding errors, we just set this explicitly. The last segment may */
|
/* rounding errors, we just set this explicitly. The last segment may */
|
||||||
/* have a different lenght than the other segments, but our */
|
/* have a different lenght than the other segments, but our */
|
||||||
/* interpolation is insensitive to that. */
|
/* interpolation is insensitive to that. */
|
||||||
colour_domain_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
color_domain_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
||||||
gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
||||||
inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
||||||
|
|
||||||
/* To speed up calculations, we make these calc factor tables. They are */
|
/* To speed up calculations, we make these calc factor tables. They are */
|
||||||
/* multiplication factors used in scaling the interpolation. */
|
/* multiplication factors used in scaling the interpolation. */
|
||||||
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) {
|
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) {
|
||||||
gamfactor_table[i] = inv_colour_step
|
gamfactor_table[i] = inv_color_step
|
||||||
* (gamma_range_table[i + 1] - gamma_range_table[i]) ;
|
* (gamma_range_table[i + 1] - gamma_range_table[i]) ;
|
||||||
inv_gamfactor_table[i] = inv_colour_step
|
inv_gamfactor_table[i] = inv_color_step
|
||||||
* (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ;
|
* (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ extern struct Render R;
|
|||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
/* Debug/behaviour defines */
|
/* Debug/behaviour defines */
|
||||||
/* if defined: alpha blending with floats clips colour, as with shorts */
|
/* if defined: alpha blending with floats clips color, as with shorts */
|
||||||
/* #define RE_FLOAT_COLOUR_CLIPPING */
|
/* #define RE_FLOAT_COLOR_CLIPPING */
|
||||||
/* if defined: alpha values are clipped */
|
/* if defined: alpha values are clipped */
|
||||||
/* For now, we just keep alpha clipping. We run into thresholding and */
|
/* For now, we just keep alpha clipping. We run into thresholding and */
|
||||||
/* blending difficulties otherwise. Be careful here. */
|
/* blending difficulties otherwise. Be careful here. */
|
||||||
@ -62,11 +62,11 @@ extern struct Render R;
|
|||||||
|
|
||||||
/* Threshold for a 'full' pixel: pixels with alpha above this level are */
|
/* Threshold for a 'full' pixel: pixels with alpha above this level are */
|
||||||
/* considered opaque This is the decimal value for 0xFFF0 / 0xFFFF */
|
/* considered opaque This is the decimal value for 0xFFF0 / 0xFFFF */
|
||||||
#define RE_FULL_COLOUR_FLOAT 0.9998
|
#define RE_FULL_COLOR_FLOAT 0.9998
|
||||||
/* Threshold for an 'empty' pixel: pixels with alpha above this level are */
|
/* Threshold for an 'empty' pixel: pixels with alpha above this level are */
|
||||||
/* considered completely transparent. This is the decimal value */
|
/* considered completely transparent. This is the decimal value */
|
||||||
/* for 0x000F / 0xFFFF */
|
/* for 0x000F / 0xFFFF */
|
||||||
#define RE_EMPTY_COLOUR_FLOAT 0.0002
|
#define RE_EMPTY_COLOR_FLOAT 0.0002
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
@ -92,8 +92,8 @@ void addAlphaUnderFloat(float *dest, float *source)
|
|||||||
{
|
{
|
||||||
float mul;
|
float mul;
|
||||||
|
|
||||||
if( (-RE_EMPTY_COLOUR_FLOAT < dest[3])
|
if( (-RE_EMPTY_COLOR_FLOAT < dest[3])
|
||||||
&& (dest[3] < RE_EMPTY_COLOUR_FLOAT) ) {
|
&& (dest[3] < RE_EMPTY_COLOR_FLOAT) ) {
|
||||||
dest[0] = source[0];
|
dest[0] = source[0];
|
||||||
dest[1] = source[1];
|
dest[1] = source[1];
|
||||||
dest[2] = source[2];
|
dest[2] = source[2];
|
||||||
@ -114,37 +114,37 @@ void addAlphaUnderFloat(float *dest, float *source)
|
|||||||
void addalphaAddfacFloat(float *dest, float *source, char addfac)
|
void addalphaAddfacFloat(float *dest, float *source, char addfac)
|
||||||
{
|
{
|
||||||
float m; /* weiging factor of destination */
|
float m; /* weiging factor of destination */
|
||||||
float c; /* intermediate colour */
|
float c; /* intermediate color */
|
||||||
|
|
||||||
/* Addfac is a number between 0 and 1: rescale */
|
/* Addfac is a number between 0 and 1: rescale */
|
||||||
/* final target is to diminish the influence of dest when addfac rises */
|
/* final target is to diminish the influence of dest when addfac rises */
|
||||||
m = 1.0 - ( source[3] * ((255.0 - addfac) / 255.0));
|
m = 1.0 - ( source[3] * ((255.0 - addfac) / 255.0));
|
||||||
|
|
||||||
/* blend colours*/
|
/* blend colors*/
|
||||||
c= (m * dest[0]) + source[0];
|
c= (m * dest[0]) + source[0];
|
||||||
#ifdef RE_FLOAT_COLOUR_CLIPPING
|
#ifdef RE_FLOAT_COLOR_CLIPPING
|
||||||
if(c >= RE_FULL_COLOUR_FLOAT) dest[0] = RE_FULL_COLOUR_FLOAT;
|
if(c >= RE_FULL_COLOR_FLOAT) dest[0] = RE_FULL_COLOR_FLOAT;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
dest[0]= c;
|
dest[0]= c;
|
||||||
|
|
||||||
c= (m * dest[1]) + source[1];
|
c= (m * dest[1]) + source[1];
|
||||||
#ifdef RE_FLOAT_COLOUR_CLIPPING
|
#ifdef RE_FLOAT_COLOR_CLIPPING
|
||||||
if(c >= RE_FULL_COLOUR_FLOAT) dest[1] = RE_FULL_COLOUR_FLOAT;
|
if(c >= RE_FULL_COLOR_FLOAT) dest[1] = RE_FULL_COLOR_FLOAT;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
dest[1]= c;
|
dest[1]= c;
|
||||||
|
|
||||||
c= (m * dest[2]) + source[2];
|
c= (m * dest[2]) + source[2];
|
||||||
#ifdef RE_FLOAT_COLOUR_CLIPPING
|
#ifdef RE_FLOAT_COLOR_CLIPPING
|
||||||
if(c >= RE_FULL_COLOUR_FLOAT) dest[2] = RE_FULL_COLOUR_FLOAT;
|
if(c >= RE_FULL_COLOR_FLOAT) dest[2] = RE_FULL_COLOR_FLOAT;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
dest[2]= c;
|
dest[2]= c;
|
||||||
|
|
||||||
c= (m * dest[3]) + source[3];
|
c= (m * dest[3]) + source[3];
|
||||||
#ifdef RE_ALPHA_CLIPPING
|
#ifdef RE_ALPHA_CLIPPING
|
||||||
if(c >= RE_FULL_COLOUR_FLOAT) dest[3] = RE_FULL_COLOUR_FLOAT;
|
if(c >= RE_FULL_COLOR_FLOAT) dest[3] = RE_FULL_COLOR_FLOAT;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
dest[3]= c;
|
dest[3]= c;
|
||||||
@ -263,7 +263,7 @@ void addalphaAddFloat(float *dest, float *source)
|
|||||||
{
|
{
|
||||||
|
|
||||||
/* Makes me wonder whether this is required... */
|
/* Makes me wonder whether this is required... */
|
||||||
if( dest[3] < RE_EMPTY_COLOUR_FLOAT) {
|
if( dest[3] < RE_EMPTY_COLOR_FLOAT) {
|
||||||
dest[0] = source[0];
|
dest[0] = source[0];
|
||||||
dest[1] = source[1];
|
dest[1] = source[1];
|
||||||
dest[2] = source[2];
|
dest[2] = source[2];
|
||||||
|
@ -379,7 +379,7 @@ void shadeHaloFloat(HaloRen *har, float *col, int zz,
|
|||||||
ringf*= dist;
|
ringf*= dist;
|
||||||
linef*= alpha;
|
linef*= alpha;
|
||||||
|
|
||||||
/* The colour is either the rgb spec-ed by the user, or extracted from */
|
/* The color is either the rgb spec-ed by the user, or extracted from */
|
||||||
/* the texture */
|
/* the texture */
|
||||||
if(har->tex) {
|
if(har->tex) {
|
||||||
col[0]= har->r;
|
col[0]= har->r;
|
||||||
@ -483,7 +483,7 @@ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview)
|
|||||||
zen[0]= R.wrld.zenr; zen[1]= R.wrld.zeng; zen[2]= R.wrld.zenb;
|
zen[0]= R.wrld.zenr; zen[1]= R.wrld.zeng; zen[2]= R.wrld.zenb;
|
||||||
|
|
||||||
/* Careful: SKYTEX and SKYBLEND are NOT mutually exclusive! If */
|
/* Careful: SKYTEX and SKYBLEND are NOT mutually exclusive! If */
|
||||||
/* SKYBLEND is active, the texture and colour blend are added. */
|
/* SKYBLEND is active, the texture and color blend are added. */
|
||||||
if(R.wrld.skytype & WO_SKYTEX) {
|
if(R.wrld.skytype & WO_SKYTEX) {
|
||||||
VECCOPY(lo, view);
|
VECCOPY(lo, view);
|
||||||
if(R.wrld.skytype & WO_SKYREAL) {
|
if(R.wrld.skytype & WO_SKYREAL) {
|
||||||
@ -513,7 +513,7 @@ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Stuff the sky colour into the collector.
|
Stuff the sky color into the collector.
|
||||||
*/
|
*/
|
||||||
void shadeSkyPixel(float *collector, float fx, float fy)
|
void shadeSkyPixel(float *collector, float fx, float fy)
|
||||||
{
|
{
|
||||||
@ -522,7 +522,7 @@ void shadeSkyPixel(float *collector, float fx, float fy)
|
|||||||
/*
|
/*
|
||||||
The rules for sky:
|
The rules for sky:
|
||||||
1. Draw an image, if a background image was provided. Stop
|
1. Draw an image, if a background image was provided. Stop
|
||||||
2. get texture and colour blend, and combine these.
|
2. get texture and color blend, and combine these.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
float fac;
|
float fac;
|
||||||
@ -553,7 +553,7 @@ void shadeSkyPixel(float *collector, float fx, float fy)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
calc_view_vector(view, fx, fy);
|
calc_view_vector(view, fx, fy);
|
||||||
fac= Normalise(view);
|
fac= Normalize(view);
|
||||||
|
|
||||||
if(R.wrld.skytype & WO_SKYTEX) {
|
if(R.wrld.skytype & WO_SKYTEX) {
|
||||||
dxyview[0]= -R.viewdx/fac;
|
dxyview[0]= -R.viewdx/fac;
|
||||||
@ -561,7 +561,7 @@ void shadeSkyPixel(float *collector, float fx, float fy)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get sky colour in the collector */
|
/* get sky color in the collector */
|
||||||
shadeSkyView(collector, NULL, view, dxyview);
|
shadeSkyView(collector, NULL, view, dxyview);
|
||||||
collector[3] = 0.0f;
|
collector[3] = 0.0f;
|
||||||
}
|
}
|
||||||
|
@ -1414,7 +1414,7 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
|
|||||||
shi->co[1]= is->start[1]+is->labda*(shi->view[1]);
|
shi->co[1]= is->start[1]+is->labda*(shi->view[1]);
|
||||||
shi->co[2]= is->start[2]+is->labda*(shi->view[2]);
|
shi->co[2]= is->start[2]+is->labda*(shi->view[2]);
|
||||||
|
|
||||||
Normalise(shi->view);
|
Normalize(shi->view);
|
||||||
|
|
||||||
shi->vlr= vlr;
|
shi->vlr= vlr;
|
||||||
shi->mat= vlr->mat;
|
shi->mat= vlr->mat;
|
||||||
@ -1714,7 +1714,7 @@ static void traceray(ShadeInput *origshi, short depth, float *start, float *vec,
|
|||||||
}
|
}
|
||||||
else { /* sky */
|
else { /* sky */
|
||||||
VECCOPY(shi.view, vec);
|
VECCOPY(shi.view, vec);
|
||||||
Normalise(shi.view);
|
Normalize(shi.view);
|
||||||
|
|
||||||
shadeSkyView(col, isec.start, shi.view, NULL);
|
shadeSkyView(col, isec.start, shi.view, NULL);
|
||||||
}
|
}
|
||||||
@ -2078,7 +2078,7 @@ static void DS_energy(float *sphere, int tot, float *vec)
|
|||||||
|
|
||||||
VecMulf(res, 0.5);
|
VecMulf(res, 0.5);
|
||||||
VecAddf(vec, vec, res);
|
VecAddf(vec, vec, res);
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2257,7 +2257,7 @@ void ray_ao(ShadeInput *shi, float *shadfac)
|
|||||||
view[0]= -vec[0];
|
view[0]= -vec[0];
|
||||||
view[1]= -vec[1];
|
view[1]= -vec[1];
|
||||||
view[2]= -vec[2];
|
view[2]= -vec[2];
|
||||||
Normalise(view);
|
Normalize(view);
|
||||||
|
|
||||||
if(aocolor==WO_AOSKYCOL) {
|
if(aocolor==WO_AOSKYCOL) {
|
||||||
fac= 0.5*(1.0f+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]);
|
fac= 0.5*(1.0f+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]);
|
||||||
|
@ -1373,7 +1373,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
|
|||||||
|
|
||||||
/* set up view vector */
|
/* set up view vector */
|
||||||
VECCOPY(shi->view, shi->co);
|
VECCOPY(shi->view, shi->co);
|
||||||
Normalise(shi->view);
|
Normalize(shi->view);
|
||||||
|
|
||||||
/* no face normal flip */
|
/* no face normal flip */
|
||||||
shi->puno= 0;
|
shi->puno= 0;
|
||||||
|
@ -660,7 +660,7 @@ HaloRen *RE_inithalo(Render *re, Material *ma, float *vec, float *vec1,
|
|||||||
har->hasize= vectsize*zn + (1.0-vectsize)*hasize;
|
har->hasize= vectsize*zn + (1.0-vectsize)*hasize;
|
||||||
|
|
||||||
VecSubf(har->no, vec, vec1);
|
VecSubf(har->no, vec, vec1);
|
||||||
Normalise(har->no);
|
Normalize(har->no);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ma->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA;
|
if(ma->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA;
|
||||||
|
@ -335,7 +335,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
|
|||||||
/* since vec is rotated in lampspace, this is how to get the cosine of angle */
|
/* since vec is rotated in lampspace, this is how to get the cosine of angle */
|
||||||
/* precision is set 20% larger */
|
/* precision is set 20% larger */
|
||||||
vec[2]*= 1.2f;
|
vec[2]*= 1.2f;
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
inpr= - vec[2];
|
inpr= - vec[2];
|
||||||
|
|
||||||
if(inpr>=lar->spotsi) {
|
if(inpr>=lar->spotsi) {
|
||||||
|
@ -391,8 +391,8 @@ void shade_input_set_viewco(ShadeInput *shi, float x, float y, float z)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cannot normalise earlier, code above needs it at viewplane level */
|
/* cannot normalize earlier, code above needs it at viewplane level */
|
||||||
Normalise(shi->view);
|
Normalize(shi->view);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calculate U and V, for scanline (silly render face u and v are in range -1 to 0) */
|
/* calculate U and V, for scanline (silly render face u and v are in range -1 to 0) */
|
||||||
@ -496,7 +496,7 @@ void shade_input_set_normals(ShadeInput *shi)
|
|||||||
shi->vn[1]= l*n3[1]-u*n1[1]-v*n2[1];
|
shi->vn[1]= l*n3[1]-u*n1[1]-v*n2[1];
|
||||||
shi->vn[2]= l*n3[2]-u*n1[2]-v*n2[2];
|
shi->vn[2]= l*n3[2]-u*n1[2]-v*n2[2];
|
||||||
|
|
||||||
Normalise(shi->vn);
|
Normalize(shi->vn);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VECCOPY(shi->vn, shi->facenor);
|
VECCOPY(shi->vn, shi->facenor);
|
||||||
@ -544,7 +544,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
|||||||
shi->tang[1]= (l*s3[1] - u*s1[1] - v*s2[1]);
|
shi->tang[1]= (l*s3[1] - u*s1[1] - v*s2[1]);
|
||||||
shi->tang[2]= (l*s3[2] - u*s1[2] - v*s2[2]);
|
shi->tang[2]= (l*s3[2] - u*s1[2] - v*s2[2]);
|
||||||
/* qdn: normalize just in case */
|
/* qdn: normalize just in case */
|
||||||
Normalise(shi->tang);
|
Normalize(shi->tang);
|
||||||
}
|
}
|
||||||
else shi->tang[0]= shi->tang[1]= shi->tang[2]= 0.0f;
|
else shi->tang[0]= shi->tang[1]= shi->tang[2]= 0.0f;
|
||||||
}
|
}
|
||||||
@ -561,7 +561,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
|||||||
shi->tang[0] = (s1[0] + s2[0] + s3[0]);
|
shi->tang[0] = (s1[0] + s2[0] + s3[0]);
|
||||||
shi->tang[1] = (s1[1] + s2[1] + s3[1]);
|
shi->tang[1] = (s1[1] + s2[1] + s3[1]);
|
||||||
shi->tang[2] = (s1[2] + s2[2] + s3[2]);
|
shi->tang[2] = (s1[2] + s2[2] + s3[2]);
|
||||||
Normalise(shi->tang);
|
Normalize(shi->tang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -765,7 +765,7 @@ void shade_input_set_shade_texco(ShadeInput *shi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(texco & TEXCO_REFL) {
|
if(texco & TEXCO_REFL) {
|
||||||
/* mirror reflection colour textures (and envmap) */
|
/* mirror reflection color textures (and envmap) */
|
||||||
calc_R_ref(shi); /* wrong location for normal maps! XXXXXXXXXXXXXX */
|
calc_R_ref(shi); /* wrong location for normal maps! XXXXXXXXXXXXXX */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ void renderspothalo(ShadeInput *shi, float *col, float alpha)
|
|||||||
|
|
||||||
/* ---------------- shaders ----------------------- */
|
/* ---------------- shaders ----------------------- */
|
||||||
|
|
||||||
static double Normalise_d(double *n)
|
static double Normalize_d(double *n)
|
||||||
{
|
{
|
||||||
double d;
|
double d;
|
||||||
|
|
||||||
@ -427,10 +427,10 @@ static float area_lamp_energy(float *co, float *vn, LampRen *lar)
|
|||||||
VECSUB(vec[2], co, lar->area[2]);
|
VECSUB(vec[2], co, lar->area[2]);
|
||||||
VECSUB(vec[3], co, lar->area[3]);
|
VECSUB(vec[3], co, lar->area[3]);
|
||||||
|
|
||||||
Normalise_d(vec[0]);
|
Normalize_d(vec[0]);
|
||||||
Normalise_d(vec[1]);
|
Normalize_d(vec[1]);
|
||||||
Normalise_d(vec[2]);
|
Normalize_d(vec[2]);
|
||||||
Normalise_d(vec[3]);
|
Normalize_d(vec[3]);
|
||||||
|
|
||||||
/* cross product */
|
/* cross product */
|
||||||
CROSS(cross[0], vec[0], vec[1]);
|
CROSS(cross[0], vec[0], vec[1]);
|
||||||
@ -438,10 +438,10 @@ static float area_lamp_energy(float *co, float *vn, LampRen *lar)
|
|||||||
CROSS(cross[2], vec[2], vec[3]);
|
CROSS(cross[2], vec[2], vec[3]);
|
||||||
CROSS(cross[3], vec[3], vec[0]);
|
CROSS(cross[3], vec[3], vec[0]);
|
||||||
|
|
||||||
Normalise_d(cross[0]);
|
Normalize_d(cross[0]);
|
||||||
Normalise_d(cross[1]);
|
Normalize_d(cross[1]);
|
||||||
Normalise_d(cross[2]);
|
Normalize_d(cross[2]);
|
||||||
Normalise_d(cross[3]);
|
Normalize_d(cross[3]);
|
||||||
|
|
||||||
/* angles */
|
/* angles */
|
||||||
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
|
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
|
||||||
@ -512,7 +512,7 @@ static float Phong_Spec( float *n, float *l, float *v, int hard, int tangent )
|
|||||||
h[0] = l[0] + v[0];
|
h[0] = l[0] + v[0];
|
||||||
h[1] = l[1] + v[1];
|
h[1] = l[1] + v[1];
|
||||||
h[2] = l[2] + v[2];
|
h[2] = l[2] + v[2];
|
||||||
Normalise(h);
|
Normalize(h);
|
||||||
|
|
||||||
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
|
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
|
||||||
if(tangent) rslt= sasqrt(1.0f - rslt*rslt);
|
if(tangent) rslt= sasqrt(1.0f - rslt*rslt);
|
||||||
@ -532,7 +532,7 @@ static float CookTorr_Spec(float *n, float *l, float *v, int hard, int tangent)
|
|||||||
h[0]= v[0]+l[0];
|
h[0]= v[0]+l[0];
|
||||||
h[1]= v[1]+l[1];
|
h[1]= v[1]+l[1];
|
||||||
h[2]= v[2]+l[2];
|
h[2]= v[2]+l[2];
|
||||||
Normalise(h);
|
Normalize(h);
|
||||||
|
|
||||||
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2];
|
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2];
|
||||||
if(tangent) nh= sasqrt(1.0f - nh*nh);
|
if(tangent) nh= sasqrt(1.0f - nh*nh);
|
||||||
@ -565,7 +565,7 @@ static float Blinn_Spec(float *n, float *l, float *v, float refrac, float spec_p
|
|||||||
h[0]= v[0]+l[0];
|
h[0]= v[0]+l[0];
|
||||||
h[1]= v[1]+l[1];
|
h[1]= v[1]+l[1];
|
||||||
h[2]= v[2]+l[2];
|
h[2]= v[2]+l[2];
|
||||||
Normalise(h);
|
Normalize(h);
|
||||||
|
|
||||||
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
|
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
|
||||||
if(tangent) nh= sasqrt(1.0f - nh*nh);
|
if(tangent) nh= sasqrt(1.0f - nh*nh);
|
||||||
@ -612,7 +612,7 @@ static float Toon_Spec( float *n, float *l, float *v, float size, float smooth,
|
|||||||
h[0] = l[0] + v[0];
|
h[0] = l[0] + v[0];
|
||||||
h[1] = l[1] + v[1];
|
h[1] = l[1] + v[1];
|
||||||
h[2] = l[2] + v[2];
|
h[2] = l[2] + v[2];
|
||||||
Normalise(h);
|
Normalize(h);
|
||||||
|
|
||||||
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
|
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
|
||||||
if(tangent) rslt = sasqrt(1.0f - rslt*rslt);
|
if(tangent) rslt = sasqrt(1.0f - rslt*rslt);
|
||||||
@ -636,7 +636,7 @@ static float WardIso_Spec( float *n, float *l, float *v, float rms, int tangent)
|
|||||||
h[0] = l[0] + v[0];
|
h[0] = l[0] + v[0];
|
||||||
h[1] = l[1] + v[1];
|
h[1] = l[1] + v[1];
|
||||||
h[2] = l[2] + v[2];
|
h[2] = l[2] + v[2];
|
||||||
Normalise(h);
|
Normalize(h);
|
||||||
|
|
||||||
nh = n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
|
nh = n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
|
||||||
if(tangent) nh = sasqrt(1.0f - nh*nh);
|
if(tangent) nh = sasqrt(1.0f - nh*nh);
|
||||||
@ -687,7 +687,7 @@ static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough
|
|||||||
h[0]= v[0]+l[0];
|
h[0]= v[0]+l[0];
|
||||||
h[1]= v[1]+l[1];
|
h[1]= v[1]+l[1];
|
||||||
h[2]= v[2]+l[2];
|
h[2]= v[2]+l[2];
|
||||||
Normalise(h);
|
Normalize(h);
|
||||||
|
|
||||||
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
|
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2]; /* Dot product between surface normal and half-way vector */
|
||||||
if(nh<0.0f) nh = 0.0f;
|
if(nh<0.0f) nh = 0.0f;
|
||||||
@ -708,12 +708,12 @@ static float OrenNayar_Diff(float nl, float *n, float *l, float *v, float rough
|
|||||||
Lit_B[0] = l[0] - (realnl * n[0]);
|
Lit_B[0] = l[0] - (realnl * n[0]);
|
||||||
Lit_B[1] = l[1] - (realnl * n[1]);
|
Lit_B[1] = l[1] - (realnl * n[1]);
|
||||||
Lit_B[2] = l[2] - (realnl * n[2]);
|
Lit_B[2] = l[2] - (realnl * n[2]);
|
||||||
Normalise( Lit_B );
|
Normalize( Lit_B );
|
||||||
|
|
||||||
View_B[0] = v[0] - (nv * n[0]);
|
View_B[0] = v[0] - (nv * n[0]);
|
||||||
View_B[1] = v[1] - (nv * n[1]);
|
View_B[1] = v[1] - (nv * n[1]);
|
||||||
View_B[2] = v[2] - (nv * n[2]);
|
View_B[2] = v[2] - (nv * n[2]);
|
||||||
Normalise( View_B );
|
Normalize( View_B );
|
||||||
|
|
||||||
t = Lit_B[0]*View_B[0] + Lit_B[1]*View_B[1] + Lit_B[2]*View_B[2];
|
t = Lit_B[0]*View_B[0] + Lit_B[1]*View_B[1] + Lit_B[2]*View_B[2];
|
||||||
if( t < 0 ) t = 0;
|
if( t < 0 ) t = 0;
|
||||||
@ -1290,7 +1290,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
|
|||||||
lv[1]+= view[1];
|
lv[1]+= view[1];
|
||||||
lv[2]+= view[2];
|
lv[2]+= view[2];
|
||||||
|
|
||||||
Normalise(lv);
|
Normalize(lv);
|
||||||
|
|
||||||
t= vn[0]*lv[0]+vn[1]*lv[1]+vn[2]*lv[2];
|
t= vn[0]*lv[0]+vn[1]*lv[1]+vn[2]*lv[2];
|
||||||
|
|
||||||
|
@ -1652,11 +1652,11 @@ void do_material_tex(ShadeInput *shi)
|
|||||||
// rotate to global coords
|
// rotate to global coords
|
||||||
if(mtex->texco==TEXCO_ORCO || mtex->texco==TEXCO_UV) {
|
if(mtex->texco==TEXCO_ORCO || mtex->texco==TEXCO_UV) {
|
||||||
if(shi->vlr && shi->vlr->ob) {
|
if(shi->vlr && shi->vlr->ob) {
|
||||||
float len= Normalise(texres.nor);
|
float len= Normalize(texres.nor);
|
||||||
// can be optimized... (ton)
|
// can be optimized... (ton)
|
||||||
Mat4Mul3Vecfl(shi->vlr->ob->obmat, texres.nor);
|
Mat4Mul3Vecfl(shi->vlr->ob->obmat, texres.nor);
|
||||||
Mat4Mul3Vecfl(R.viewmat, texres.nor);
|
Mat4Mul3Vecfl(R.viewmat, texres.nor);
|
||||||
Normalise(texres.nor);
|
Normalize(texres.nor);
|
||||||
VecMulf(texres.nor, len);
|
VecMulf(texres.nor, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1762,7 +1762,7 @@ void do_material_tex(ShadeInput *shi)
|
|||||||
shi->vn[2]+= dot*nor[2];
|
shi->vn[2]+= dot*nor[2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Normalise(shi->vn);
|
Normalize(shi->vn);
|
||||||
|
|
||||||
/* this makes sure the bump is passed on to the next texture */
|
/* this makes sure the bump is passed on to the next texture */
|
||||||
shi->orn[0]= -shi->vn[0];
|
shi->orn[0]= -shi->vn[0];
|
||||||
@ -2157,7 +2157,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
|
|||||||
else texres.tin*= stencilTin;
|
else texres.tin*= stencilTin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* colour mapping */
|
/* color mapping */
|
||||||
if(mtex->mapto & (WOMAP_HORIZ+WOMAP_ZENUP+WOMAP_ZENDOWN)) {
|
if(mtex->mapto & (WOMAP_HORIZ+WOMAP_ZENUP+WOMAP_ZENDOWN)) {
|
||||||
float tcol[3];
|
float tcol[3];
|
||||||
|
|
||||||
|
@ -1740,7 +1740,7 @@ void zbuffer_solid(RenderPart *pa, unsigned int lay, short layflag)
|
|||||||
zspan.zofsx= -pa->disprect.xmin;
|
zspan.zofsx= -pa->disprect.xmin;
|
||||||
zspan.zofsy= -pa->disprect.ymin;
|
zspan.zofsy= -pa->disprect.ymin;
|
||||||
}
|
}
|
||||||
/* to centre the sample position */
|
/* to center the sample position */
|
||||||
zspan.zofsx -= 0.5f;
|
zspan.zofsx -= 0.5f;
|
||||||
zspan.zofsy -= 0.5f;
|
zspan.zofsy -= 0.5f;
|
||||||
|
|
||||||
@ -2579,7 +2579,7 @@ static int zbuffer_abuf(RenderPart *pa, APixstr *APixbuf, ListBase *apsmbase, un
|
|||||||
zspan.zofsx= -pa->disprect.xmin;
|
zspan.zofsx= -pa->disprect.xmin;
|
||||||
zspan.zofsy= -pa->disprect.ymin;
|
zspan.zofsy= -pa->disprect.ymin;
|
||||||
}
|
}
|
||||||
/* to centre the sample position */
|
/* to center the sample position */
|
||||||
zspan.zofsx -= 0.5f;
|
zspan.zofsx -= 0.5f;
|
||||||
zspan.zofsy -= 0.5f;
|
zspan.zofsy -= 0.5f;
|
||||||
|
|
||||||
|
@ -549,14 +549,14 @@ void do_common_editbuts(unsigned short event) // old name, is a mix of object an
|
|||||||
if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) tex_space_curve(ob->data);
|
if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) tex_space_curve(ob->data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case B_DOCENTRE:
|
case B_DOCENTER:
|
||||||
docentre(0);
|
docenter(0);
|
||||||
break;
|
break;
|
||||||
case B_DOCENTRENEW:
|
case B_DOCENTERNEW:
|
||||||
docentre_new();
|
docenter_new();
|
||||||
break;
|
break;
|
||||||
case B_DOCENTRECURSOR:
|
case B_DOCENTERCURSOR:
|
||||||
docentre_cursor();
|
docenter_cursor();
|
||||||
break;
|
break;
|
||||||
case B_SETSMOOTH:
|
case B_SETSMOOTH:
|
||||||
case B_SETSOLID:
|
case B_SETSOLID:
|
||||||
@ -824,9 +824,9 @@ static void editing_panel_mesh_type(Object *ob, Mesh *me)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, BUT,B_DOCENTRE, "Center", 10, 80, 65, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
|
uiDefBut(block, BUT,B_DOCENTER, "Center", 10, 80, 65, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
|
||||||
uiDefBut(block, BUT,B_DOCENTRENEW, "Center New", 75, 80, 105, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
|
uiDefBut(block, BUT,B_DOCENTERNEW, "Center New", 75, 80, 105, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
|
||||||
uiDefBut(block, BUT,B_DOCENTRECURSOR, "Center Cursor", 10, 60, 170, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
|
uiDefBut(block, BUT,B_DOCENTERCURSOR, "Center Cursor", 10, 60, 170, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
@ -2918,9 +2918,9 @@ static void editing_panel_curve_type(Object *ob, Curve *cu)
|
|||||||
uiDefButBitS(block, TOG, CU_NOPUNOFLIP, REDRAWVIEW3D, "No Puno Flip", 600,140,150,19, &cu->flag, 0, 0, 0, 0, "Don't flip vertex normals while render");
|
uiDefButBitS(block, TOG, CU_NOPUNOFLIP, REDRAWVIEW3D, "No Puno Flip", 600,140,150,19, &cu->flag, 0, 0, 0, 0, "Don't flip vertex normals while render");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefBut(block, BUT,B_DOCENTRE, "Center", 600, 115, 55, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
|
uiDefBut(block, BUT,B_DOCENTER, "Center", 600, 115, 55, 19, 0, 0, 0, 0, 0, "Shifts object data to be centered about object's origin");
|
||||||
uiDefBut(block, BUT,B_DOCENTRENEW, "Center New", 655, 115, 95, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
|
uiDefBut(block, BUT,B_DOCENTERNEW, "Center New", 655, 115, 95, 19, 0, 0, 0, 0, 0, "Shifts object's origin to center of object data");
|
||||||
uiDefBut(block, BUT,B_DOCENTRECURSOR, "Center Cursor", 600, 95, 150, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
|
uiDefBut(block, BUT,B_DOCENTERCURSOR, "Center Cursor", 600, 95, 150, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
if(cu->key) {
|
if(cu->key) {
|
||||||
|
@ -1727,7 +1727,7 @@ void do_object_panels(unsigned short event)
|
|||||||
do_ob_ipo(ob);
|
do_ob_ipo(ob);
|
||||||
where_is_object(ob);
|
where_is_object(ob);
|
||||||
VecSubf(vec, vec, ob->obmat[3]);
|
VecSubf(vec, vec, ob->obmat[3]);
|
||||||
prspeed= Normalise(vec);
|
prspeed= Normalize(vec);
|
||||||
scrarea_queue_winredraw(curarea);
|
scrarea_queue_winredraw(curarea);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -858,16 +858,16 @@ static uiBlock *edge_render_menu(void *arg_unused)
|
|||||||
uiDefButS(block, NUM, 0,"Eint:", 45,75,175,19, &G.scene->r.edgeint, 0.0, 255.0, 0, 0,
|
uiDefButS(block, NUM, 0,"Eint:", 45,75,175,19, &G.scene->r.edgeint, 0.0, 255.0, 0, 0,
|
||||||
"Sets edge intensity for Toon shading");
|
"Sets edge intensity for Toon shading");
|
||||||
|
|
||||||
/* colour settings for the toon shading */
|
/* color settings for the toon shading */
|
||||||
uiDefButF(block, COL, 0, "", 10, 10,30,60, &(G.scene->r.edgeR), 0, 0, 0, B_EDGECOLSLI, "");
|
uiDefButF(block, COL, 0, "", 10, 10,30,60, &(G.scene->r.edgeR), 0, 0, 0, B_EDGECOLSLI, "");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI, 0, "R ", 45, 50, 175,19, &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0,
|
uiDefButF(block, NUMSLI, 0, "R ", 45, 50, 175,19, &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0,
|
||||||
"Colour for edges in toon shading mode.");
|
"Color for edges in toon shading mode.");
|
||||||
uiDefButF(block, NUMSLI, 0, "G ", 45, 30, 175,19, &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0,
|
uiDefButF(block, NUMSLI, 0, "G ", 45, 30, 175,19, &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0,
|
||||||
"Colour for edges in toon shading mode.");
|
"Color for edges in toon shading mode.");
|
||||||
uiDefButF(block, NUMSLI, 0, "B ", 45, 10, 175,19, &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0,
|
uiDefButF(block, NUMSLI, 0, "B ", 45, 10, 175,19, &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0,
|
||||||
"Colour for edges in toon shading mode.");
|
"Color for edges in toon shading mode.");
|
||||||
|
|
||||||
|
|
||||||
uiBlockSetDirection(block, UI_TOP);
|
uiBlockSetDirection(block, UI_TOP);
|
||||||
@ -1289,7 +1289,7 @@ static void render_panel_render(void)
|
|||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButS(block, ROW,800,"Sky", 369,13,35,20,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky");
|
uiDefButS(block, ROW,800,"Sky", 369,13,35,20,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky");
|
||||||
uiDefButS(block, ROW,800,"Premul", 405,13,50,20,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance");
|
uiDefButS(block, ROW,800,"Premul", 405,13,50,20,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance");
|
||||||
uiDefButS(block, ROW,800,"Key", 456,13,35,20,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and colour values remain unchanged");
|
uiDefButS(block, ROW,800,"Key", 456,13,35,20,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and color values remain unchanged");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
if(G.scene->r.mode & R_RAYTRACE)
|
if(G.scene->r.mode & R_RAYTRACE)
|
||||||
|
@ -1238,7 +1238,7 @@ static void texture_panel_image_map(Tex *tex)
|
|||||||
/* crop extend clip */
|
/* crop extend clip */
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButS(block, ROW, B_TEXREDR_PRV, "Extend", 10,90,63,19, &tex->extend, 4.0, 1.0, 0, 0, "Extends the colour of the edge pixels");
|
uiDefButS(block, ROW, B_TEXREDR_PRV, "Extend", 10,90,63,19, &tex->extend, 4.0, 1.0, 0, 0, "Extends the color of the edge pixels");
|
||||||
uiDefButS(block, ROW, B_TEXREDR_PRV, "Clip", 73,90,48,19, &tex->extend, 4.0, 2.0, 0, 0, "Sets alpha 0.0 outside Image edges");
|
uiDefButS(block, ROW, B_TEXREDR_PRV, "Clip", 73,90,48,19, &tex->extend, 4.0, 2.0, 0, 0, "Sets alpha 0.0 outside Image edges");
|
||||||
uiDefButS(block, ROW, B_TEXREDR_PRV, "ClipCube", 121,90,63,19, &tex->extend, 4.0, 4.0, 0, 0, "Sets alpha to 0.0 outside cubeshaped area around Image");
|
uiDefButS(block, ROW, B_TEXREDR_PRV, "ClipCube", 121,90,63,19, &tex->extend, 4.0, 4.0, 0, 0, "Sets alpha to 0.0 outside cubeshaped area around Image");
|
||||||
uiDefButS(block, ROW, B_TEXREDR_PRV, "Repeat", 184,90,63,19, &tex->extend, 4.0, 3.0, 0, 0, "Causes Image to repeat horizontally and vertically");
|
uiDefButS(block, ROW, B_TEXREDR_PRV, "Repeat", 184,90,63,19, &tex->extend, 4.0, 3.0, 0, 0, "Causes Image to repeat horizontally and vertically");
|
||||||
@ -1431,9 +1431,9 @@ static void draw_colorband_buts(uiBlock *block, ColorBand *coba, int xoffs, int
|
|||||||
|
|
||||||
if(coba==NULL) return;
|
if(coba==NULL) return;
|
||||||
|
|
||||||
bt= uiDefBut(block, BUT, redraw, "Add", 80+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Adds a new colour position to the colorband");
|
bt= uiDefBut(block, BUT, redraw, "Add", 80+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Adds a new color position to the colorband");
|
||||||
uiButSetFunc(bt, colorband_add_cb, coba, NULL);
|
uiButSetFunc(bt, colorband_add_cb, coba, NULL);
|
||||||
uiDefButS(block, NUM, redraw, "Cur:", 117+xoffs,95+yoffs,81,20, &coba->cur, 0.0, (float)(coba->tot-1), 0, 0, "Displays the active colour from the colorband");
|
uiDefButS(block, NUM, redraw, "Cur:", 117+xoffs,95+yoffs,81,20, &coba->cur, 0.0, (float)(coba->tot-1), 0, 0, "Displays the active color from the colorband");
|
||||||
bt= uiDefBut(block, BUT, redraw, "Del", 199+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Deletes the active position");
|
bt= uiDefBut(block, BUT, redraw, "Del", 199+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Deletes the active position");
|
||||||
uiButSetFunc(bt, colorband_del_cb, coba, NULL);
|
uiButSetFunc(bt, colorband_del_cb, coba, NULL);
|
||||||
uiDefButS(block, ROW, redraw, "E", 236+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) ");
|
uiDefButS(block, ROW, redraw, "E", 236+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) ");
|
||||||
@ -1446,15 +1446,15 @@ static void draw_colorband_buts(uiBlock *block, ColorBand *coba, int xoffs, int
|
|||||||
cbd= coba->data + coba->cur;
|
cbd= coba->data + coba->cur;
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
bt= uiDefButF(block, NUM, redraw, "Pos", xoffs,40+yoffs,110,20, &cbd->pos, 0.0, 1.0, 10, 0, "Sets the position of the active colour");
|
bt= uiDefButF(block, NUM, redraw, "Pos", xoffs,40+yoffs,110,20, &cbd->pos, 0.0, 1.0, 10, 0, "Sets the position of the active color");
|
||||||
uiButSetFunc(bt, colorband_pos_cb, coba, NULL);
|
uiButSetFunc(bt, colorband_pos_cb, coba, NULL);
|
||||||
uiDefButF(block, COL, redraw, "", xoffs,20+yoffs,110,20, &(cbd->r), 0, 0, 0, B_BANDCOL, "");
|
uiDefButF(block, COL, redraw, "", xoffs,20+yoffs,110,20, &(cbd->r), 0, 0, 0, B_BANDCOL, "");
|
||||||
uiDefButF(block, NUMSLI, redraw, "A ", xoffs,yoffs,110,20, &cbd->a, 0.0, 1.0, 10, 0, "Sets the alpha value for this position");
|
uiDefButF(block, NUMSLI, redraw, "A ", xoffs,yoffs,110,20, &cbd->a, 0.0, 1.0, 10, 0, "Sets the alpha value for this position");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI, redraw, "R ", 115+xoffs,40+yoffs,185,20, &cbd->r, 0.0, 1.0, B_BANDCOL, 0, "Sets the red value for the active colour");
|
uiDefButF(block, NUMSLI, redraw, "R ", 115+xoffs,40+yoffs,185,20, &cbd->r, 0.0, 1.0, B_BANDCOL, 0, "Sets the red value for the active color");
|
||||||
uiDefButF(block, NUMSLI, redraw, "G ", 115+xoffs,20+yoffs,185,20, &cbd->g, 0.0, 1.0, B_BANDCOL, 0, "Sets the green value for the active colour");
|
uiDefButF(block, NUMSLI, redraw, "G ", 115+xoffs,20+yoffs,185,20, &cbd->g, 0.0, 1.0, B_BANDCOL, 0, "Sets the green value for the active color");
|
||||||
uiDefButF(block, NUMSLI, redraw, "B ", 115+xoffs,yoffs,185,20, &cbd->b, 0.0, 1.0, B_BANDCOL, 0, "Sets the blue value for the active colour");
|
uiDefButF(block, NUMSLI, redraw, "B ", 115+xoffs,yoffs,185,20, &cbd->b, 0.0, 1.0, B_BANDCOL, 0, "Sets the blue value for the active color");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1470,7 +1470,7 @@ void draw_colorband_buts_small(uiBlock *block, ColorBand *coba, rctf *butr, int
|
|||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, COL, event, "", xs,butr->ymin+20.0f,2.0f*unit,20, &(cbd->r), 0, 0, 0, B_BANDCOL, "");
|
uiDefButF(block, COL, event, "", xs,butr->ymin+20.0f,2.0f*unit,20, &(cbd->r), 0, 0, 0, B_BANDCOL, "");
|
||||||
uiDefButF(block, NUM, event, "A:", xs+2.0f*unit,butr->ymin+20.0f,4.0f*unit,20, &(cbd->a), 0.0f, 1.0f, 10, 2, "");
|
uiDefButF(block, NUM, event, "A:", xs+2.0f*unit,butr->ymin+20.0f,4.0f*unit,20, &(cbd->a), 0.0f, 1.0f, 10, 2, "");
|
||||||
bt= uiDefBut(block, BUT, event, "Add", xs+6.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Adds a new colour position to the colorband");
|
bt= uiDefBut(block, BUT, event, "Add", xs+6.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Adds a new color position to the colorband");
|
||||||
uiButSetFunc(bt, colorband_add_cb, coba, NULL);
|
uiButSetFunc(bt, colorband_add_cb, coba, NULL);
|
||||||
bt= uiDefBut(block, BUT, event, "Del", xs+8.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Deletes the active position");
|
bt= uiDefBut(block, BUT, event, "Del", xs+8.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Deletes the active position");
|
||||||
uiButSetFunc(bt, colorband_del_cb, coba, NULL);
|
uiButSetFunc(bt, colorband_del_cb, coba, NULL);
|
||||||
@ -1510,8 +1510,8 @@ static void texture_panel_colors(Tex *tex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI, B_TEXPRV, "Bright", 10,10,150,20, &tex->bright, 0.0, 2.0, 0, 0, "Changes the brightness of the colour or intensity of a texture");
|
uiDefButF(block, NUMSLI, B_TEXPRV, "Bright", 10,10,150,20, &tex->bright, 0.0, 2.0, 0, 0, "Changes the brightness of the color or intensity of a texture");
|
||||||
uiDefButF(block, NUMSLI, B_TEXPRV, "Contr", 160,10,150,20, &tex->contrast, 0.01, 5.0, 0, 0, "Changes the contrast of the colour or intensity of a texture");
|
uiDefButF(block, NUMSLI, B_TEXPRV, "Contr", 160,10,150,20, &tex->contrast, 0.01, 5.0, 0, 0, "Changes the contrast of the color or intensity of a texture");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1825,8 +1825,8 @@ static void radio_panel_tool(Radio *rad, int flag)
|
|||||||
|
|
||||||
if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, TH_AUTO);
|
if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, TH_AUTO);
|
||||||
else uiBlockSetCol(block, TH_BUT_NEUTRAL);
|
else uiBlockSetCol(block, TH_BUT_NEUTRAL);
|
||||||
uiDefBut(block, BUT, B_RAD_REPLACE, "Replace Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colours, changing input-meshes");
|
uiDefBut(block, BUT, B_RAD_REPLACE, "Replace Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colors, changing input-meshes");
|
||||||
uiDefBut(block, BUT, B_RAD_ADDMESH, "Add new Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colours, unchanging input-meshes");
|
uiDefBut(block, BUT, B_RAD_ADDMESH, "Add new Meshes", 1, 0, 10, 12, NULL, 0, 0, 0, 0, "Converts meshes to Mesh objects with vertex colors, unchanging input-meshes");
|
||||||
|
|
||||||
uiBlockSetCol(block, TH_AUTO);
|
uiBlockSetCol(block, TH_AUTO);
|
||||||
uiDefButS(block, ROW, B_RAD_DRAW, "Wire", 2, 0, 10, 10, &rad->drawtype, 0.0, 0.0, 0, 0, "Enables wireframe drawmode");
|
uiDefButS(block, ROW, B_RAD_DRAW, "Wire", 2, 0, 10, 10, &rad->drawtype, 0.0, 0.0, 0, 0, "Enables wireframe drawmode");
|
||||||
@ -1957,10 +1957,10 @@ static void world_panel_mapto(World *wrld)
|
|||||||
|
|
||||||
/* MAP TO */
|
/* MAP TO */
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButBitS(block, TOG, WOMAP_BLEND, B_WORLDPRV, "Blend", 10,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the colour progression of the background");
|
uiDefButBitS(block, TOG, WOMAP_BLEND, B_WORLDPRV, "Blend", 10,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color progression of the background");
|
||||||
uiDefButBitS(block, TOG, WOMAP_HORIZ, B_WORLDPRV, "Hori", 85,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the colour of the horizon");
|
uiDefButBitS(block, TOG, WOMAP_HORIZ, B_WORLDPRV, "Hori", 85,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the horizon");
|
||||||
uiDefButBitS(block, TOG, WOMAP_ZENUP, B_WORLDPRV, "ZenUp", 160,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the colour of the zenith above");
|
uiDefButBitS(block, TOG, WOMAP_ZENUP, B_WORLDPRV, "ZenUp", 160,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the zenith above");
|
||||||
uiDefButBitS(block, TOG, WOMAP_ZENDOWN, B_WORLDPRV, "ZenDo", 235,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the colour of the zenith below");
|
uiDefButBitS(block, TOG, WOMAP_ZENDOWN, B_WORLDPRV, "ZenDo", 235,180,75,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the color of the zenith below");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
@ -1968,7 +1968,7 @@ static void world_panel_mapto(World *wrld)
|
|||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI, B_WORLDPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects colour values");
|
uiDefButF(block, NUMSLI, B_WORLDPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values");
|
||||||
uiDefButF(block, NUMSLI, B_WORLDPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects normal values");
|
uiDefButF(block, NUMSLI, B_WORLDPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects normal values");
|
||||||
uiDefButF(block, NUMSLI, B_WORLDPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values");
|
uiDefButF(block, NUMSLI, B_WORLDPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values");
|
||||||
|
|
||||||
@ -2105,7 +2105,7 @@ static void world_panel_mistaph(World *wrld)
|
|||||||
uiDefButF(block, NUM,B_DIFF,"StarDist:", 160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specifies the average distance between any two stars");
|
uiDefButF(block, NUM,B_DIFF,"StarDist:", 160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specifies the average distance between any two stars");
|
||||||
uiDefButF(block, NUM,B_DIFF,"MinDist:", 160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specifies the minimum distance to the camera for stars");
|
uiDefButF(block, NUM,B_DIFF,"MinDist:", 160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specifies the minimum distance to the camera for stars");
|
||||||
uiDefButF(block, NUMSLI,B_DIFF,"Size:", 160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specifies the average screen dimension of stars");
|
uiDefButF(block, NUMSLI,B_DIFF,"Size:", 160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specifies the average screen dimension of stars");
|
||||||
uiDefButF(block, NUMSLI,B_DIFF,"Colnoise:", 160,10,140,19, &(wrld->starcolnoise), 0.0, 1.0, 100, 0, "Randomizes starcolour");
|
uiDefButF(block, NUMSLI,B_DIFF,"Colnoise:", 160,10,140,19, &(wrld->starcolnoise), 0.0, 1.0, 100, 0, "Randomizes star color");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2177,19 +2177,19 @@ static void world_panel_world(World *wrld)
|
|||||||
uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
|
uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoR ", 10,130,145,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "Sets the amount of red colour at the horizon");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoR ", 10,130,145,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "Sets the amount of red color at the horizon");
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoG ", 10,110,145,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "Sets the amount of green colour at the horizon");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoG ", 10,110,145,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "Sets the amount of green color at the horizon");
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoB ", 10,90,145,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "Sets the amount of blue colour at the horizon");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"HoB ", 10,90,145,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "Sets the amount of blue color at the horizon");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeR ", 160,130,145,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "Sets the amount of red colour at the zenith");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeR ", 160,130,145,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "Sets the amount of red color at the zenith");
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeG ", 160,110,145,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "Sets the amount of green colour at the zenith");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeG ", 160,110,145,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "Sets the amount of green color at the zenith");
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeB ", 160,90,145,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "Sets the amount of blue colour at the zenith");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"ZeB ", 160,90,145,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "Sets the amount of blue color at the zenith");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbR ", 10,50,145,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "Sets the amount of red ambient colour");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbR ", 10,50,145,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "Sets the amount of red ambient color");
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbG ", 10,30,145,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "Sets the amount of green ambient colour");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbG ", 10,30,145,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "Sets the amount of green ambient color");
|
||||||
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbB ", 10,10,145,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "Sets the amount of blue ambient colour");
|
uiDefButF(block, NUMSLI,B_WORLDPRV,"AmbB ", 10,10,145,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "Sets the amount of blue ambient color");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||||
@ -2341,13 +2341,13 @@ static void lamp_panel_mapto(Object *ob, Lamp *la)
|
|||||||
uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "The default value the textures uses to mix with");
|
uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "The default value the textures uses to mix with");
|
||||||
|
|
||||||
/* MAP TO */
|
/* MAP TO */
|
||||||
uiDefButBitS(block, TOG, MAP_COL, B_LAMPPRV, "Col", 10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic colour of the lamp");
|
uiDefButBitS(block, TOG, MAP_COL, B_LAMPPRV, "Col", 10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic color of the lamp");
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButS(block, MENU, B_LAMPPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode");
|
uiDefButS(block, MENU, B_LAMPPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode");
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiDefButF(block, NUMSLI, B_LAMPPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects colour values");
|
uiDefButF(block, NUMSLI, B_LAMPPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2983,10 +2983,10 @@ static void material_panel_map_to(Material *ma)
|
|||||||
|
|
||||||
/* MAP TO */
|
/* MAP TO */
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Col", 10,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic colour of the material");
|
uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Col", 10,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material");
|
||||||
uiDefButBitS(block, TOG3, MAP_NORM, B_MATPRV, "Nor", 50,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the rendered normal");
|
uiDefButBitS(block, TOG3, MAP_NORM, B_MATPRV, "Nor", 50,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the rendered normal");
|
||||||
uiDefButBitS(block, TOG, MAP_COLSPEC, B_MATPRV, "Csp", 90,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the specularity colour");
|
uiDefButBitS(block, TOG, MAP_COLSPEC, B_MATPRV, "Csp", 90,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the specularity color");
|
||||||
uiDefButBitS(block, TOG, MAP_COLMIR, B_MATPRV, "Cmir", 130,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the mirror colour");
|
uiDefButBitS(block, TOG, MAP_COLMIR, B_MATPRV, "Cmir", 130,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the mirror color");
|
||||||
uiDefButBitS(block, TOG3, MAP_REF, B_MATPRV, "Ref", 180,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of the materials reflectivity");
|
uiDefButBitS(block, TOG3, MAP_REF, B_MATPRV, "Ref", 180,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of the materials reflectivity");
|
||||||
uiDefButBitS(block, TOG3, MAP_SPEC, B_MATPRV, "Spec", 220,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of specularity");
|
uiDefButBitS(block, TOG3, MAP_SPEC, B_MATPRV, "Spec", 220,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of specularity");
|
||||||
uiDefButBitS(block, TOG3, MAP_AMB, B_MATPRV, "Amb", 270,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of ambient");
|
uiDefButBitS(block, TOG3, MAP_AMB, B_MATPRV, "Amb", 270,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the value of ambient");
|
||||||
@ -3004,7 +3004,7 @@ static void material_panel_map_to(Material *ma)
|
|||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects colour values");
|
uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 155,100,155,19, &(mtex->colfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects color values");
|
||||||
/* newnoise: increased range to 25, the constant offset for bumpmapping quite often needs a higher nor setting */
|
/* newnoise: increased range to 25, the constant offset for bumpmapping quite often needs a higher nor setting */
|
||||||
uiDefButF(block, NUMSLI, B_MATPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 25.0, 0, 0, "Sets the amount the texture affects normal values");
|
uiDefButF(block, NUMSLI, B_MATPRV, "Nor ", 155,80,155,19, &(mtex->norfac), 0.0, 25.0, 0, 0, "Sets the amount the texture affects normal values");
|
||||||
uiDefButF(block, NUMSLI, B_MATPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values");
|
uiDefButF(block, NUMSLI, B_MATPRV, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values");
|
||||||
@ -3459,8 +3459,8 @@ static void material_panel_material(Material *ma)
|
|||||||
if(!(ma->mode & MA_HALO)) {
|
if(!(ma->mode & MA_HALO)) {
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||||
uiDefButBitI(block, TOG, MA_VERTEXCOL, B_MAT_VCOL_LIGHT, "VCol Light", 8,166,74,20, &(ma->mode), 0, 0, 0, 0, "Adds vertex colours as extra light");
|
uiDefButBitI(block, TOG, MA_VERTEXCOL, B_MAT_VCOL_LIGHT, "VCol Light", 8,166,74,20, &(ma->mode), 0, 0, 0, 0, "Adds vertex colors as extra light");
|
||||||
uiDefButBitI(block, TOG, MA_VERTEXCOLP, B_MAT_VCOL_PAINT, "VCol Paint", 82,166,74,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colours with vertex colours");
|
uiDefButBitI(block, TOG, MA_VERTEXCOLP, B_MAT_VCOL_PAINT, "VCol Paint", 82,166,74,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colors with vertex colors");
|
||||||
uiDefButBitI(block, TOG, MA_FACETEXTURE, B_REDR, "TexFace", 156,166,74,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces");
|
uiDefButBitI(block, TOG, MA_FACETEXTURE, B_REDR, "TexFace", 156,166,74,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces");
|
||||||
uiDefButBitI(block, TOG, MA_SHLESS, B_MATPRV, "Shadeless", 230,166,73,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
|
uiDefButBitI(block, TOG, MA_SHLESS, B_MATPRV, "Shadeless", 230,166,73,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
|
||||||
|
|
||||||
@ -3476,14 +3476,14 @@ static void material_panel_material(Material *ma)
|
|||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
if(ma->mode & MA_HALO) {
|
if(ma->mode & MA_HALO) {
|
||||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the colour of the halo with the RGB sliders");
|
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the color of the halo with the RGB sliders");
|
||||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the colour of the lines with the RGB sliders");
|
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the color of the lines with the RGB sliders");
|
||||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Ring", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the colour of the rings with the RGB sliders");
|
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Ring", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the color of the rings with the RGB sliders");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Col", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the diffuse colour of the material");
|
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Col", 83,97,40,20, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Sets the diffuse color of the material");
|
||||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Spe", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the specular colour of the material");
|
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Spe", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the specular color of the material");
|
||||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Mir", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the mirror colour of the material");
|
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Mir", 83,57,40,20, &(ma->rgbsel), 2.0, 2.0, 0, 0, "Sets the mirror color of the material");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ma->rgbsel==0) {colpoin= &(ma->r); rgbsel= B_MATCOL;}
|
if(ma->rgbsel==0) {colpoin= &(ma->r); rgbsel= B_MATCOL;}
|
||||||
@ -3510,8 +3510,8 @@ static void material_panel_material(Material *ma)
|
|||||||
|
|
||||||
}
|
}
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB", 8,30,38,19, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Creates colour using red, green and blue");
|
uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB", 8,30,38,19, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Creates color using red, green and blue");
|
||||||
uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV", 46,30,38,19, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Creates colour using hue, saturation and value");
|
uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV", 46,30,38,19, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Creates color using hue, saturation and value");
|
||||||
uiDefButBitS(block, TOG, MA_DRAW_DYNABUTS, REDRAWBUTSSHADING, "DYN", 84,30,39,19, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjusts parameters for dynamics options");
|
uiDefButBitS(block, TOG, MA_DRAW_DYNABUTS, REDRAWBUTSSHADING, "DYN", 84,30,39,19, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjusts parameters for dynamics options");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], int boneflag
|
|||||||
/* move vector back */
|
/* move vector back */
|
||||||
Mat4Mul3Vecfl(imat, dirvec);
|
Mat4Mul3Vecfl(imat, dirvec);
|
||||||
|
|
||||||
if(0.0f != Normalise(dirvec)) {
|
if(0.0f != Normalize(dirvec)) {
|
||||||
float norvec[3], vec1[3], vec2[3], vec[3];
|
float norvec[3], vec1[3], vec2[3], vec[3];
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag,
|
|||||||
/* move vector back */
|
/* move vector back */
|
||||||
Mat4Mul3Vecfl(imat, dirvec);
|
Mat4Mul3Vecfl(imat, dirvec);
|
||||||
|
|
||||||
if(0.0f != Normalise(dirvec)) {
|
if(0.0f != Normalize(dirvec)) {
|
||||||
float norvech[3], norvect[3], vec[3];
|
float norvech[3], norvect[3], vec[3];
|
||||||
|
|
||||||
VECCOPY(vec, dirvec);
|
VECCOPY(vec, dirvec);
|
||||||
|
@ -1972,7 +1972,7 @@ void image_home(void)
|
|||||||
scrarea_queue_winredraw(curarea);
|
scrarea_queue_winredraw(curarea);
|
||||||
}
|
}
|
||||||
|
|
||||||
void image_viewcentre(void)
|
void image_viewcenter(void)
|
||||||
{
|
{
|
||||||
ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
|
ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser);
|
||||||
float size, min[2], max[2], d[2], xim=256.0f, yim=256.0f;
|
float size, min[2], max[2], d[2], xim=256.0f, yim=256.0f;
|
||||||
|
@ -512,7 +512,7 @@ static void drawshadbuflimits(Lamp *la, float mat[][4])
|
|||||||
lavec[0]= -mat[2][0];
|
lavec[0]= -mat[2][0];
|
||||||
lavec[1]= -mat[2][1];
|
lavec[1]= -mat[2][1];
|
||||||
lavec[2]= -mat[2][2];
|
lavec[2]= -mat[2][2];
|
||||||
Normalise(lavec);
|
Normalize(lavec);
|
||||||
|
|
||||||
sta[0]= mat[3][0]+ la->clipsta*lavec[0];
|
sta[0]= mat[3][0]+ la->clipsta*lavec[0];
|
||||||
sta[1]= mat[3][1]+ la->clipsta*lavec[1];
|
sta[1]= mat[3][1]+ la->clipsta*lavec[1];
|
||||||
@ -543,13 +543,13 @@ static void spotvolume(float *lvec, float *vvec, float inp)
|
|||||||
/* camera is at 0,0,0 */
|
/* camera is at 0,0,0 */
|
||||||
float temp[3],plane[3],mat1[3][3],mat2[3][3],mat3[3][3],mat4[3][3],q[4],co,si,angle;
|
float temp[3],plane[3],mat1[3][3],mat2[3][3],mat3[3][3],mat4[3][3],q[4],co,si,angle;
|
||||||
|
|
||||||
Normalise(lvec);
|
Normalize(lvec);
|
||||||
Normalise(vvec); /* is this the correct vector ? */
|
Normalize(vvec); /* is this the correct vector ? */
|
||||||
|
|
||||||
Crossf(temp,vvec,lvec); /* equation for a plane through vvec en lvec */
|
Crossf(temp,vvec,lvec); /* equation for a plane through vvec en lvec */
|
||||||
Crossf(plane,lvec,temp); /* a plane perpendicular to this, parrallel with lvec */
|
Crossf(plane,lvec,temp); /* a plane perpendicular to this, parrallel with lvec */
|
||||||
|
|
||||||
Normalise(plane);
|
Normalize(plane);
|
||||||
|
|
||||||
/* now we've got two equations: one of a cone and one of a plane, but we have
|
/* now we've got two equations: one of a cone and one of a plane, but we have
|
||||||
three unknowns. We remove one unkown by rotating the plane to z=0 (the plane normal) */
|
three unknowns. We remove one unkown by rotating the plane to z=0 (the plane normal) */
|
||||||
@ -562,7 +562,7 @@ static void spotvolume(float *lvec, float *vvec, float inp)
|
|||||||
q[1] = plane[1] ;
|
q[1] = plane[1] ;
|
||||||
q[2] = -plane[0] ;
|
q[2] = -plane[0] ;
|
||||||
q[3] = 0 ;
|
q[3] = 0 ;
|
||||||
Normalise(&q[1]);
|
Normalize(&q[1]);
|
||||||
|
|
||||||
angle = saacos(plane[2])/2.0;
|
angle = saacos(plane[2])/2.0;
|
||||||
co = cos(angle);
|
co = cos(angle);
|
||||||
@ -626,8 +626,8 @@ static void drawlamp(Object *ob)
|
|||||||
|
|
||||||
/* and view aligned matrix: */
|
/* and view aligned matrix: */
|
||||||
Mat4CpyMat4(imat, G.vd->viewinv);
|
Mat4CpyMat4(imat, G.vd->viewinv);
|
||||||
Normalise(imat[0]);
|
Normalize(imat[0]);
|
||||||
Normalise(imat[1]);
|
Normalize(imat[1]);
|
||||||
|
|
||||||
/* for AA effects */
|
/* for AA effects */
|
||||||
glGetFloatv(GL_CURRENT_COLOR, curcol);
|
glGetFloatv(GL_CURRENT_COLOR, curcol);
|
||||||
@ -1661,7 +1661,7 @@ static void draw_em_measure_stats(Object *ob, EditMesh *em)
|
|||||||
float fvec[3];
|
float fvec[3];
|
||||||
char val[32]; /* Stores the measurement display text here */
|
char val[32]; /* Stores the measurement display text here */
|
||||||
char conv_float[5]; /* Use a float conversion matching the grid size */
|
char conv_float[5]; /* Use a float conversion matching the grid size */
|
||||||
float area, col[3]; /* area of the face, colour of the text to draw */
|
float area, col[3]; /* area of the face, color of the text to draw */
|
||||||
|
|
||||||
/* make the precission of the pronted value proportionate to the gridsize */
|
/* make the precission of the pronted value proportionate to the gridsize */
|
||||||
if ((G.vd->grid) < 0.01)
|
if ((G.vd->grid) < 0.01)
|
||||||
@ -3272,8 +3272,8 @@ static int drawmball(Base *base, int dt)
|
|||||||
|
|
||||||
mygetmatrix(tmat);
|
mygetmatrix(tmat);
|
||||||
Mat4Invert(imat, tmat);
|
Mat4Invert(imat, tmat);
|
||||||
Normalise(imat[0]);
|
Normalize(imat[0]);
|
||||||
Normalise(imat[1]);
|
Normalize(imat[1]);
|
||||||
|
|
||||||
while(ml) {
|
while(ml) {
|
||||||
|
|
||||||
@ -3327,8 +3327,8 @@ static void draw_forcefield(Object *ob)
|
|||||||
/* calculus here, is reused in PFIELD_FORCE */
|
/* calculus here, is reused in PFIELD_FORCE */
|
||||||
mygetmatrix(tmat);
|
mygetmatrix(tmat);
|
||||||
Mat4Invert(imat, tmat);
|
Mat4Invert(imat, tmat);
|
||||||
// Normalise(imat[0]); // we don't do this because field doesnt scale either... apart from wind!
|
// Normalize(imat[0]); // we don't do this because field doesnt scale either... apart from wind!
|
||||||
// Normalise(imat[1]);
|
// Normalize(imat[1]);
|
||||||
|
|
||||||
if (pd->forcefield == PFIELD_WIND) {
|
if (pd->forcefield == PFIELD_WIND) {
|
||||||
float force_val;
|
float force_val;
|
||||||
@ -3440,12 +3440,12 @@ static void draw_box(float vec[8][3])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* uses boundbox, function used by Ketsji */
|
/* uses boundbox, function used by Ketsji */
|
||||||
void get_local_bounds(Object *ob, float *centre, float *size)
|
void get_local_bounds(Object *ob, float *center, float *size)
|
||||||
{
|
{
|
||||||
BoundBox *bb= object_get_boundbox(ob);
|
BoundBox *bb= object_get_boundbox(ob);
|
||||||
|
|
||||||
if(bb==NULL) {
|
if(bb==NULL) {
|
||||||
centre[0]= centre[1]= centre[2]= 0.0;
|
center[0]= center[1]= center[2]= 0.0;
|
||||||
VECCOPY(size, ob->size);
|
VECCOPY(size, ob->size);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -3453,9 +3453,9 @@ void get_local_bounds(Object *ob, float *centre, float *size)
|
|||||||
size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]);
|
size[1]= 0.5*fabs(bb->vec[0][1] - bb->vec[2][1]);
|
||||||
size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]);
|
size[2]= 0.5*fabs(bb->vec[0][2] - bb->vec[1][2]);
|
||||||
|
|
||||||
centre[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0;
|
center[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0;
|
||||||
centre[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0;
|
center[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0;
|
||||||
centre[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0;
|
center[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ void calc_oopstext(char *str, float *v1)
|
|||||||
|
|
||||||
flen= BMF_GetStringWidth(font, str);
|
flen= BMF_GetStringWidth(font, str);
|
||||||
|
|
||||||
/* calc centred location for icon and text,
|
/* calc centerd location for icon and text,
|
||||||
else if were zoomed too far out, just push text to the left of the oops block. */
|
else if were zoomed too far out, just push text to the left of the oops block. */
|
||||||
if (oopscalex>1.1) {
|
if (oopscalex>1.1) {
|
||||||
mval[0]= (f1+f2-flen+1)/2;
|
mval[0]= (f1+f2-flen+1)/2;
|
||||||
@ -454,7 +454,7 @@ void drawoopsspace(ScrArea *sa, void *spacedata)
|
|||||||
/* Draw a page about the oops */
|
/* Draw a page about the oops */
|
||||||
BIF_GetThemeColor3fv(TH_BACK, col);
|
BIF_GetThemeColor3fv(TH_BACK, col);
|
||||||
glColor3fv(col);
|
glColor3fv(col);
|
||||||
glRectf(G.v2d->tot.xmin-2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+2, G.v2d->tot.ymax+2); /* light square in the centre */
|
glRectf(G.v2d->tot.xmin-2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+2, G.v2d->tot.ymax+2); /* light square in the center */
|
||||||
BIF_ThemeColorShade(TH_BACK, -96); /* drop shadow color */
|
BIF_ThemeColorShade(TH_BACK, -96); /* drop shadow color */
|
||||||
glRectf(G.v2d->tot.xmin-1, G.v2d->tot.ymin-2, G.v2d->tot.xmax+3, G.v2d->tot.ymin-3); /* bottom dropshadow */
|
glRectf(G.v2d->tot.xmin-1, G.v2d->tot.ymin-2, G.v2d->tot.xmax+3, G.v2d->tot.ymin-3); /* bottom dropshadow */
|
||||||
glRectf(G.v2d->tot.xmax+2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+3, G.v2d->tot.ymax+1); /* right hand dropshadow */
|
glRectf(G.v2d->tot.xmax+2, G.v2d->tot.ymin-2, G.v2d->tot.xmax+3, G.v2d->tot.ymax+1); /* right hand dropshadow */
|
||||||
|
@ -629,7 +629,7 @@ static void draw_seq_text(Sequence *seq, float x1, float x2, float y1, float y2)
|
|||||||
BMF_DrawString(G.font, strp);
|
BMF_DrawString(G.font, strp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draws a shaded strip, made from gradient + flat colour + gradient */
|
/* draws a shaded strip, made from gradient + flat color + gradient */
|
||||||
static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2)
|
static void draw_shadedstrip(Sequence *seq, char *col, float x1, float y1, float x2, float y2)
|
||||||
{
|
{
|
||||||
float ymid1, ymid2;
|
float ymid1, ymid2;
|
||||||
@ -697,7 +697,7 @@ static void draw_seq_strip(Sequence *seq, ScrArea *sa, SpaceSeq *sseq)
|
|||||||
y2= seq->machine+SEQ_STRIP_OFSTOP;
|
y2= seq->machine+SEQ_STRIP_OFSTOP;
|
||||||
|
|
||||||
|
|
||||||
/* get the correct colour per strip type*/
|
/* get the correct color per strip type*/
|
||||||
get_seq_color3ubv(seq, col);
|
get_seq_color3ubv(seq, col);
|
||||||
|
|
||||||
/* draw the main strip body */
|
/* draw the main strip body */
|
||||||
|
@ -2680,9 +2680,9 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
|||||||
float len1, len2, vec[3];
|
float len1, len2, vec[3];
|
||||||
|
|
||||||
VECCOPY(vec, v3d->persinv[0]);
|
VECCOPY(vec, v3d->persinv[0]);
|
||||||
len1= Normalise(vec);
|
len1= Normalize(vec);
|
||||||
VECCOPY(vec, v3d->persinv[1]);
|
VECCOPY(vec, v3d->persinv[1]);
|
||||||
len2= Normalise(vec);
|
len2= Normalize(vec);
|
||||||
|
|
||||||
v3d->pixsize= 2.0f*(len1>len2?len1:len2);
|
v3d->pixsize= 2.0f*(len1>len2?len1:len2);
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ int get_border(rcti *rect, short flag)
|
|||||||
rect->ymax= mval[1];
|
rect->ymax= mval[1];
|
||||||
retval= event;
|
retval= event;
|
||||||
|
|
||||||
/* normalise */
|
/* normalize */
|
||||||
if(rect->xmin>rect->xmax) SWAP(int, rect->xmin, rect->xmax);
|
if(rect->xmin>rect->xmax) SWAP(int, rect->xmin, rect->xmax);
|
||||||
if(rect->ymin>rect->ymax) SWAP(int, rect->ymin, rect->ymax);
|
if(rect->ymin>rect->ymax) SWAP(int, rect->ymin, rect->ymax);
|
||||||
|
|
||||||
@ -883,7 +883,7 @@ static void make_trans_verts(float *min, float *max, int mode)
|
|||||||
MetaElem *ml;
|
MetaElem *ml;
|
||||||
EditVert *eve;
|
EditVert *eve;
|
||||||
EditBone *ebo;
|
EditBone *ebo;
|
||||||
float total, centre[3], centroid[3];
|
float total, center[3], centroid[3];
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
tottrans= 0; // global!
|
tottrans= 0; // global!
|
||||||
@ -1111,9 +1111,9 @@ static void make_trans_verts(float *min, float *max, int mode)
|
|||||||
centroid[2]/= total;
|
centroid[2]/= total;
|
||||||
}
|
}
|
||||||
|
|
||||||
centre[0]= (min[0]+max[0])/2.0;
|
center[0]= (min[0]+max[0])/2.0;
|
||||||
centre[1]= (min[1]+max[1])/2.0;
|
center[1]= (min[1]+max[1])/2.0;
|
||||||
centre[2]= (min[2]+max[2])/2.0;
|
center[2]= (min[2]+max[2])/2.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
#include "blendef.h"
|
#include "blendef.h"
|
||||||
#include "nla.h"
|
#include "nla.h"
|
||||||
|
|
||||||
extern float centre[3], centroid[3]; /* Originally defined in editobject.c */
|
extern float center[3], centroid[3]; /* Originally defined in editobject.c */
|
||||||
|
|
||||||
/* Macros */
|
/* Macros */
|
||||||
#define TEST_EDITARMATURE {if(G.obedit==0) return; if( (G.vd->lay & G.obedit->lay)==0 ) return;}
|
#define TEST_EDITARMATURE {if(G.obedit==0) return; if( (G.vd->lay & G.obedit->lay)==0 ) return;}
|
||||||
@ -367,8 +367,8 @@ void apply_rot_armature (Object *ob, float mat[3][3])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0 == do centre, 1 == centre new, 2 == centre cursor */
|
/* 0 == do center, 1 == center new, 2 == center cursor */
|
||||||
void docentre_armature (Object *ob, int centremode)
|
void docenter_armature (Object *ob, int centermode)
|
||||||
{
|
{
|
||||||
ListBase list;
|
ListBase list;
|
||||||
EditBone *ebone;
|
EditBone *ebone;
|
||||||
@ -384,8 +384,8 @@ void docentre_armature (Object *ob, int centremode)
|
|||||||
list.first= list.last = NULL;
|
list.first= list.last = NULL;
|
||||||
make_boneList(&list, &arm->bonebase, NULL);
|
make_boneList(&list, &arm->bonebase, NULL);
|
||||||
|
|
||||||
/* Find the centrepoint */
|
/* Find the centerpoint */
|
||||||
if (centremode == 2) {
|
if (centermode == 2) {
|
||||||
VECCOPY(cent, give_cursor());
|
VECCOPY(cent, give_cursor());
|
||||||
Mat4Invert(ob->imat, ob->obmat);
|
Mat4Invert(ob->imat, ob->obmat);
|
||||||
Mat4MulVecfl(ob->imat, cent);
|
Mat4MulVecfl(ob->imat, cent);
|
||||||
@ -417,8 +417,8 @@ void docentre_armature (Object *ob, int centremode)
|
|||||||
BLI_freelistN(&list);
|
BLI_freelistN(&list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Adjust object location for new centrepoint */
|
/* Adjust object location for new centerpoint */
|
||||||
if(centremode && G.obedit==0) {
|
if(centermode && G.obedit==0) {
|
||||||
Mat3CpyMat4(omat, ob->obmat);
|
Mat3CpyMat4(omat, ob->obmat);
|
||||||
|
|
||||||
Mat3MulVecfl(omat, cent);
|
Mat3MulVecfl(omat, cent);
|
||||||
|
@ -2463,7 +2463,7 @@ static void spin_nurb(float *dvec, short mode)
|
|||||||
Mat3CpyMat4(persmat, G.vd->viewmat);
|
Mat3CpyMat4(persmat, G.vd->viewmat);
|
||||||
Mat3Inv(persinv, persmat);
|
Mat3Inv(persinv, persmat);
|
||||||
|
|
||||||
/* imat and centre and size */
|
/* imat and center and size */
|
||||||
Mat3CpyMat4(bmat, G.obedit->obmat);
|
Mat3CpyMat4(bmat, G.obedit->obmat);
|
||||||
Mat3Inv(imat, bmat);
|
Mat3Inv(imat, bmat);
|
||||||
|
|
||||||
@ -2479,7 +2479,7 @@ static void spin_nurb(float *dvec, short mode)
|
|||||||
n[0]= G.vd->viewinv[2][0];
|
n[0]= G.vd->viewinv[2][0];
|
||||||
n[1]= G.vd->viewinv[2][1];
|
n[1]= G.vd->viewinv[2][1];
|
||||||
n[2]= G.vd->viewinv[2][2];
|
n[2]= G.vd->viewinv[2][2];
|
||||||
Normalise(n);
|
Normalize(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
phi= M_PI/8.0;
|
phi= M_PI/8.0;
|
||||||
@ -3743,7 +3743,7 @@ Nurb *addNurbprim(int type, int stype, int newname)
|
|||||||
if (G.vd) grid = G.vd->grid;
|
if (G.vd) grid = G.vd->grid;
|
||||||
else grid = 1.0;
|
else grid = 1.0;
|
||||||
|
|
||||||
/* imat and centre and size */
|
/* imat and center and size */
|
||||||
if(G.obedit) {
|
if(G.obedit) {
|
||||||
|
|
||||||
Mat3CpyMat4(mat, G.obedit->obmat);
|
Mat3CpyMat4(mat, G.obedit->obmat);
|
||||||
|
@ -183,7 +183,7 @@ static void uv_calc_center_vector(float *result, Object *ob, Mesh *me)
|
|||||||
|
|
||||||
switch (G.vd->around)
|
switch (G.vd->around)
|
||||||
{
|
{
|
||||||
case V3D_CENTRE: /* bounding box center */
|
case V3D_CENTER: /* bounding box center */
|
||||||
min[0]= min[1]= min[2]= 1e20f;
|
min[0]= min[1]= min[2]= 1e20f;
|
||||||
max[0]= max[1]= max[2]= -1e20f;
|
max[0]= max[1]= max[2]= -1e20f;
|
||||||
|
|
||||||
|
@ -2553,7 +2553,7 @@ void common_insertkey(void)
|
|||||||
id= G.buts->lockpoin;
|
id= G.buts->lockpoin;
|
||||||
te= G.buts->lockpoin;
|
te= G.buts->lockpoin;
|
||||||
if(id) {
|
if(id) {
|
||||||
event= pupmenu("Insert Key %t|Cloud%x0|Marble%x1|Stucci%x2|Wood%x3|Magic%x4|Blend%x5|Musgrave%x6|Voronoi%x7|Distnoise%x8|ColourFilter%x9");
|
event= pupmenu("Insert Key %t|Cloud%x0|Marble%x1|Stucci%x2|Wood%x3|Magic%x4|Blend%x5|Musgrave%x6|Voronoi%x7|Distnoise%x8|ColorFilter%x9");
|
||||||
if(event== -1) return;
|
if(event== -1) return;
|
||||||
|
|
||||||
if(event==0) {
|
if(event==0) {
|
||||||
@ -3942,8 +3942,8 @@ void set_speed_editipo(float speed)
|
|||||||
vec1[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[0][1]) / (beztar[2]->vec[1][0] - beztar[2]->vec[0][0]) ;
|
vec1[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[0][1]) / (beztar[2]->vec[1][0] - beztar[2]->vec[0][0]) ;
|
||||||
vec2[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[2][1]) / (beztar[2]->vec[2][0] - beztar[2]->vec[1][0]) ;
|
vec2[2]= (beztar[2]->vec[1][1] - beztar[2]->vec[2][1]) / (beztar[2]->vec[2][0] - beztar[2]->vec[1][0]) ;
|
||||||
|
|
||||||
Normalise(vec1);
|
Normalize(vec1);
|
||||||
Normalise(vec2);
|
Normalize(vec2);
|
||||||
|
|
||||||
VecMulf(vec1, speed);
|
VecMulf(vec1, speed);
|
||||||
VecMulf(vec2, speed);
|
VecMulf(vec2, speed);
|
||||||
|
@ -157,7 +157,7 @@ void add_primitiveMball(int dummy_argument)
|
|||||||
ml= ml->next;
|
ml= ml->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* imat and centre and size */
|
/* imat and center and size */
|
||||||
Mat3CpyMat4(mat, G.obedit->obmat);
|
Mat3CpyMat4(mat, G.obedit->obmat);
|
||||||
|
|
||||||
curs= give_cursor();
|
curs= give_cursor();
|
||||||
|
@ -660,7 +660,7 @@ static void edge_normal_compare(EditEdge *eed, EditFace *efa1)
|
|||||||
else CalcCent3f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co);
|
else CalcCent3f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co);
|
||||||
|
|
||||||
VecSubf(cent1, cent2, cent1);
|
VecSubf(cent1, cent2, cent1);
|
||||||
Normalise(cent1);
|
Normalize(cent1);
|
||||||
inp= cent1[0]*efa1->n[0] + cent1[1]*efa1->n[1] + cent1[2]*efa1->n[2];
|
inp= cent1[0]*efa1->n[0] + cent1[1]*efa1->n[1] + cent1[2]*efa1->n[2];
|
||||||
|
|
||||||
if(inp < -0.001 ) eed->f1= 1;
|
if(inp < -0.001 ) eed->f1= 1;
|
||||||
|
@ -186,9 +186,9 @@ void add_click_mesh(void)
|
|||||||
done= 1;
|
done= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(done) Normalise(nor);
|
if(done) Normalize(nor);
|
||||||
|
|
||||||
/* centre */
|
/* center */
|
||||||
VecAddf(cent, min, max);
|
VecAddf(cent, min, max);
|
||||||
VecMulf(cent, 0.5f);
|
VecMulf(cent, 0.5f);
|
||||||
VECCOPY(min, cent);
|
VECCOPY(min, cent);
|
||||||
@ -206,14 +206,14 @@ void add_click_mesh(void)
|
|||||||
float dot;
|
float dot;
|
||||||
|
|
||||||
VECCOPY(vec, min);
|
VECCOPY(vec, min);
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
dot= INPR(vec, nor);
|
dot= INPR(vec, nor);
|
||||||
|
|
||||||
if( fabs(dot)<0.999) {
|
if( fabs(dot)<0.999) {
|
||||||
float cross[3], si, q1[4];
|
float cross[3], si, q1[4];
|
||||||
|
|
||||||
Crossf(cross, nor, vec);
|
Crossf(cross, nor, vec);
|
||||||
Normalise(cross);
|
Normalize(cross);
|
||||||
dot= 0.5f*saacos(dot);
|
dot= 0.5f*saacos(dot);
|
||||||
si= (float)sin(dot);
|
si= (float)sin(dot);
|
||||||
q1[0]= (float)cos(dot);
|
q1[0]= (float)cos(dot);
|
||||||
@ -865,7 +865,7 @@ int confirm_objectExists( Mesh **me, float mat[][3] )
|
|||||||
}
|
}
|
||||||
*me = G.obedit->data;
|
*me = G.obedit->data;
|
||||||
|
|
||||||
/* imat and centre and size */
|
/* imat and center and size */
|
||||||
Mat3CpyMat4(mat, G.obedit->obmat);
|
Mat3CpyMat4(mat, G.obedit->obmat);
|
||||||
|
|
||||||
return newob;
|
return newob;
|
||||||
@ -1079,7 +1079,7 @@ void make_prim(int type, float imat[3][3], int tot, int seg,
|
|||||||
}
|
}
|
||||||
d= -d;
|
d= -d;
|
||||||
}
|
}
|
||||||
/* centre vertices */
|
/* center vertices */
|
||||||
/* type 7, a cone can only have 1 one side filled
|
/* type 7, a cone can only have 1 one side filled
|
||||||
* if the cone has no capping, dont add vtop */
|
* if the cone has no capping, dont add vtop */
|
||||||
if((fill && type>1) || type == 7) {
|
if((fill && type>1) || type == 7) {
|
||||||
|
@ -190,7 +190,7 @@ void EM_editselection_normal(float *normal, EditSelection *ese)
|
|||||||
we need the plane for this */
|
we need the plane for this */
|
||||||
Crossf(vec, normal, plane);
|
Crossf(vec, normal, plane);
|
||||||
Crossf(normal, plane, vec);
|
Crossf(normal, plane, vec);
|
||||||
Normalise(normal);
|
Normalize(normal);
|
||||||
|
|
||||||
} else if (ese->type==EDITFACE) {
|
} else if (ese->type==EDITFACE) {
|
||||||
EditFace *efa= ese->data;
|
EditFace *efa= ese->data;
|
||||||
@ -263,7 +263,7 @@ void EM_editselection_plane(float *plane, EditSelection *ese)
|
|||||||
VecCopyf(plane, vec);
|
VecCopyf(plane, vec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Normalise(plane);
|
Normalize(plane);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1013,7 +1013,7 @@ short extrudeflag_edges_indiv(short flag, float *nor)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Normalise(nor);
|
Normalize(nor);
|
||||||
|
|
||||||
/* set correct selection */
|
/* set correct selection */
|
||||||
EM_clear_flag_all(SELECT);
|
EM_clear_flag_all(SELECT);
|
||||||
@ -1279,7 +1279,7 @@ static short extrudeflag_edge(short flag, float *nor)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Normalise(nor); // translation normal grab
|
Normalize(nor); // translation normal grab
|
||||||
|
|
||||||
/* step 7: redo selection */
|
/* step 7: redo selection */
|
||||||
EM_clear_flag_all(SELECT);
|
EM_clear_flag_all(SELECT);
|
||||||
@ -1540,7 +1540,7 @@ short extrudeflag_vert(short flag, float *nor)
|
|||||||
efa= nextvl;
|
efa= nextvl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Normalise(nor); // for grab
|
Normalize(nor); // for grab
|
||||||
|
|
||||||
/* for all vertices with eve->tmp.v!=0
|
/* for all vertices with eve->tmp.v!=0
|
||||||
if eve->f1==1: make edge
|
if eve->f1==1: make edge
|
||||||
@ -1853,9 +1853,9 @@ void recalc_editnormals(void)
|
|||||||
|
|
||||||
/* following Mesh convention; we use vertex coordinate itself for normal in this case */
|
/* following Mesh convention; we use vertex coordinate itself for normal in this case */
|
||||||
for(eve= em->verts.first; eve; eve=eve->next) {
|
for(eve= em->verts.first; eve; eve=eve->next) {
|
||||||
if (Normalise(eve->no)==0.0) {
|
if (Normalize(eve->no)==0.0) {
|
||||||
VECCOPY(eve->no, eve->co);
|
VECCOPY(eve->no, eve->co);
|
||||||
Normalise(eve->no);
|
Normalize(eve->no);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3324,7 +3324,7 @@ void vertices_to_sphere(void)
|
|||||||
Mat3CpyMat4(bmat, ob->obmat);
|
Mat3CpyMat4(bmat, ob->obmat);
|
||||||
Mat3Inv(imat, bmat);
|
Mat3Inv(imat, bmat);
|
||||||
|
|
||||||
/* centre */
|
/* center */
|
||||||
curs= give_cursor();
|
curs= give_cursor();
|
||||||
cent[0]= curs[0]-ob->obmat[3][0];
|
cent[0]= curs[0]-ob->obmat[3][0];
|
||||||
cent[1]= curs[1]-ob->obmat[3][1];
|
cent[1]= curs[1]-ob->obmat[3][1];
|
||||||
@ -3352,7 +3352,7 @@ void vertices_to_sphere(void)
|
|||||||
vec[1]= eve->co[1]-cent[1];
|
vec[1]= eve->co[1]-cent[1];
|
||||||
vec[2]= eve->co[2]-cent[2];
|
vec[2]= eve->co[2]-cent[2];
|
||||||
|
|
||||||
Normalise(vec);
|
Normalize(vec);
|
||||||
|
|
||||||
eve->co[0]= fac*(cent[0]+vec[0]*len) + facm*eve->co[0];
|
eve->co[0]= fac*(cent[0]+vec[0]*len) + facm*eve->co[0];
|
||||||
eve->co[1]= fac*(cent[1]+vec[1]*len) + facm*eve->co[1];
|
eve->co[1]= fac*(cent[1]+vec[1]*len) + facm*eve->co[1];
|
||||||
|
@ -701,7 +701,7 @@ void extrude_repeat_mesh(int steps, float offs)
|
|||||||
dvec[0]= G.vd->persinv[2][0];
|
dvec[0]= G.vd->persinv[2][0];
|
||||||
dvec[1]= G.vd->persinv[2][1];
|
dvec[1]= G.vd->persinv[2][1];
|
||||||
dvec[2]= G.vd->persinv[2][2];
|
dvec[2]= G.vd->persinv[2][2];
|
||||||
Normalise(dvec);
|
Normalize(dvec);
|
||||||
dvec[0]*= offs;
|
dvec[0]*= offs;
|
||||||
dvec[1]*= offs;
|
dvec[1]*= offs;
|
||||||
dvec[2]*= offs;
|
dvec[2]*= offs;
|
||||||
@ -740,7 +740,7 @@ void spin_mesh(int steps, float degr, float *dvec, int mode)
|
|||||||
TEST_EDITMESH
|
TEST_EDITMESH
|
||||||
if(multires_test()) return;
|
if(multires_test()) return;
|
||||||
|
|
||||||
/* imat and centre and size */
|
/* imat and center and size */
|
||||||
Mat3CpyMat4(bmat, G.obedit->obmat);
|
Mat3CpyMat4(bmat, G.obedit->obmat);
|
||||||
Mat3Inv(imat,bmat);
|
Mat3Inv(imat,bmat);
|
||||||
|
|
||||||
@ -762,7 +762,7 @@ void spin_mesh(int steps, float degr, float *dvec, int mode)
|
|||||||
n[0]= G.vd->viewinv[2][0];
|
n[0]= G.vd->viewinv[2][0];
|
||||||
n[1]= G.vd->viewinv[2][1];
|
n[1]= G.vd->viewinv[2][1];
|
||||||
n[2]= G.vd->viewinv[2][2];
|
n[2]= G.vd->viewinv[2][2];
|
||||||
Normalise(n);
|
Normalize(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
q[0]= (float)cos(phi);
|
q[0]= (float)cos(phi);
|
||||||
@ -1191,7 +1191,7 @@ static void alter_co(float *co, EditEdge *edge, float rad, int beauty, float per
|
|||||||
float len, fac, nor[3], nor1[3], nor2[3];
|
float len, fac, nor[3], nor1[3], nor2[3];
|
||||||
|
|
||||||
VecSubf(nor, edge->v1->co, edge->v2->co);
|
VecSubf(nor, edge->v1->co, edge->v2->co);
|
||||||
len= 0.5f*Normalise(nor);
|
len= 0.5f*Normalize(nor);
|
||||||
|
|
||||||
VECCOPY(nor1, edge->v1->no);
|
VECCOPY(nor1, edge->v1->no);
|
||||||
VECCOPY(nor2, edge->v2->no);
|
VECCOPY(nor2, edge->v2->no);
|
||||||
@ -1220,7 +1220,7 @@ static void alter_co(float *co, EditEdge *edge, float rad, int beauty, float per
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(rad > 0.0) { /* subdivide sphere */
|
if(rad > 0.0) { /* subdivide sphere */
|
||||||
Normalise(co);
|
Normalize(co);
|
||||||
co[0]*= rad;
|
co[0]*= rad;
|
||||||
co[1]*= rad;
|
co[1]*= rad;
|
||||||
co[2]*= rad;
|
co[2]*= rad;
|
||||||
@ -1260,7 +1260,7 @@ static EditVert *subdivide_edge_addvert(EditEdge *edge, float rad, int beauty, f
|
|||||||
ev->no[0] = (edge->v2->no[0]-edge->v1->no[0])*percent + edge->v1->no[0];
|
ev->no[0] = (edge->v2->no[0]-edge->v1->no[0])*percent + edge->v1->no[0];
|
||||||
ev->no[1] = (edge->v2->no[1]-edge->v1->no[1])*percent + edge->v1->no[1];
|
ev->no[1] = (edge->v2->no[1]-edge->v1->no[1])*percent + edge->v1->no[1];
|
||||||
ev->no[2] = (edge->v2->no[2]-edge->v1->no[2])*percent + edge->v1->no[2];
|
ev->no[2] = (edge->v2->no[2]-edge->v1->no[2])*percent + edge->v1->no[2];
|
||||||
Normalise(ev->no);
|
Normalize(ev->no);
|
||||||
|
|
||||||
return ev;
|
return ev;
|
||||||
}
|
}
|
||||||
@ -3733,12 +3733,12 @@ static void bevel_displace_vec(float *midvec, float *v1, float *v2, float *v3, f
|
|||||||
VecSubf(c, v3, v2);
|
VecSubf(c, v3, v2);
|
||||||
|
|
||||||
Crossf(n_a, a, no);
|
Crossf(n_a, a, no);
|
||||||
Normalise(n_a);
|
Normalize(n_a);
|
||||||
Crossf(n_c, no, c);
|
Crossf(n_c, no, c);
|
||||||
Normalise(n_c);
|
Normalize(n_c);
|
||||||
|
|
||||||
Normalise(a);
|
Normalize(a);
|
||||||
Normalise(c);
|
Normalize(c);
|
||||||
ac = Inpf(a, c);
|
ac = Inpf(a, c);
|
||||||
|
|
||||||
if (ac == 1 || ac == -1) {
|
if (ac == 1 || ac == -1) {
|
||||||
@ -3748,7 +3748,7 @@ static void bevel_displace_vec(float *midvec, float *v1, float *v2, float *v3, f
|
|||||||
ac2 = ac * ac;
|
ac2 = ac * ac;
|
||||||
fac = (float)sqrt((ac2 + 2*ac + 1)/(1 - ac2) + 1);
|
fac = (float)sqrt((ac2 + 2*ac + 1)/(1 - ac2) + 1);
|
||||||
VecAddf(mid, n_c, n_a);
|
VecAddf(mid, n_c, n_a);
|
||||||
Normalise(mid);
|
Normalize(mid);
|
||||||
VecMulf(mid, d * fac);
|
VecMulf(mid, d * fac);
|
||||||
VecAddf(mid, mid, v2);
|
VecAddf(mid, mid, v2);
|
||||||
VecCopyf(midvec, mid);
|
VecCopyf(midvec, mid);
|
||||||
@ -3763,11 +3763,11 @@ static void fix_bevel_wrap(float *midvec, float *v1, float *v2, float *v3, float
|
|||||||
float a[3], b[3], c[3], l_a, l_b, l_c, s_a, s_b, s_c, Pos1[3], Pos2[3], Dir[3];
|
float a[3], b[3], c[3], l_a, l_b, l_c, s_a, s_b, s_c, Pos1[3], Pos2[3], Dir[3];
|
||||||
|
|
||||||
VecSubf(a, v3, v2);
|
VecSubf(a, v3, v2);
|
||||||
l_a = Normalise(a);
|
l_a = Normalize(a);
|
||||||
VecSubf(b, v4, v3);
|
VecSubf(b, v4, v3);
|
||||||
Normalise(b);
|
Normalize(b);
|
||||||
VecSubf(c, v1, v2);
|
VecSubf(c, v1, v2);
|
||||||
Normalise(c);
|
Normalize(c);
|
||||||
|
|
||||||
s_b = Inpf(a, c);
|
s_b = Inpf(a, c);
|
||||||
s_b = (float)sqrt(1 - (s_b * s_b));
|
s_b = (float)sqrt(1 - (s_b * s_b));
|
||||||
@ -3905,7 +3905,7 @@ static void bevel_shrink_faces(float d, int flag)
|
|||||||
EditFace *efa;
|
EditFace *efa;
|
||||||
float vec[3], no[3], v1[3], v2[3], v3[3], v4[3];
|
float vec[3], no[3], v1[3], v2[3], v3[3], v4[3];
|
||||||
|
|
||||||
/* move edges of all faces with efa->f1 & flag closer towards their centres */
|
/* move edges of all faces with efa->f1 & flag closer towards their centers */
|
||||||
efa= em->faces.first;
|
efa= em->faces.first;
|
||||||
while (efa) {
|
while (efa) {
|
||||||
if (efa->f1 & flag) {
|
if (efa->f1 & flag) {
|
||||||
@ -3946,7 +3946,7 @@ static void bevel_shrink_draw(float d, int flag)
|
|||||||
EditFace *efa;
|
EditFace *efa;
|
||||||
float vec[3], no[3], v1[3], v2[3], v3[3], v4[3], fv1[3], fv2[3], fv3[3], fv4[3];
|
float vec[3], no[3], v1[3], v2[3], v3[3], v4[3], fv1[3], fv2[3], fv3[3], fv4[3];
|
||||||
|
|
||||||
/* move edges of all faces with efa->f1 & flag closer towards their centres */
|
/* move edges of all faces with efa->f1 & flag closer towards their centers */
|
||||||
efa= em->faces.first;
|
efa= em->faces.first;
|
||||||
while (efa) {
|
while (efa) {
|
||||||
VECCOPY(v1, efa->v1->co);
|
VECCOPY(v1, efa->v1->co);
|
||||||
@ -4409,7 +4409,7 @@ void bevel_menu()
|
|||||||
{
|
{
|
||||||
char Finished = 0, Canceled = 0, str[100], Recalc = 0;
|
char Finished = 0, Canceled = 0, str[100], Recalc = 0;
|
||||||
short mval[2], oval[2], curval[2], event = 0, recurs = 1, nr;
|
short mval[2], oval[2], curval[2], event = 0, recurs = 1, nr;
|
||||||
float vec[3], d, drawd=0.0, centre[3], fac = 1;
|
float vec[3], d, drawd=0.0, center[3], fac = 1;
|
||||||
|
|
||||||
getmouseco_areawin(mval);
|
getmouseco_areawin(mval);
|
||||||
oval[0] = mval[0]; oval[1] = mval[1];
|
oval[0] = mval[0]; oval[1] = mval[1];
|
||||||
@ -4420,7 +4420,7 @@ void bevel_menu()
|
|||||||
|
|
||||||
// Init grabz for window to vec conversions
|
// Init grabz for window to vec conversions
|
||||||
initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
|
initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
|
||||||
window_to_3d(centre, mval[0], mval[1]);
|
window_to_3d(center, mval[0], mval[1]);
|
||||||
|
|
||||||
if(button(&recurs, 1, 4, "Recursion:")==0) return;
|
if(button(&recurs, 1, 4, "Recursion:")==0) return;
|
||||||
|
|
||||||
@ -4442,7 +4442,7 @@ void bevel_menu()
|
|||||||
curval[1] = mval[1];
|
curval[1] = mval[1];
|
||||||
|
|
||||||
window_to_3d(vec, mval[0]-oval[0], mval[1]-oval[1]);
|
window_to_3d(vec, mval[0]-oval[0], mval[1]-oval[1]);
|
||||||
d = Normalise(vec) / 10;
|
d = Normalize(vec) / 10;
|
||||||
|
|
||||||
|
|
||||||
drawd = d * fac;
|
drawd = d * fac;
|
||||||
|
@ -1767,9 +1767,9 @@ void check_editmode(int type)
|
|||||||
exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* freedata, and undo */
|
exit_editmode(EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR); /* freedata, and undo */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0 == do centre, 1 == centre new, 2 == centre cursor */
|
/* 0 == do center, 1 == center new, 2 == center cursor */
|
||||||
|
|
||||||
void docentre(int centremode)
|
void docenter(int centermode)
|
||||||
{
|
{
|
||||||
EditMesh *em = G.editMesh;
|
EditMesh *em = G.editMesh;
|
||||||
Base *base;
|
Base *base;
|
||||||
@ -1849,7 +1849,7 @@ void docentre(int centremode)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(centremode==2) {
|
if(centermode==2) {
|
||||||
VECCOPY(cent, give_cursor());
|
VECCOPY(cent, give_cursor());
|
||||||
Mat4Invert(base->object->imat, base->object->obmat);
|
Mat4Invert(base->object->imat, base->object->obmat);
|
||||||
Mat4MulVecfl(base->object->imat, cent);
|
Mat4MulVecfl(base->object->imat, cent);
|
||||||
@ -1871,7 +1871,7 @@ void docentre(int centremode)
|
|||||||
}
|
}
|
||||||
me->flag |= ME_ISDONE;
|
me->flag |= ME_ISDONE;
|
||||||
|
|
||||||
if(centremode) {
|
if(centermode) {
|
||||||
Mat3CpyMat4(omat, base->object->obmat);
|
Mat3CpyMat4(omat, base->object->obmat);
|
||||||
|
|
||||||
VECCOPY(centn, cent);
|
VECCOPY(centn, cent);
|
||||||
@ -1925,7 +1925,7 @@ void docentre(int centremode)
|
|||||||
nu1= cu->nurb.first;
|
nu1= cu->nurb.first;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(centremode==2) {
|
if(centermode==2) {
|
||||||
VECCOPY(cent, give_cursor());
|
VECCOPY(cent, give_cursor());
|
||||||
Mat4Invert(base->object->imat, base->object->obmat);
|
Mat4Invert(base->object->imat, base->object->obmat);
|
||||||
Mat4MulVecfl(base->object->imat, cent);
|
Mat4MulVecfl(base->object->imat, cent);
|
||||||
@ -1965,7 +1965,7 @@ void docentre(int centremode)
|
|||||||
nu= nu->next;
|
nu= nu->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(centremode && G.obedit==0) {
|
if(centermode && G.obedit==0) {
|
||||||
Mat3CpyMat4(omat, base->object->obmat);
|
Mat3CpyMat4(omat, base->object->obmat);
|
||||||
|
|
||||||
Mat3MulVecfl(omat, cent);
|
Mat3MulVecfl(omat, cent);
|
||||||
@ -1975,7 +1975,7 @@ void docentre(int centremode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(G.obedit) {
|
if(G.obedit) {
|
||||||
if (centremode==0) {
|
if (centermode==0) {
|
||||||
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2008,7 +2008,7 @@ void docentre(int centremode)
|
|||||||
/* Function to recenter armatures in editarmature.c
|
/* Function to recenter armatures in editarmature.c
|
||||||
* Bone + object locations are handled there.
|
* Bone + object locations are handled there.
|
||||||
*/
|
*/
|
||||||
docentre_armature(base->object, centremode);
|
docenter_armature(base->object, centermode);
|
||||||
|
|
||||||
if(G.obedit)
|
if(G.obedit)
|
||||||
break;
|
break;
|
||||||
@ -2024,7 +2024,7 @@ void docentre(int centremode)
|
|||||||
BIF_undo_push("Do Center");
|
BIF_undo_push("Do Center");
|
||||||
}
|
}
|
||||||
|
|
||||||
void docentre_new(void)
|
void docenter_new(void)
|
||||||
{
|
{
|
||||||
if(G.scene->id.lib) return;
|
if(G.scene->id.lib) return;
|
||||||
|
|
||||||
@ -2032,11 +2032,11 @@ void docentre_new(void)
|
|||||||
error("Unable to center new in Edit Mode");
|
error("Unable to center new in Edit Mode");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
docentre(1);
|
docenter(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void docentre_cursor(void)
|
void docenter_cursor(void)
|
||||||
{
|
{
|
||||||
if(G.scene->id.lib) return;
|
if(G.scene->id.lib) return;
|
||||||
|
|
||||||
@ -2044,7 +2044,7 @@ void docentre_cursor(void)
|
|||||||
error("Unable to center cursor in Edit Mode");
|
error("Unable to center cursor in Edit Mode");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
docentre(2);
|
docenter(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3821,10 +3821,10 @@ int cylinder_intersect_test(void)
|
|||||||
VecSubf(rc, oldloc, base);
|
VecSubf(rc, oldloc, base);
|
||||||
|
|
||||||
/* the axis */
|
/* the axis */
|
||||||
len2= Normalise(axis);
|
len2= Normalize(axis);
|
||||||
|
|
||||||
Crossf(n, speed, axis);
|
Crossf(n, speed, axis);
|
||||||
len= Normalise(n);
|
len= Normalize(n);
|
||||||
if(len==0.0) return 0;
|
if(len==0.0) return 0;
|
||||||
|
|
||||||
dist= fabs( rc[0]*n[0] + rc[1]*n[1] + rc[2]*n[2] );
|
dist= fabs( rc[0]*n[0] + rc[1]*n[1] + rc[2]*n[2] );
|
||||||
@ -3880,7 +3880,7 @@ int sphere_intersect_test(void)
|
|||||||
|
|
||||||
v1= v1->next;
|
v1= v1->next;
|
||||||
VecSubf(speed, v1->co, oldloc);
|
VecSubf(speed, v1->co, oldloc);
|
||||||
len= Normalise(speed);
|
len= Normalize(speed);
|
||||||
if(len==0.0) return 0;
|
if(len==0.0) return 0;
|
||||||
|
|
||||||
VecSubf(rc, oldloc, base);
|
VecSubf(rc, oldloc, base);
|
||||||
|
@ -382,7 +382,7 @@ void headerbox(ScrArea *area)
|
|||||||
if(active) BIF_ThemeColor(TH_HEADER);
|
if(active) BIF_ThemeColor(TH_HEADER);
|
||||||
else BIF_ThemeColor(TH_HEADERDESEL);
|
else BIF_ThemeColor(TH_HEADERDESEL);
|
||||||
|
|
||||||
/* weird values here... is because of window matrix that centres buttons */
|
/* weird values here... is because of window matrix that centers buttons */
|
||||||
if(area->headertype==HEADERTOP) {
|
if(area->headertype==HEADERTOP) {
|
||||||
uiSetRoundBox(3);
|
uiSetRoundBox(3);
|
||||||
uiRoundBoxEmboss(-0.5+area->headbutofs, -10.0, width-1.5+area->headbutofs, HEADERY-2.0, SCR_ROUND, active);
|
uiRoundBoxEmboss(-0.5+area->headbutofs, -10.0, width-1.5+area->headbutofs, HEADERY-2.0, SCR_ROUND, active);
|
||||||
@ -2065,7 +2065,7 @@ ScrArea *closest_bigger_area(void)
|
|||||||
|
|
||||||
len= MIN4(len, len1, len2, len3);
|
len= MIN4(len, len1, len2, len3);
|
||||||
|
|
||||||
/* plus centre */
|
/* plus center */
|
||||||
vec[0]= (sa->v2->vec.x+sa->v3->vec.x)/2;
|
vec[0]= (sa->v2->vec.x+sa->v3->vec.x)/2;
|
||||||
vec[1]= (sa->v1->vec.y+sa->v2->vec.y)/2;
|
vec[1]= (sa->v1->vec.y+sa->v2->vec.y)/2;
|
||||||
|
|
||||||
|
@ -635,7 +635,7 @@ static char interpret_move(short mcord[][2], int count)
|
|||||||
|
|
||||||
/* new method:
|
/* new method:
|
||||||
*
|
*
|
||||||
* starting from end points, calculate centre with maximum distance
|
* starting from end points, calculate center with maximum distance
|
||||||
* dependant at the angle s / g / r is defined
|
* dependant at the angle s / g / r is defined
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1278,7 +1278,7 @@ void mouse_select(void)
|
|||||||
|
|
||||||
getmouseco_areawin(mval);
|
getmouseco_areawin(mval);
|
||||||
|
|
||||||
/* This block uses the control key to make the object selected by its centre point rather then its contents */
|
/* This block uses the control key to make the object selected by its center point rather then its contents */
|
||||||
if(G.obedit==0 && (G.qual & LR_CTRLKEY)) {
|
if(G.obedit==0 && (G.qual & LR_CTRLKEY)) {
|
||||||
|
|
||||||
/* note; shift+alt goes to group-flush-selecting */
|
/* note; shift+alt goes to group-flush-selecting */
|
||||||
@ -2203,7 +2203,7 @@ void fly(void)
|
|||||||
/* the dist defines a vector that is infront of the offset
|
/* the dist defines a vector that is infront of the offset
|
||||||
to rotate the view about.
|
to rotate the view about.
|
||||||
this is no good for fly mode because we
|
this is no good for fly mode because we
|
||||||
want to rotate about the viewers centre.
|
want to rotate about the viewers center.
|
||||||
but to correct the dist removal we must
|
but to correct the dist removal we must
|
||||||
alter offset so the view dosent jump. */
|
alter offset so the view dosent jump. */
|
||||||
|
|
||||||
|
@ -438,7 +438,7 @@ static void do_image_viewmenu(void *arg, int event)
|
|||||||
add_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW);
|
add_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
image_viewcentre();
|
image_viewcenter();
|
||||||
case 10: /* Display Normalized Coordinates */
|
case 10: /* Display Normalized Coordinates */
|
||||||
G.sima->flag ^= SI_COORDFLOATS;
|
G.sima->flag ^= SI_COORDFLOATS;
|
||||||
allqueue(REDRAWIMAGE, 0);
|
allqueue(REDRAWIMAGE, 0);
|
||||||
|
@ -1971,7 +1971,7 @@ static void info_text(int x, int y)
|
|||||||
|
|
||||||
if (g_progress_bar) {
|
if (g_progress_bar) {
|
||||||
hsize = 4 + (138.0 * g_done);
|
hsize = 4 + (138.0 * g_done);
|
||||||
fac1 = 0.5 * g_done; // do some rainbow colours on progress
|
fac1 = 0.5 * g_done; /* do some rainbow colors on progress */
|
||||||
fac2 = 1.0;
|
fac2 = 1.0;
|
||||||
fac3 = 0.9;
|
fac3 = 0.9;
|
||||||
} else {
|
} else {
|
||||||
|
@ -552,7 +552,7 @@ static void do_view3d_viewmenu(void *arg, int event)
|
|||||||
view3d_home(0);
|
view3d_home(0);
|
||||||
break;
|
break;
|
||||||
case 11: /* View Selected */
|
case 11: /* View Selected */
|
||||||
centreview();
|
centerview();
|
||||||
break;
|
break;
|
||||||
case 13: /* Play Back Animation */
|
case 13: /* Play Back Animation */
|
||||||
play_anim(0);
|
play_anim(0);
|
||||||
@ -1681,13 +1681,13 @@ static void do_view3d_transformmenu(void *arg, int event)
|
|||||||
} else error("Only meshes can be shrinked/fattened");
|
} else error("Only meshes can be shrinked/fattened");
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
docentre(0);
|
docenter(0);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
docentre_new();
|
docenter_new();
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
docentre_cursor();
|
docenter_cursor();
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
initTransform(TFM_TILT, CTX_NONE);
|
initTransform(TFM_TILT, CTX_NONE);
|
||||||
|
@ -650,7 +650,7 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
|
|||||||
uiBut *bt;
|
uiBut *bt;
|
||||||
rctf butrct;
|
rctf butrct;
|
||||||
float aspect;
|
float aspect;
|
||||||
int xsize, ysize, xof=0, yof=0, centre;
|
int xsize, ysize, xof=0, yof=0, center;
|
||||||
short dir1= 0, dir2=0;
|
short dir1= 0, dir2=0;
|
||||||
|
|
||||||
/* first transform to screen coords, assuming matrix is stil OK */
|
/* first transform to screen coords, assuming matrix is stil OK */
|
||||||
@ -699,13 +699,13 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
|
|||||||
if(but) {
|
if(but) {
|
||||||
short left=0, right=0, top=0, down=0;
|
short left=0, right=0, top=0, down=0;
|
||||||
|
|
||||||
if(block->direction & UI_CENTRE) centre= ysize/2;
|
if(block->direction & UI_CENTER) center= ysize/2;
|
||||||
else centre= 0;
|
else center= 0;
|
||||||
|
|
||||||
if( butrct.xmin-xsize > 0.0) left= 1;
|
if( butrct.xmin-xsize > 0.0) left= 1;
|
||||||
if( butrct.xmax+xsize < G.curscreen->sizex) right= 1;
|
if( butrct.xmax+xsize < G.curscreen->sizex) right= 1;
|
||||||
if( butrct.ymin-ysize+centre > 0.0) down= 1;
|
if( butrct.ymin-ysize+center > 0.0) down= 1;
|
||||||
if( butrct.ymax+ysize-centre < G.curscreen->sizey) top= 1;
|
if( butrct.ymax+ysize-center < G.curscreen->sizey) top= 1;
|
||||||
|
|
||||||
dir1= block->direction & UI_DIRECTION;
|
dir1= block->direction & UI_DIRECTION;
|
||||||
|
|
||||||
@ -736,13 +736,13 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
|
|||||||
|
|
||||||
if(dir1==UI_LEFT) {
|
if(dir1==UI_LEFT) {
|
||||||
xof= butrct.xmin - block->maxx;
|
xof= butrct.xmin - block->maxx;
|
||||||
if(dir2==UI_TOP) yof= butrct.ymin - block->miny-centre;
|
if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
|
||||||
else yof= butrct.ymax - block->maxy+centre;
|
else yof= butrct.ymax - block->maxy+center;
|
||||||
}
|
}
|
||||||
else if(dir1==UI_RIGHT) {
|
else if(dir1==UI_RIGHT) {
|
||||||
xof= butrct.xmax - block->minx;
|
xof= butrct.xmax - block->minx;
|
||||||
if(dir2==UI_TOP) yof= butrct.ymin - block->miny-centre;
|
if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
|
||||||
else yof= butrct.ymax - block->maxy+centre;
|
else yof= butrct.ymax - block->maxy+center;
|
||||||
}
|
}
|
||||||
else if(dir1==UI_TOP) {
|
else if(dir1==UI_TOP) {
|
||||||
yof= butrct.ymax - block->miny;
|
yof= butrct.ymax - block->miny;
|
||||||
@ -3160,12 +3160,12 @@ static void do_palette_sample_cb(void *bt1, void *col1) /* frontbuf */
|
|||||||
|
|
||||||
if(x<0 || y<0) return;
|
if(x<0 || y<0) return;
|
||||||
|
|
||||||
/* if we've got a glick, use OpenGL to sample the colour under the mouse pointer */
|
/* if we've got a glick, use OpenGL to sample the color under the mouse pointer */
|
||||||
glReadBuffer(GL_FRONT);
|
glReadBuffer(GL_FRONT);
|
||||||
glReadPixels(x, y, 1, 1, GL_RGBA, GL_FLOAT, tempcol);
|
glReadPixels(x, y, 1, 1, GL_RGBA, GL_FLOAT, tempcol);
|
||||||
glReadBuffer(GL_BACK);
|
glReadBuffer(GL_BACK);
|
||||||
|
|
||||||
/* and send that colour back to the picker */
|
/* and send that color back to the picker */
|
||||||
rgb_to_hsv(tempcol[0], tempcol[1], tempcol[2], hsv, hsv+1, hsv+2);
|
rgb_to_hsv(tempcol[0], tempcol[1], tempcol[2], hsv, hsv+1, hsv+2);
|
||||||
update_picker_buts_hsv(but1->block, hsv, but1->poin);
|
update_picker_buts_hsv(but1->block, hsv, but1->poin);
|
||||||
update_picker_hex(but1->block, tempcol);
|
update_picker_hex(but1->block, tempcol);
|
||||||
@ -3228,7 +3228,7 @@ void uiBlockPickerButtons(uiBlock *block, float *col, float *hsv, float *old, ch
|
|||||||
uiButSetFunc(bt, do_palette_sample_cb, bt, col);
|
uiButSetFunc(bt, do_palette_sample_cb, bt, col);
|
||||||
uiButSetFlag(bt, UI_TEXT_LEFT);
|
uiButSetFlag(bt, UI_TEXT_LEFT);
|
||||||
|
|
||||||
bt= uiDefBut(block, TEX, retval, "Hex: ", offs, 140, 140, 20, hexcol, 0, 8, 0, 0, "Hex triplet for colour (#RRGGBB)");
|
bt= uiDefBut(block, TEX, retval, "Hex: ", offs, 140, 140, 20, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)");
|
||||||
uiButSetFunc(bt, do_palette_hex_cb, bt, hexcol);
|
uiButSetFunc(bt, do_palette_hex_cb, bt, hexcol);
|
||||||
|
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
@ -3565,7 +3565,7 @@ static int ui_do_but_NORMAL(uiBut *but)
|
|||||||
fp[2]= -sqrt( radsq-dx*dx-dy*dy );
|
fp[2]= -sqrt( radsq-dx*dx-dy*dy );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Normalise(fp);
|
Normalize(fp);
|
||||||
|
|
||||||
ui_draw_but(but);
|
ui_draw_but(but);
|
||||||
ui_block_flush_back(but->block);
|
ui_block_flush_back(but->block);
|
||||||
|
@ -602,7 +602,7 @@ static void ui_scale_panel_block(uiBlock *block)
|
|||||||
{
|
{
|
||||||
uiBut *but;
|
uiBut *but;
|
||||||
float facx= 1.0, facy= 1.0;
|
float facx= 1.0, facy= 1.0;
|
||||||
int centrex= 0, topy=0, tabsy=0;
|
int centerx= 0, topy=0, tabsy=0;
|
||||||
|
|
||||||
if(block->panel==NULL) return;
|
if(block->panel==NULL) return;
|
||||||
|
|
||||||
@ -613,7 +613,7 @@ static void ui_scale_panel_block(uiBlock *block)
|
|||||||
if( block->maxx-block->minx > block->panel->sizex - 2*PNL_SAFETY ) {
|
if( block->maxx-block->minx > block->panel->sizex - 2*PNL_SAFETY ) {
|
||||||
facx= (block->panel->sizex - (2*PNL_SAFETY))/( block->maxx-block->minx );
|
facx= (block->panel->sizex - (2*PNL_SAFETY))/( block->maxx-block->minx );
|
||||||
}
|
}
|
||||||
else centrex= (block->panel->sizex-( block->maxx-block->minx ) - 2*PNL_SAFETY)/2;
|
else centerx= (block->panel->sizex-( block->maxx-block->minx ) - 2*PNL_SAFETY)/2;
|
||||||
|
|
||||||
// tabsy= PNL_HEADER*panel_has_tabs(block->panel);
|
// tabsy= PNL_HEADER*panel_has_tabs(block->panel);
|
||||||
if( (block->maxy-block->miny) > block->panel->sizey - 2*PNL_SAFETY - tabsy) {
|
if( (block->maxy-block->miny) > block->panel->sizey - 2*PNL_SAFETY - tabsy) {
|
||||||
@ -623,9 +623,9 @@ static void ui_scale_panel_block(uiBlock *block)
|
|||||||
|
|
||||||
but= block->buttons.first;
|
but= block->buttons.first;
|
||||||
while(but) {
|
while(but) {
|
||||||
but->x1= PNL_SAFETY+centrex+ facx*(but->x1-block->minx);
|
but->x1= PNL_SAFETY+centerx+ facx*(but->x1-block->minx);
|
||||||
but->y1= PNL_SAFETY+topy + facy*(but->y1-block->miny);
|
but->y1= PNL_SAFETY+topy + facy*(but->y1-block->miny);
|
||||||
but->x2= PNL_SAFETY+centrex+ facx*(but->x2-block->minx);
|
but->x2= PNL_SAFETY+centerx+ facx*(but->x2-block->minx);
|
||||||
but->y2= PNL_SAFETY+topy + facy*(but->y2-block->miny);
|
but->y2= PNL_SAFETY+topy + facy*(but->y2-block->miny);
|
||||||
if(facx!=1.0) ui_check_but(but); /* for strlen */
|
if(facx!=1.0) ui_check_but(but); /* for strlen */
|
||||||
but= but->next;
|
but= but->next;
|
||||||
|
@ -145,8 +145,8 @@ static float p_vec_angle_cos(float *v1, float *v2, float *v3)
|
|||||||
d2[1] = v3[1] - v2[1];
|
d2[1] = v3[1] - v2[1];
|
||||||
d2[2] = v3[2] - v2[2];
|
d2[2] = v3[2] - v2[2];
|
||||||
|
|
||||||
Normalise(d1);
|
Normalize(d1);
|
||||||
Normalise(d2);
|
Normalize(d2);
|
||||||
|
|
||||||
return d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2];
|
return d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2];
|
||||||
}
|
}
|
||||||
|
@ -475,13 +475,13 @@ vec3f calc_area_normal(const vec3f *outdir, const ListBase* active_verts)
|
|||||||
area_normal.z+= me->mvert[node->Index].no[2];
|
area_normal.z+= me->mvert[node->Index].no[2];
|
||||||
node= node->next;
|
node= node->next;
|
||||||
}
|
}
|
||||||
Normalise(&area_normal.x);
|
Normalize(&area_normal.x);
|
||||||
if(outdir) {
|
if(outdir) {
|
||||||
area_normal.x= outdir->x * view + area_normal.x * (10-view);
|
area_normal.x= outdir->x * view + area_normal.x * (10-view);
|
||||||
area_normal.y= outdir->y * view + area_normal.y * (10-view);
|
area_normal.y= outdir->y * view + area_normal.y * (10-view);
|
||||||
area_normal.z= outdir->z * view + area_normal.z * (10-view);
|
area_normal.z= outdir->z * view + area_normal.z * (10-view);
|
||||||
}
|
}
|
||||||
Normalise(&area_normal.x);
|
Normalize(&area_normal.x);
|
||||||
return area_normal;
|
return area_normal;
|
||||||
}
|
}
|
||||||
void do_draw_brush(const EditData *e, const ListBase* active_verts)
|
void do_draw_brush(const EditData *e, const ListBase* active_verts)
|
||||||
@ -1059,7 +1059,7 @@ void update_damaged_vert(Mesh *me, ListBase *lb)
|
|||||||
add_face_normal(&norm,&me->mface[face->Index]);
|
add_face_normal(&norm,&me->mface[face->Index]);
|
||||||
face= face->next;
|
face= face->next;
|
||||||
}
|
}
|
||||||
Normalise(&norm.x);
|
Normalize(&norm.x);
|
||||||
|
|
||||||
me->mvert[vert->Index].no[0]=norm.x*32767;
|
me->mvert[vert->Index].no[0]=norm.x*32767;
|
||||||
me->mvert[vert->Index].no[1]=norm.y*32767;
|
me->mvert[vert->Index].no[1]=norm.y*32767;
|
||||||
@ -1169,9 +1169,9 @@ void init_editdata(SculptData *sd, EditData *e, short *mouse, short *pr_mouse, c
|
|||||||
VecSubf(&e->up.x, &e->up.x, &zero_loc.x);
|
VecSubf(&e->up.x, &e->up.x, &zero_loc.x);
|
||||||
VecSubf(&e->right.x, &e->right.x, &zero_loc.x);
|
VecSubf(&e->right.x, &e->right.x, &zero_loc.x);
|
||||||
VecSubf(&e->out.x, &e->out.x, &zero_loc.x);
|
VecSubf(&e->out.x, &e->out.x, &zero_loc.x);
|
||||||
Normalise(&e->up.x);
|
Normalize(&e->up.x);
|
||||||
Normalise(&e->right.x);
|
Normalize(&e->right.x);
|
||||||
Normalise(&e->out.x);
|
Normalize(&e->out.x);
|
||||||
|
|
||||||
/* Initialize mirror modifier clipping */
|
/* Initialize mirror modifier clipping */
|
||||||
for(i=0; i<3; ++i) {
|
for(i=0; i<3; ++i) {
|
||||||
|
@ -795,9 +795,9 @@ static float gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
|
|||||||
static float gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
static float gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
||||||
static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
|
static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
|
||||||
static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE];
|
||||||
static float colour_domain_table[RE_GAMMA_TABLE_SIZE + 1];
|
static float color_domain_table[RE_GAMMA_TABLE_SIZE + 1];
|
||||||
static float colour_step;
|
static float color_step;
|
||||||
static float inv_colour_step;
|
static float inv_color_step;
|
||||||
static float valid_gamma;
|
static float valid_gamma;
|
||||||
static float valid_inv_gamma;
|
static float valid_inv_gamma;
|
||||||
|
|
||||||
@ -808,15 +808,15 @@ static void makeGammaTables(float gamma)
|
|||||||
|
|
||||||
valid_gamma = gamma;
|
valid_gamma = gamma;
|
||||||
valid_inv_gamma = 1.0 / gamma;
|
valid_inv_gamma = 1.0 / gamma;
|
||||||
colour_step = 1.0 / RE_GAMMA_TABLE_SIZE;
|
color_step = 1.0 / RE_GAMMA_TABLE_SIZE;
|
||||||
inv_colour_step = (float) RE_GAMMA_TABLE_SIZE;
|
inv_color_step = (float) RE_GAMMA_TABLE_SIZE;
|
||||||
|
|
||||||
/* We could squeeze out the two range tables to gain some memory. */
|
/* We could squeeze out the two range tables to gain some memory. */
|
||||||
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) {
|
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) {
|
||||||
colour_domain_table[i] = i * colour_step;
|
color_domain_table[i] = i * color_step;
|
||||||
gamma_range_table[i] = pow(colour_domain_table[i],
|
gamma_range_table[i] = pow(color_domain_table[i],
|
||||||
valid_gamma);
|
valid_gamma);
|
||||||
inv_gamma_range_table[i] = pow(colour_domain_table[i],
|
inv_gamma_range_table[i] = pow(color_domain_table[i],
|
||||||
valid_inv_gamma);
|
valid_inv_gamma);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -824,16 +824,16 @@ static void makeGammaTables(float gamma)
|
|||||||
/* rounding errors, we just set this explicitly. The last segment may */
|
/* rounding errors, we just set this explicitly. The last segment may */
|
||||||
/* have a different lenght than the other segments, but our */
|
/* have a different lenght than the other segments, but our */
|
||||||
/* interpolation is insensitive to that. */
|
/* interpolation is insensitive to that. */
|
||||||
colour_domain_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
color_domain_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
||||||
gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
||||||
inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
|
||||||
|
|
||||||
/* To speed up calculations, we make these calc factor tables. They are */
|
/* To speed up calculations, we make these calc factor tables. They are */
|
||||||
/* multiplication factors used in scaling the interpolation. */
|
/* multiplication factors used in scaling the interpolation. */
|
||||||
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) {
|
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++ ) {
|
||||||
gamfactor_table[i] = inv_colour_step
|
gamfactor_table[i] = inv_color_step
|
||||||
* (gamma_range_table[i + 1] - gamma_range_table[i]) ;
|
* (gamma_range_table[i + 1] - gamma_range_table[i]) ;
|
||||||
inv_gamfactor_table[i] = inv_colour_step
|
inv_gamfactor_table[i] = inv_color_step
|
||||||
* (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ;
|
* (inv_gamma_range_table[i + 1] - inv_gamma_range_table[i]) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -845,15 +845,15 @@ static float gammaCorrect(float c)
|
|||||||
int i;
|
int i;
|
||||||
float res = 0.0;
|
float res = 0.0;
|
||||||
|
|
||||||
i = floor(c * inv_colour_step);
|
i = floor(c * inv_color_step);
|
||||||
/* Clip to range [0,1]: outside, just do the complete calculation. */
|
/* Clip to range [0,1]: outside, just do the complete calculation. */
|
||||||
/* We may have some performance problems here. Stretching up the LUT */
|
/* We may have some performance problems here. Stretching up the LUT */
|
||||||
/* may help solve that, by exchanging LUT size for the interpolation. */
|
/* may help solve that, by exchanging LUT size for the interpolation. */
|
||||||
/* Negative colours are explicitly handled. */
|
/* Negative colors are explicitly handled. */
|
||||||
if (i < 0) res = -pow(abs(c), valid_gamma);
|
if (i < 0) res = -pow(abs(c), valid_gamma);
|
||||||
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
|
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
|
||||||
else res = gamma_range_table[i] +
|
else res = gamma_range_table[i] +
|
||||||
( (c - colour_domain_table[i]) * gamfactor_table[i]);
|
( (c - color_domain_table[i]) * gamfactor_table[i]);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
} /* end of float gammaCorrect(float col) */
|
} /* end of float gammaCorrect(float col) */
|
||||||
@ -865,12 +865,12 @@ static float invGammaCorrect(float col)
|
|||||||
int i;
|
int i;
|
||||||
float res = 0.0;
|
float res = 0.0;
|
||||||
|
|
||||||
i = floor(col*inv_colour_step);
|
i = floor(col*inv_color_step);
|
||||||
/* Negative colours are explicitly handled. */
|
/* Negative colors are explicitly handled. */
|
||||||
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
|
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
|
||||||
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
|
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
|
||||||
else res = inv_gamma_range_table[i] +
|
else res = inv_gamma_range_table[i] +
|
||||||
( (col - colour_domain_table[i]) * inv_gamfactor_table[i]);
|
( (col - color_domain_table[i]) * inv_gamfactor_table[i]);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
} /* end of float invGammaCorrect(float col) */
|
} /* end of float invGammaCorrect(float col) */
|
||||||
|
@ -2355,7 +2355,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
} else if(G.qual==LR_SHIFTKEY) {
|
} else if(G.qual==LR_SHIFTKEY) {
|
||||||
G.vd->around= V3D_CENTROID;
|
G.vd->around= V3D_CENTROID;
|
||||||
} else if(G.qual==0) {
|
} else if(G.qual==0) {
|
||||||
G.vd->around= V3D_CENTRE;
|
G.vd->around= V3D_CENTER;
|
||||||
}
|
}
|
||||||
handle_view3d_around();
|
handle_view3d_around();
|
||||||
|
|
||||||
@ -2410,7 +2410,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
break;
|
break;
|
||||||
case PADPERIOD: /* '.' */
|
case PADPERIOD: /* '.' */
|
||||||
if(G.qual==0)
|
if(G.qual==0)
|
||||||
centreview();
|
centerview();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PAGEUPKEY:
|
case PAGEUPKEY:
|
||||||
@ -3087,7 +3087,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
|
|||||||
y6label = y6-2;
|
y6label = y6-2;
|
||||||
|
|
||||||
|
|
||||||
/* set the colour to blue and draw the main 'tab' controls */
|
/* set the color to blue and draw the main 'tab' controls */
|
||||||
|
|
||||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
@ -4792,7 +4792,7 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
break;
|
break;
|
||||||
case PADPERIOD:
|
case PADPERIOD:
|
||||||
if(G.qual==0)
|
if(G.qual==0)
|
||||||
image_viewcentre();
|
image_viewcenter();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ void persptoetsen(unsigned short event)
|
|||||||
/* horizontal axis */
|
/* horizontal axis */
|
||||||
VECCOPY(q1+1, G.vd->viewinv[0]);
|
VECCOPY(q1+1, G.vd->viewinv[0]);
|
||||||
|
|
||||||
Normalise(q1+1);
|
Normalize(q1+1);
|
||||||
phi= (float)(M_PI/360.0)*U.pad_rot_angle;
|
phi= (float)(M_PI/360.0)*U.pad_rot_angle;
|
||||||
if(event==PAD2) phi= -phi;
|
if(event==PAD2) phi= -phi;
|
||||||
si= (float)sin(phi);
|
si= (float)sin(phi);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user