}
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
- // projected bounding box centre.
+ // projected bounding box center.
GHOST_Rect bounds;
m_window->getClientBounds(bounds);
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;
float depth = diag.length();
glMatrixMode(GL_MODELVIEW);
gluLookAt(
- centre.x(), centre.y(), centre.z() + distance*depth, //eye
- centre.x(), centre.y(), centre.z(), //centre
+ center.x(), center.y(), center.z() + distance*depth, //eye
+ center.x(), center.y(), center.z(), //center
0.0, 1.0, 0.
); /* up is in positive Y direction */
}
}
- // 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?
if (mid == 0 || mid == n)
{
/* Setup the view of the cube. */
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;
float depth = diag.length();
gluLookAt(
- centre.x(), centre.y(), centre.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() + distance*depth, /* eye is at (0,0,5) */
+ center.x(), center.y(), center.z(), /* center is at (0,0,0) */
0.0, 1.0, 0.); /* up is in positive Y direction */
glPushMatrix();
struct EditMesh;
void free_editMesh(struct EditMesh *);
void free_editArmature(void);
-void docentre_new(void);
+void docenter_new(void);
int saveover(char *str);
/* image.c */
void load_editMesh(void){}
void make_editMesh(void){}
void free_editMesh(struct EditMesh *em){}
-void docentre_new(void){}
+void docenter_new(void){}
int saveover(char *str){ return 0;}
/* image.c */
float *no = emdm->vertexNos[i];
/* following Mesh convention; we use vertex coordinate itself
* for normal in this case */
- if (Normalise(no)==0.0) {
+ if (Normalize(no)==0.0) {
VECCOPY(no, vertexCos[i]);
- Normalise(no);
+ Normalize(no);
}
}
}
EulToMat3(ob->rot, rotmat);
for(i=0; i<wri;i++) {
VECCOPY(vec, mvert[i].no);
- Normalise(vec);
+ Normalize(vec);
if(useGlobalCoords) { Mat3MulVecfl(rotmat, vec); }
for(j=0; j<3; j++) {
wrf = vec[j];
Mat4MulVecfl(imat, h1);
/* if previous bone is B-bone too, use average handle direction */
if(prev->bone->segments>1) h1[1]-= length;
- Normalise(h1);
+ Normalize(h1);
VecMulf(h1, -hlength1);
}
else {
roll= atan2(mat3[2][0], mat3[2][2]);
/* and only now negate handle */
- Normalise(h2);
+ Normalize(h2);
VecMulf(h2, -hlength2);
}
float hsqr, a, l, rad;
VecSubf (bdelta, b2, b1);
- l = Normalise (bdelta);
+ l = Normalize (bdelta);
VecSubf (pdelta, vec, b1);
float rMatrix[3][3], bMatrix[3][3];
VECCOPY (nor, vec);
- Normalise (nor);
+ Normalize (nor);
/* Find Axis & Amount for bone matrix*/
Crossf (axis,target,nor);
if (Inpf(axis,axis) > 0.0000000000001) {
/* if nor is *not* a multiple of target ... */
- Normalise (axis);
+ Normalize (axis);
theta= NormalizedVecAngle2(target, nor);
/* setup starting time, direction vector and accumulated time */
starttime= painter->accumtime;
Vec2Subf(dmousepos, pos, painter->lastmousepos);
- len= Normalise2(dmousepos);
+ len= Normalize2(dmousepos);
painter->accumtime += curtime - painter->lasttime;
/* do paint op over unpainted time distance */
/* setup starting distance, direction vector and accumulated distance */
startdistance= painter->accumdistance;
Vec2Subf(dmousepos, pos, painter->lastmousepos);
- len= Normalise2(dmousepos);
+ len= Normalize2(dmousepos);
painter->accumdistance += len;
/* do paint op over unpainted distance */
for(i = 0; i < numVerts; i++, mv++) {
float *no = temp_nors[i];
- if (Normalise(no) == 0.0) {
+ if (Normalize(no) == 0.0) {
VECCOPY(no, mv->co);
- Normalise(no);
+ Normalize(no);
}
mv->no[0] = (short)(no[0] * 32767.0);
int right_index;
VecCopyf(n, vec);
- if(Normalise(n) == 0.0) {
+ if(Normalize(n) == 0.0) {
n[0] = 0.0;
n[1] = 0.0;
n[2] = 1.0;
VecSubf(proj, u, proj); /* then onto the plane */
/* 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[1] = 1.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);
- Normalise(right);
+ Normalize(right);
if(axis != upflag) {
right_index = 3 - axis - upflag;
if(data->followflag){
quat= vectoquat(dir, (short) data->trackflag, (short) data->upflag);
- Normalise(dir);
+ Normalize(dir);
q[0]= (float)cos(0.5*vec[3]);
x1= (float)sin(0.5*vec[3]);
q[1]= -x1*dir[0];
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[0]);
VecSubf(totmat[1], vec, vec2);
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
/* the x axis is fixed*/
totmat[0][0] = ob->obmat[0][0];
totmat[0][1] = ob->obmat[0][1];
totmat[0][2] = ob->obmat[0][2];
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[0]);
VecSubf(totmat[2], vec, vec2);
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
/* the x axis is fixed*/
totmat[0][0] = ob->obmat[0][0];
totmat[0][1] = ob->obmat[0][1];
totmat[0][2] = ob->obmat[0][2];
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[0]);
VecSubf(totmat[1], vec, vec2);
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
VecMulf(totmat[1],-1);
/* the x axis is fixed*/
totmat[0][0] = ob->obmat[0][0];
totmat[0][1] = ob->obmat[0][1];
totmat[0][2] = ob->obmat[0][2];
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[0]);
VecSubf(totmat[2], vec, vec2);
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
VecMulf(totmat[2],-1);
/* the x axis is fixed*/
totmat[0][0] = ob->obmat[0][0];
totmat[0][1] = ob->obmat[0][1];
totmat[0][2] = ob->obmat[0][2];
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[1]);
VecSubf(totmat[0], vec, vec2);
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
/* the y axis is fixed*/
totmat[1][0] = ob->obmat[1][0];
totmat[1][1] = ob->obmat[1][1];
totmat[1][2] = ob->obmat[1][2];
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[1]);
VecSubf(totmat[2], vec, vec2);
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
/* the y axis is fixed*/
totmat[1][0] = ob->obmat[1][0];
totmat[1][1] = ob->obmat[1][1];
totmat[1][2] = ob->obmat[1][2];
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[1]);
VecSubf(totmat[0], vec, vec2);
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
VecMulf(totmat[0],-1);
/* the y axis is fixed*/
totmat[1][0] = ob->obmat[1][0];
totmat[1][1] = ob->obmat[1][1];
totmat[1][2] = ob->obmat[1][2];
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[1]);
VecSubf(totmat[2], vec, vec2);
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
VecMulf(totmat[2],-1);
/* the y axis is fixed*/
totmat[1][0] = ob->obmat[1][0];
totmat[1][1] = ob->obmat[1][1];
totmat[1][2] = ob->obmat[1][2];
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
/* the z axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[2]);
VecSubf(totmat[0], vec, vec2);
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
/* the z axis is fixed*/
totmat[2][0] = ob->obmat[2][0];
totmat[2][1] = ob->obmat[2][1];
totmat[2][2] = ob->obmat[2][2];
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
/* the x axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[2]);
VecSubf(totmat[1], vec, vec2);
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
/* the z axis is fixed*/
totmat[2][0] = ob->obmat[2][0];
totmat[2][1] = ob->obmat[2][1];
totmat[2][2] = ob->obmat[2][2];
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
/* the x axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[2]);
VecSubf(totmat[0], vec, vec2);
- Normalise(totmat[0]);
+ Normalize(totmat[0]);
VecMulf(totmat[0],-1);
/* the z axis is fixed*/
totmat[2][0] = ob->obmat[2][0];
totmat[2][1] = ob->obmat[2][1];
totmat[2][2] = ob->obmat[2][2];
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
/* the x axis gets mapped onto
a third orthogonal vector */
/* Projection of Vector on the plane */
Projf(vec2, vec, ob->obmat[2]);
VecSubf(totmat[1], vec, vec2);
- Normalise(totmat[1]);
+ Normalize(totmat[1]);
VecMulf(totmat[1],-1);
/* the z axis is fixed*/
totmat[2][0] = ob->obmat[2][0];
totmat[2][1] = ob->obmat[2][1];
totmat[2][2] = ob->obmat[2][2];
- Normalise(totmat[2]);
+ Normalize(totmat[2]);
/* the x axis gets mapped onto
a third orthogonal vector */
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[2][0] = ob->obmat[2][0];tmpmat[2][1] = ob->obmat[2][1];tmpmat[2][2] = ob->obmat[2][2];
- Normalise(tmpmat[0]);
- Normalise(tmpmat[1]);
- Normalise(tmpmat[2]);
+ Normalize(tmpmat[0]);
+ Normalize(tmpmat[1]);
+ Normalize(tmpmat[2]);
Mat3Inv(invmat,tmpmat);
Mat3MulMat3(tmpmat,totmat,invmat);
totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2];
xx[0] = ob->obmat[0][0];
xx[1] = ob->obmat[0][1];
xx[2] = ob->obmat[0][2];
- Normalise(xx);
+ Normalize(xx);
/* store Z orientation before destroying obmat */
zz[0] = ob->obmat[2][0];
zz[1] = ob->obmat[2][1];
zz[2] = ob->obmat[2][2];
- Normalise(zz);
+ Normalize(zz);
VecSubf(vec, ob->obmat[3], targetmat[3]);
vec[0] /= size[0];
vec[1] /= size[1];
vec[2] /= size[2];
- dist = Normalise(vec);
+ dist = Normalize(vec);
//dist = VecLenf( ob->obmat[3], targetmat[3]);
if (data->orglength == 0) data->orglength = dist;
ob->obmat[2][2]=size[2]*scale[2];
VecSubf(vec, ob->obmat[3], targetmat[3]);
- Normalise(vec);
+ Normalize(vec);
/* new Y aligns object target connection*/
totmat[1][0] = -vec[0];
totmat[1][1] = -vec[1];
/* build new Z vector */
/* othogonal to "new Y" "old X! plane */
Crossf(orth, vec, xx);
- Normalise(orth);
+ Normalize(orth);
/* new Z*/
totmat[2][0] = orth[0];
/* we decided to keep X plane*/
Crossf(xx,orth, vec);
- Normalise(xx);
+ Normalize(xx);
totmat[0][0] = xx[0];
totmat[0][1] = xx[1];
totmat[0][2] = xx[2];
/* build new X vector */
/* othogonal to "new Y" "old Z! plane */
Crossf(orth, vec, zz);
- Normalise(orth);
+ Normalize(orth);
/* new X*/
totmat[0][0] = -orth[0];
/* we decided to keep Z */
Crossf(zz,orth, vec);
- Normalise(zz);
+ Normalize(zz);
totmat[2][0] = zz[0];
totmat[2][1] = zz[1];
totmat[2][2] = zz[2];
quat= vectoquat(vec, 5, 1);
- Normalise(vec);
+ Normalize(vec);
q[0]= (float)cos(0.5*bevp1->alfa);
x1= (float)sin(0.5*bevp1->alfa);
q[1]= x1*vec[0];
vec[1]= bevp2->y - bevp0->y;
vec[2]= bevp2->z - bevp0->z;
- Normalise(vec);
+ Normalize(vec);
quat= vectoquat(vec, 5, 1);
VecSubf(h1, p2-3, p2);
VecSubf(h2, p2, p2+3);
- len1= Normalise(h1);
- len2= Normalise(h2);
+ len1= Normalize(h1);
+ len2= Normalize(h2);
vz= INPR(h1, h2);
a= dl->parts*dl->nr;
v1= ndata;
while(a--) {
- Normalise(v1);
+ Normalize(v1);
v1+= 3;
}
}
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[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
- Normalise(vn);
+ Normalize(vn);
}
for (i=0; i<totface; i++) {
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[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++) {
MVert *mv= &mvert[vidx[j]];
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[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;
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[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);
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[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);
distance = VecLength(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 */
/* the force is not too big */
VECSUB(edge1, dv1, dv2);
VECSUB(edge2, dv3, dv2);
Crossf(d_nvect, edge2, edge1);
- n_mag = Normalise(d_nvect);
+ n_mag = Normalize(d_nvect);
dk_plane = INPR(d_nvect, nv1);
dk_point1 = INPR(d_nvect,opco);
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[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);
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*/
time_before = (life*(first_dist / (mag_iv)));
VECCOPY(vec, no);
Mat3MulVecfl(mcnow->imat, vec);
- Normalise(vec);
+ Normalize(vec);
VecMulf(vec, paf->normfac);
VECADD(pa->no, pa->no, vec);
}
else {
if(paf->normfac!=0.0) {
VECCOPY(pa->no, no);
- Normalise(pa->no);
+ Normalize(pa->no);
VecMulf(pa->no, paf->normfac);
}
}
/* irst this: is still active */
if(ivsurf) {
where_is_object(ivsurf);
- docentre_new();
+ docenter_new();
}
dl= lbase->first;
x = a * sin(phi);
y = b * cos(phi);
-#ifndef DEBUG_CENTRE
+#ifndef DEBUG_CENTER
epoint[0] = center[0] + x*cos(theta) - y*sin(theta);
epoint[1] = center[1] + x*sin(theta) + y*cos(theta);
epoint[2] = center[2];
Mat3CpyMat4(cmat, cu->textoncurve->obmat);
Mat3MulMat3(cmat, cmat, imat3);
- sizefac= Normalise(cmat[0])/cu->fsize;
+ sizefac= Normalize(cmat[0])/cu->fsize;
minx=miny= 1.0e20f;
maxx=maxy= -1.0e20f;
ct= chartransdata;
for (i=0; i<=slen; i++, ct++) {
- /* rotate around centre character */
+ /* rotate around center character */
ascii = mem[i];
// Find the character
}
}
- /* 2nd pass, coloured + */
+ /* 2nd pass, colored + */
rect= (unsigned char*)ibuf->rect;
for(y=0; y<ibuf->y; y++) {
/* the tilt */
if(loc[3]!=0.0) {
- Normalise(dir);
+ Normalize(dir);
q[0]= (float)cos(0.5*loc[3]);
fac= (float)sin(0.5*loc[3]);
q[1]= -fac*dir[0];
MVert *mv= &mverts[i];
float *no= tnorms[i];
- if (Normalise(no)==0.0) {
+ if (Normalize(no)==0.0) {
VECCOPY(no, mv->co);
- Normalise(no);
+ Normalize(no);
}
mv->no[0]= (short)(no[0]*32767.0);
quat= vectoquat(dir, ob->trackflag, ob->upflag);
/* the tilt */
- Normalise(dir);
+ Normalize(dir);
q[0]= (float)cos(0.5*vec[3]);
x1= (float)sin(0.5*vec[3]);
q[1]= -x1*dir[0];
VECSUB(edge1, nv1, nv2);
VECSUB(edge2, nv3, nv2);
Crossf(d_nvect, edge2, edge1);
- Normalise(d_nvect);
+ Normalize(d_nvect);
if (
LineIntersectsTriangle(nv1, nv2, face_v1, face_v2, face_v3, &t) ||
LineIntersectsTriangle(nv2, nv3, face_v1, face_v2, face_v3, &t) ||
VECSUB(edge1, nv3, nv4);
VECSUB(edge2, nv1, nv4);
Crossf(d_nvect, edge2, edge1);
- Normalise(d_nvect);
+ Normalize(d_nvect);
if (
LineIntersectsTriangle(nv1, nv3, face_v1, face_v2, face_v3, &t) ||
LineIntersectsTriangle(nv3, nv4, face_v1, face_v2, face_v3, &t) ||
VECSUB(edge2, nv3, nv2);
Crossf(d_nvect, edge2, edge1);
- Normalise(d_nvect);
+ Normalize(d_nvect);
if ( LineIntersectsTriangle(edge_v1, edge_v2, nv1, nv2, nv3, &t)){
float v1[3],v2[3];
float intrusiondepth,i1,i2;
VECSUB(edge2, nv1, nv4);
Crossf(d_nvect, edge2, edge1);
- Normalise(d_nvect);
+ Normalize(d_nvect);
if (LineIntersectsTriangle( edge_v1, edge_v2,nv1, nv3, nv4, &t)){
float v1[3],v2[3];
float intrusiondepth,i1,i2;
else{
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;
/* todo add a nice angle dependant function */
/* look up one at bergman scheafer */
VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
Projf(pr,vel,sp);
VECSUB(vel,vel,pr);
- Normalise(vel);
+ Normalize(vel);
Vec3PlusStVec(bs->ext_force,f,vel);
}
/* --- springs seeing wind */
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
Crossf(d_nvect, edge2, edge1);
- n_mag = Normalise(d_nvect);
+ n_mag = Normalize(d_nvect);
facedist = Inpf(dv1,d_nvect);
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
Crossf(d_nvect, edge2, edge1);
- n_mag = Normalise(d_nvect);
+ n_mag = Normalize(d_nvect);
facedist = Inpf(dv1,d_nvect);
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
if (ci) *intrusion /= ci;
if (deflected){
VECCOPY(facenormal,force);
- Normalise(facenormal);
+ Normalize(facenormal);
}
return deflected;
}
VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
Crossf(d_nvect, edge2, edge1);
- n_mag = Normalise(d_nvect);
+ n_mag = Normalize(d_nvect);
facedist = Inpf(dv1,d_nvect);
if ((facedist > closestinside) && (facedist < outerfacethickness)){
VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
Crossf(d_nvect, edge2, edge1);
- n_mag = Normalise(d_nvect);
+ n_mag = Normalize(d_nvect);
facedist = Inpf(dv1,d_nvect);
if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
*/
if (deflected ==1){
VECCOPY(facenormal,force);
- Normalise(facenormal);
+ Normalize(facenormal);
}
else{
facenormal[0] = facenormal[1] = facenormal[2] = 0.0f;
/* 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;
- distance = Normalise(def);
+ distance = Normalize(def);
if (distance < compare ){
/* exclude body points attached with a spring */
attached = 0;
if (( (sb->totpoint-a) == bs->v1) ){
actspringlen= VecLenf( (bproot+bs->v2)->pos, bp->pos);
VecSubf(sd,(bproot+bs->v2)->pos, bp->pos);
- Normalise(sd);
+ Normalize(sd);
/* friction stuff V1 */
VecSubf(velgoal,bp->vec,(bproot+bs->v2)->vec);
kd = sb->infrict * sb_fric_force_scale(ob);
- absvel = Normalise(velgoal);
+ absvel = Normalize(velgoal);
projvel = ABS(Inpf(sd,velgoal));
kd *= absvel * projvel;
Vec3PlusStVec(bp->force,-kd,velgoal);
if (( (sb->totpoint-a) == bs->v2) ){
actspringlen= VecLenf( (bproot+bs->v1)->pos, bp->pos);
VecSubf(sd,bp->pos,(bproot+bs->v1)->pos);
- Normalise(sd);
+ Normalize(sd);
/* friction stuff V2 */
VecSubf(velgoal,bp->vec,(bproot+bs->v1)->vec);
kd = sb->infrict * sb_fric_force_scale(ob);
- absvel = Normalise(velgoal);
+ absvel = Normalize(velgoal);
projvel = ABS(Inpf(sd,velgoal));
kd *= absvel * projvel;
Vec3PlusStVec(bp->force,-kd,velgoal);
vface = vface->next;
}
- /* we have to normalise all vertex normals */
+ /* we have to normalize all vertex normals */
vvert = vert_layer->dl.lb.first;
while(vvert) {
- Normalise(vvert->no);
+ Normalize(vvert->no);
vvert = vvert->next;
}
}
float fac
);
float
-Normalise(
+Normalize(
float *n
);
float
float *v2
);
float
-Normalise2(
+Normalize2(
float *n
);
/**
* 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_diff3DFF(double v1[3], float v2[3], float 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 */
return (float)sqrt(fac);
}
-float Normalise(float *n)
+float Normalize(float *n)
{
float d;
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) {
d= (float)sqrt(d);
nor[0] = mat[2][1]; /* cross product with (0,0,1) */
nor[1] = -mat[2][0];
nor[2] = 0.0;
- Normalise(nor);
+ Normalize(nor);
co= mat[2][2];
angle= 0.5f*saacos(co);
}
co/= len1;
- Normalise(nor);
+ Normalize(nor);
angle= 0.5f*saacos(co);
si= (float)sin(angle);
mat[coz][0]= vec[0];
mat[coz][1]= vec[1];
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];
mat[coy][0]= up[0] - inp*mat[coz][0];
mat[coy][1]= up[1] - inp*mat[coz][1];
mat[coy][2]= up[2] - inp*mat[coz][2];
- Normalise((float *)mat[coy]);
+ Normalize((float *)mat[coy]);
Crossf(mat[cox], mat[coy], mat[coz]);
mat[coz][0]= vec[0];
mat[coz][1]= vec[1];
mat[coz][2]= vec[2];
- Normalise((float *)mat[coz]);
+ Normalize((float *)mat[coz]);
inp= mat[coz][2];
mat[coy][0]= - inp*mat[coz][0];
mat[coy][1]= - inp*mat[coz][1];
mat[coy][2]= 1.0f - inp*mat[coz][2];
- Normalise((float *)mat[coy]);
+ Normalize((float *)mat[coy]);
Crossf(mat[cox], mat[coy], mat[coz]);
void Mat3Ortho(float mat[][3])
{
- Normalise(mat[0]);
- Normalise(mat[1]);
- Normalise(mat[2]);
+ Normalize(mat[0]);
+ Normalize(mat[1]);
+ Normalize(mat[2]);
}
void Mat4Ortho(float mat[][4])
{
float len;
- len= Normalise(mat[0]);
+ len= Normalize(mat[0]);
if(len!=0.0) mat[0][3]/= len;
- len= Normalise(mat[1]);
+ len= Normalize(mat[1]);
if(len!=0.0) mat[1][3]/= len;
- len= Normalise(mat[2]);
+ len= Normalize(mat[2]);
if(len!=0.0) mat[2][3]/= len;
}
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
- Normalise(n);
+ Normalize(n);
}
void CalcNormLong( int* v1, int*v2, int*v3, float *n)
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
- Normalise(n);
+ Normalize(n);
}
float CalcNormFloat( float *v1, float *v2, float *v3, float *n)
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
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)
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
- return Normalise(n);
+ return Normalize(n);
}
VecSubf(vec1, v2, v1);
VecSubf(vec2, v4, v1);
Crossf(n, vec1, vec2);
- len= Normalise(n);
+ len= Normalize(n);
VecSubf(vec1, v4, v3);
VecSubf(vec2, v2, v3);
Crossf(n, vec1, vec2);
- len+= Normalise(n);
+ len+= Normalize(n);
return (len/2.0f);
}
VecSubf(vec1, v3, v2);
VecSubf(vec2, v1, v2);
Crossf(n, vec1, vec2);
- len= Normalise(n);
+ len= Normalize(n);
return (len/2.0f);
}
quat[2]= vec[1];
quat[3]= vec[2];
- if( Normalise(quat+1) == 0.0) {
+ if( Normalize(quat+1) == 0.0) {
QuatOne(quat);
}
else {
VecSubf(vec1, v2, v1);
VecSubf(vec2, v2, v3);
- Normalise(vec1);
- Normalise(vec2);
+ Normalize(vec1);
+ Normalize(vec2);
return NormalizedVecAngle2(vec1, vec2) * 180.0/M_PI;
}
VecCopyf(vec1, v1);
VecCopyf(vec2, v2);
- Normalise(vec1);
- Normalise(vec2);
+ Normalize(vec1);
+ Normalize(vec2);
return NormalizedVecAngle2(vec1, vec2)* 180.0/M_PI;
}
float vec[3];
VecCopyf(vec, mat[0]);
- size[0]= Normalise(vec);
+ size[0]= Normalize(vec);
VecCopyf(vec, mat[1]);
- size[1]= Normalise(vec);
+ size[1]= Normalize(vec);
VecCopyf(vec, mat[2]);
- size[2]= Normalise(vec);
+ size[2]= Normalize(vec);
}
VecCopyf(vec, mat[0]);
- size[0]= Normalise(vec);
+ size[0]= Normalize(vec);
VecCopyf(vec, mat[1]);
- size[1]= Normalise(vec);
+ size[1]= Normalize(vec);
VecCopyf(vec, mat[2]);
- size[2]= Normalise(vec);
+ size[2]= Normalize(vec);
}
/* ************* SPECIALS ******************* */
n[0]= vec[1];
n[1]= -vec[0];
n[2]= 0.0;
- Normalise(n);
+ Normalize(n);
if(n[0]==0.0 && n[1]==0.0) n[0]= 1.0;
/* what angle has this line with x-axis? */
vec[2]= 0.0;
- Normalise(vec);
+ Normalize(vec);
angle= (float)(0.5*atan2(vec[1], vec[0]));
co= (float)cos(angle);
return v1[0]*v2[0]+v1[1]*v2[1];
}
-float Normalise2(float *n)
+float Normalize2(float *n)
{
float d;
{
float len;
- len= MTC_normalise3DF(mat[0]);
+ len= MTC_normalize3DF(mat[0]);
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;
- len= MTC_normalise3DF(mat[2]);
+ len= MTC_normalize3DF(mat[2]);
if(len!=0.0) mat[2][3]/= len;
}
}
/* ------------------------------------------------------------------------- */
-float MTC_normalise3DF(float n[3])
+float MTC_normalize3DF(float n[3])
{
float d;
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 */
if(d>0.0000000000001) {
void IMB_float_from_rect(struct ImBuf *ibuf);
/**
- * Change the ordering of the colour bytes pointed to by rect from
- * rgba to abgr. size * 4 colour bytes are reordered.
+ * Change the ordering of the color bytes pointed to by rect from
+ * rgba to abgr. size * 4 color bytes are reordered.
*
* @attention Defined in imageprocess.c
*/
void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf);
/**
- * Change the ordering of the colour bytes pointed to by rect from
- * rgba to abgr. size * 4 colour bytes are reordered.
+ * Change the ordering of the color bytes pointed to by rect from
+ * rgba to abgr. size * 4 color bytes are reordered.
*
* @attention Defined in imageprocess.c
*/
/**
* 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
*/
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
* with fixed coefficients, extracted from some book.
*
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 get_local_bounds(struct Object *ob, float *centre, float *size);
+void get_local_bounds(struct Object *ob, float *center, float *size);
/* drawing flags: */
#define DRAW_PICKING 1
void check_editmode(int type);
void enter_editmode(int wc);
-void docentre(int centremode);
-void docentre_new(void);
-void docentre_cursor(void);
+void docenter(int centermode);
+void docenter_new(void);
+void docenter_cursor(void);
void movetolayer(void);
void special_editmenu(void);
void convertmenu(void);
void image_home(void);
void image_viewmove(int mode);
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_noclip(float *vec, int *mval);
void what_image(struct SpaceImage *sima);
void addvert_armature(void);
void add_primitiveArmature(int type);
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);
/*
*
* 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!
* */
#define cpack(x) glColor3ub( ((x)&0xFF), (((x)>>8)&0xFF), (((x)>>16)&0xFF) )
#define UI_LEFT 4
#define UI_RIGHT 8
#define UI_DIRECTION 15
-#define UI_CENTRE 16
+#define UI_CENTER 16
#define UI_SHIFT_FLIPPED 32
/* uiBlock->autofill */
float *give_cursor(void);
unsigned int free_localbit(void);
void initlocalview(void);
-void centreview(void);
+void centerview(void);
void restore_localviewdata(struct View3D *vd);
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);
void view3d_align_axis_to_vector(struct View3D *v3d, int axisidx, float vec[3]);
#define B_SETSMOOTH 2012
#define B_SETSOLID 2013
#define B_AUTOTEX 2014
-#define B_DOCENTRE 2015
-#define B_DOCENTRENEW 2016
-#define B_DOCENTRECURSOR 2017
+#define B_DOCENTER 2015
+#define B_DOCENTERNEW 2016
+#define B_DOCENTERCURSOR 2017
/* 20 values! */
#define B_OBLAY 2019
float mtx[3][3]; /* 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 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 */
short imval[2]; /* initial mouse value for visual calculation */
/* the one in TransInfo is not garanty to stay the same (Rotates change it) */
float ctime; /* use for calcutions */
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;
short fullscreen, xplay, yplay, freqplay; /* standalone player */
struct RetopoViewData *retopo_view_data;
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,
/* View3D->around */
-#define V3D_CENTRE 0
+#define V3D_CENTER 0
#define V3D_CENTROID 3
#define V3D_CURSOR 1
#define V3D_LOCAL 2
/**
- * World defines general modelling data such as a background fill,
- * gravity, colour model, stars, etc. It mixes game-data, rendering
- * data and modelling data. */
+ * World defines general modeling data such as a background fill,
+ * gravity, color model, stars, etc. It mixes game-data, rendering
+ * data and modeling data. */
typedef struct World {
ID id;
VECCOPY(out[0]->vec, shi->co); /* get view vector */
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 */
}
}
/* retrieve normal */
if(in[MAT_IN_NORMAL]->hasinput) {
nodestack_get_vec(shi->vn, SOCK_VECTOR, in[MAT_IN_NORMAL]);
- Normalise(shi->vn);
+ Normalize(shi->vn);
}
else
VECCOPY(shi->vn, shi->vno);
out[0]->vec[1]= vec1[1] + vec2[1];
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 */
out[1]->vec[0]= (vec1[0] * vec2[0]) + (vec1[1] * vec2[1]) + (vec1[2] * 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[1]->vec[0] = Normalise( out[0]->vec );
+ out[1]->vec[0] = Normalize( out[0]->vec );
}
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. */
out[0]->vec[2]= vec2[2];
}
- out[1]->vec[0] = Normalise( out[0]->vec );
+ out[1]->vec[0] = Normalize( out[0]->vec );
}
}
VECCOPY(v3, vec3->vec);
VECCOPY(dir, ray->vec);
- Normalise(dir);
+ Normalize(dir);
VECCOPY(orig, ray_off->vec);
VecSubf(b, v4, v3);
VECCOPY(dir1, a);
- Normalise(dir1);
+ Normalize(dir1);
VECCOPY(dir2, b);
- Normalise(dir2);
+ Normalize(dir2);
d = Inpf(dir1, dir2);
if (d == 1.0f || d == -1.0f) {
/* colinear */
VecSubf(e2, v3, v2);
Crossf(n1, e2, e1);
- Normalise(n1);
+ Normalize(n1);
/* find vectors for two edges sharing v4 */
VecSubf(e1, v3, v4);
VecSubf(e2, v1, v4);
Crossf(n2, e2, e1);
- Normalise(n2);
+ Normalize(n2);
/* adding and averaging the normals of both triangles */
VecAddf(n1, n2, n1);
- Normalise(n1);
+ Normalize(n1);
return newVectorObject(n1, 3, Py_NEW);
}
VecSubf(e2, v3, v2);
Crossf(n, e2, e1);
- Normalise(n);
+ Normalize(n);
return newVectorObject(n, 3, Py_NEW);
}
for( i=0; i<3 ; ++i)
normal[i] = value->vec[i];
- Normalise(normal);
+ Normalize(normal);
for( i=0; i<3 ; ++i)
v->no[i] = (short)(normal[i]*32767.0);
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[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[1] = (short)(vec[1] * 32767.0);
mv->no[2] = (short)(vec[2] * 32767.0);
The optional argument sets the textured faces flag";
static char NMesh_hasVertexColours_doc[] =
- "(flag = None) - returns 1 if Mesh has vertex colours.\n\
-The optional argument sets the vertex colour flag";
+ "(flag = None) - returns 1 if Mesh has vertex colors.\n\
+The optional argument sets the vertex color flag";
static char NMesh_getVertexInfluences_doc[] =
"Return a list of the influences of bones in the vertex \n\
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[2] = vx*invmat[2][0] + vy*invmat[2][1] + vz*invmat[2][2];
- Normalise(mv->no);
+ Normalize(mv->no);
Py_DECREF(mv);
}
}
for(x = 0; x < 3; x++) {
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( EXPP_FloatsAreEqual(vec[0], 0.0f, 10) &&
EXPP_FloatsAreEqual(vec[1], 0.0f, 10) &&
METH_NOARGS,
"() - enable premultiply alpha"},
{"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,
"(bool) - enable/disable shadow calculation"},
{"enablePanorama", ( PyCFunction ) RenderData_EnablePanorama,
void drawlimits()
{
- /* centre around cent */
+ /* center around cent */
short cox=0, coy=1;
if((RG.flag & 3)==2) coy= 2;
VecSubf(vec[2], shoot->cent, rn->v3);
VecSubf(vec[3], shoot->cent, rn->v4);
- Normalise(vec[0]);
- Normalise(vec[1]);
- Normalise(vec[2]);
- Normalise(vec[3]);
+ Normalize(vec[0]);
+ Normalize(vec[1]);
+ Normalize(vec[2]);
+ Normalize(vec[3]);
/* cross product */
Crossf(cross[0], vec[0], vec[1]);
Crossf(cross[1], vec[1], vec[2]);
Crossf(cross[2], vec[2], vec[3]);
Crossf(cross[3], vec[3], vec[0]);
- Normalise(cross[0]);
- Normalise(cross[1]);
- Normalise(cross[2]);
- Normalise(cross[3]);
+ Normalize(cross[0]);
+ Normalize(cross[1]);
+ Normalize(cross[2]);
+ Normalize(cross[3]);
/* angles */
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
VecSubf(vec[1], shoot->cent, rn->v2);
VecSubf(vec[2], shoot->cent, rn->v3);
- Normalise(vec[0]);
- Normalise(vec[1]);
- Normalise(vec[2]);
+ Normalize(vec[0]);
+ Normalize(vec[1]);
+ Normalize(vec[2]);
/* cross product */
Crossf(cross[0], vec[0], vec[1]);
Crossf(cross[1], vec[1], vec[2]);
Crossf(cross[2], vec[2], vec[0]);
- Normalise(cross[0]);
- Normalise(cross[1]);
- Normalise(cross[2]);
+ Normalize(cross[0]);
+ Normalize(cross[1]);
+ Normalize(cross[2]);
/* angles */
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
vec[1]= (float)BLI_drand();
vec[2]= (float)BLI_drand();
Crossf(up, shoot->norm, vec);
- len= Normalise(up);
+ len= Normalize(up);
/* this safety for input normals that are zero or illegal sized */
if(a>3) return 0;
} while(len==0.0 || len>1.0);
n3[0]= face->v1[0]-face->v3[0];
n3[1]= face->v1[1]-face->v3[1];
n3[2]= face->v1[2]-face->v3[2];
- Normalise(n1);
- Normalise(n2);
- Normalise(n3);
+ Normalize(n1);
+ Normalize(n2);
+ Normalize(n3);
temp= 32.0/(PI);
*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]);
BLI_ghash_free(verthash, NULL, NULL);
- /* boundbox and centre new */
+ /* boundbox and center new */
INIT_MINMAX(min, max);
mvert= me->mvert;
VecSubf(vec, shoot->v1->co, shoot->radface->cent);
Crossf(up, shoot->radface->norm, vec);
- len= Normalise(up);
+ len= Normalize(up);
VECCOPY(hemitop.up, up);
VECCOPY(hemiside.up, shoot->radface->norm);
/* pixelshading.h
*
-* These functions determine what actual colour a pixel will have.
+* These functions determine what actual color a pixel will have.
*/
vlr->flag |= R_NOPUNOFLIP;
VecSubf(n1, v2->co, v1->co);
- Normalise(n1);
+ Normalize(n1);
VecSubf(n2, v3->co, v2->co);
- Normalise(n2);
+ Normalize(n2);
if(v4==NULL) {
VecSubf(n3, v1->co, v3->co);
- Normalise(n3);
+ Normalize(n3);
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]);
}
else {
VecSubf(n3, v4->co, v3->co);
- Normalise(n3);
+ Normalize(n3);
VecSubf(n4, v1->co, v4->co);
- Normalise(n4);
+ Normalize(n4);
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]);
}
}
- /* normalise vertex normals */
+ /* normalize vertex normals */
for(a=startvert; a<re->totvert; a++) {
VertRen *ver= RE_findOrAddVert(re, a);
- Normalise(ver->n);
+ Normalize(ver->n);
if(do_tangent) {
float *tav= RE_vertren_get_tangent(re, ver, 0);
if (tav) {
tav[0] -= ver->n[0]*tdn;
tav[1] -= ver->n[1]*tdn;
tav[2] -= ver->n[2]*tdn;
- Normalise(tav);
+ Normalize(tav);
}
}
}
vlr->flag |= R_NOPUNOFLIP;
VecSubf(n1, v2->co, v1->co);
- Normalise(n1);
+ Normalize(n1);
VecSubf(n2, v3->co, v2->co);
- Normalise(n2);
+ Normalize(n2);
if(v4==NULL) {
VecSubf(n3, v1->co, v3->co);
- Normalise(n3);
+ Normalize(n3);
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]);
fac3= saacos(-n2[0]*n3[0]-n2[1]*n3[1]-n2[2]*n3[2]);
}
else {
VecSubf(n3, v4->co, v3->co);
- Normalise(n3);
+ Normalize(n3);
VecSubf(n4, v1->co, v4->co);
- Normalise(n4);
+ Normalize(n4);
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]);
}
}
- /* normalise vertex normals */
+ /* normalize vertex normals */
for(a=startvert; a<re->totvert; a++) {
VertRen *ver= RE_findOrAddVert(re, a);
- Normalise(ver->n);
+ Normalize(ver->n);
if(do_tangent) {
float *tav= RE_vertren_get_tangent(re, ver, 0);
- if(tav) Normalise(tav);
+ if(tav) Normalize(tav);
}
}
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[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
- Normalise(nor);
+ Normalize(nor);
VECCOPY(view, vec);
- Normalise(view);
+ Normalize(view);
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
if(zn>=0.0) hasize= 0.0;
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[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
- Normalise(nor);
+ Normalize(nor);
VECCOPY(view, vec);
- Normalise(view);
+ Normalize(view);
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
if(zn>=0.0) hasize= 0.0;
har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed);
if(har && ma->mode & MA_HALO_SHADE) {
VecSubf(har->no, vec, vec1);
- Normalise(har->no);
+ Normalize(har->no);
}
}
if(har) har->lay= ob->lay;
int flag;
VecSubf(nor, vec, vec1);
- Normalise(nor); // nor needed as tangent
+ Normalize(nor); // nor needed as tangent
Crossf(cross, vec, nor);
/* turn cross in pixelsize */
VECCOPY(v1->co, vec);
VecSubf(vlr->n, vec, vec1);
- Normalise(vlr->n);
+ Normalize(vlr->n);
VECCOPY(v1->n, vlr->n);
vlr->mat= ma;
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[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
- Normalise(nor);
+ Normalize(nor);
VECCOPY(view, vec);
- Normalise(view);
+ Normalize(view);
zn= nor[0]*view[0]+nor[1]*view[1]+nor[2]*view[2];
if(zn>=0.0) hasize= 0.0;
har= RE_inithalo(re, ma, vec, NULL, pa->co, hasize, 0.0, seed);
if(har && (ma->mode & MA_HALO_SHADE)) {
VecSubf(har->no, vec, vec1);
- Normalise(har->no);
+ Normalize(har->no);
har->lay= ob->lay;
}
}
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[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(need_orco) ver->orco= data;
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[2]= imat[2][0]*xn+imat[2][1]*yn+imat[2][2]*zn;
- Normalise(vlr->n);
+ Normalize(vlr->n);
vlr->mat= ma;
vlr->flag= 0;
lar->vec[0]= -mat[2][0];
lar->vec[1]= -mat[2][1];
lar->vec[2]= -mat[2][2];
- Normalise(lar->vec);
+ Normalize(lar->vec);
lar->co[0]= mat[3][0];
lar->co[1]= mat[3][1];
lar->co[2]= mat[3][2];
if(lar->type==LA_SPOT) {
- Normalise(lar->imat[0]);
- Normalise(lar->imat[1]);
- Normalise(lar->imat[2]);
+ Normalize(lar->imat[0]);
+ Normalize(lar->imat[1]);
+ Normalize(lar->imat[2]);
xn= saacos(lar->spotsi);
xn= sin(xn)/cos(xn);
}
for(a = startvert; a < re->totvert; a++) {
ver= RE_findOrAddVert(re, a);
- Normalise(ver->n);
+ Normalize(ver->n);
}
n[0]= ob->imat[0][2];
n[1]= ob->imat[1][2];
n[2]= ob->imat[2][2];
- Normalise(n);
+ Normalize(n);
for(a=0; a<dl->nr; a++, data+=3) {
ver= RE_findOrAddVert(re, re->totvert++);
}
for(a=startvert; a<re->totvert; 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 */
else ver->flag= 0;
}
cp[3]= 1;
VECCOPY(re->grvec, re->viewmat[2]);
- Normalise(re->grvec);
+ Normalize(re->grvec);
Mat3CpyMat4(re->imat, re->viewinv);
for(a=0; a<MAX_MTEX; a++)
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[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++) {
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[2]= imat[0][2]*xn+imat[1][2]*yn+imat[2][2]*zn;
- Normalise(vlr->n);
+ Normalize(vlr->n);
}
set_normalflags(re);
static float gamfactor_table[RE_GAMMA_TABLE_SIZE];
static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE];
-static float colour_domain_table[RE_GAMMA_TABLE_SIZE + 1];
-static float colour_step;
-static float inv_colour_step;
+static float color_domain_table[RE_GAMMA_TABLE_SIZE + 1];
+static float color_step;
+static float inv_color_step;
static float valid_gamma;
static float valid_inv_gamma;
int i;
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. */
/* We may have some performance problems here. Stretching up the LUT */
/* 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);
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
else res = gamma_range_table[i] +
- ( (c - colour_domain_table[i]) * gamfactor_table[i]);
+ ( (c - color_domain_table[i]) * gamfactor_table[i]);
return res;
} /* end of float gammaCorrect(float col) */
int i;
float res = 0.0;
- i = floor(col*inv_colour_step);
- /* Negative colours are explicitly handled. */
+ i = floor(col*inv_color_step);
+ /* Negative colors are explicitly handled. */
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
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;
} /* end of float invGammaCorrect(float col) */
valid_gamma = gamma;
valid_inv_gamma = 1.0 / gamma;
- colour_step = 1.0 / RE_GAMMA_TABLE_SIZE;
- inv_colour_step = (float) RE_GAMMA_TABLE_SIZE;
+ color_step = 1.0 / RE_GAMMA_TABLE_SIZE;
+ inv_color_step = (float) RE_GAMMA_TABLE_SIZE;
/* We could squeeze out the two range tables to gain some memory. */
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) {
- colour_domain_table[i] = i * colour_step;
- gamma_range_table[i] = pow(colour_domain_table[i],
+ color_domain_table[i] = i * color_step;
+ gamma_range_table[i] = pow(color_domain_table[i],
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);
}
/* rounding errors, we just set this explicitly. The last segment may */
/* have a different lenght than the other segments, but our */
/* 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;
inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
/* To speed up calculations, we make these calc factor tables. They are */
/* multiplication factors used in scaling the interpolation. */
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]) ;
- 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]) ;
}
/* ------------------------------------------------------------------------- */
/* Debug/behaviour defines */
-/* if defined: alpha blending with floats clips colour, as with shorts */
-/* #define RE_FLOAT_COLOUR_CLIPPING */
+/* if defined: alpha blending with floats clips color, as with shorts */
+/* #define RE_FLOAT_COLOR_CLIPPING */
/* if defined: alpha values are clipped */
/* For now, we just keep alpha clipping. We run into thresholding and */
/* blending difficulties otherwise. Be careful here. */
/* Threshold for a 'full' pixel: pixels with alpha above this level are */
/* 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 */
/* considered completely transparent. This is the decimal value */
/* for 0x000F / 0xFFFF */
-#define RE_EMPTY_COLOUR_FLOAT 0.0002
+#define RE_EMPTY_COLOR_FLOAT 0.0002
/* ------------------------------------------------------------------------- */
{
float mul;
- if( (-RE_EMPTY_COLOUR_FLOAT < dest[3])
- && (dest[3] < RE_EMPTY_COLOUR_FLOAT) ) {
+ if( (-RE_EMPTY_COLOR_FLOAT < dest[3])
+ && (dest[3] < RE_EMPTY_COLOR_FLOAT) ) {
dest[0] = source[0];
dest[1] = source[1];
dest[2] = source[2];
void addalphaAddfacFloat(float *dest, float *source, char addfac)
{
float m; /* weiging factor of destination */
- float c; /* intermediate colour */
+ float c; /* intermediate color */
/* Addfac is a number between 0 and 1: rescale */
/* final target is to diminish the influence of dest when addfac rises */
m = 1.0 - ( source[3] * ((255.0 - addfac) / 255.0));
- /* blend colours*/
+ /* blend colors*/
c= (m * dest[0]) + source[0];
-#ifdef RE_FLOAT_COLOUR_CLIPPING
- if(c >= RE_FULL_COLOUR_FLOAT) dest[0] = RE_FULL_COLOUR_FLOAT;
+#ifdef RE_FLOAT_COLOR_CLIPPING
+ if(c >= RE_FULL_COLOR_FLOAT) dest[0] = RE_FULL_COLOR_FLOAT;
else
#endif
dest[0]= c;
c= (m * dest[1]) + source[1];
-#ifdef RE_FLOAT_COLOUR_CLIPPING
- if(c >= RE_FULL_COLOUR_FLOAT) dest[1] = RE_FULL_COLOUR_FLOAT;
+#ifdef RE_FLOAT_COLOR_CLIPPING
+ if(c >= RE_FULL_COLOR_FLOAT) dest[1] = RE_FULL_COLOR_FLOAT;
else
#endif
dest[1]= c;
c= (m * dest[2]) + source[2];
-#ifdef RE_FLOAT_COLOUR_CLIPPING
- if(c >= RE_FULL_COLOUR_FLOAT) dest[2] = RE_FULL_COLOUR_FLOAT;
+#ifdef RE_FLOAT_COLOR_CLIPPING
+ if(c >= RE_FULL_COLOR_FLOAT) dest[2] = RE_FULL_COLOR_FLOAT;
else
#endif
dest[2]= c;
c= (m * dest[3]) + source[3];
#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
#endif
dest[3]= c;
{
/* 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[1] = source[1];
dest[2] = source[2];
ringf*= dist;
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 */
if(har->tex) {
col[0]= har->r;
zen[0]= R.wrld.zenr; zen[1]= R.wrld.zeng; zen[2]= R.wrld.zenb;
/* 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) {
VECCOPY(lo, view);
if(R.wrld.skytype & WO_SKYREAL) {
}
/*
- Stuff the sky colour into the collector.
+ Stuff the sky color into the collector.
*/
void shadeSkyPixel(float *collector, float fx, float fy)
{
/*
The rules for sky:
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;
}
else {
calc_view_vector(view, fx, fy);
- fac= Normalise(view);
+ fac= Normalize(view);
if(R.wrld.skytype & WO_SKYTEX) {
dxyview[0]= -R.viewdx/fac;
}
}
- /* get sky colour in the collector */
+ /* get sky color in the collector */
shadeSkyView(collector, NULL, view, dxyview);
collector[3] = 0.0f;
}
shi->co[1]= is->start[1]+is->labda*(shi->view[1]);
shi->co[2]= is->start[2]+is->labda*(shi->view[2]);
- Normalise(shi->view);
+ Normalize(shi->view);
shi->vlr= vlr;
shi->mat= vlr->mat;
}
else { /* sky */
VECCOPY(shi.view, vec);
- Normalise(shi.view);
+ Normalize(shi.view);
shadeSkyView(col, isec.start, shi.view, NULL);
}
VecMulf(res, 0.5);
VecAddf(vec, vec, res);
- Normalise(vec);
+ Normalize(vec);
}
view[0]= -vec[0];
view[1]= -vec[1];
view[2]= -vec[2];
- Normalise(view);
+ Normalize(view);
if(aocolor==WO_AOSKYCOL) {
fac= 0.5*(1.0f+view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2]);
/* set up view vector */
VECCOPY(shi->view, shi->co);
- Normalise(shi->view);
+ Normalize(shi->view);
/* no face normal flip */
shi->puno= 0;
har->hasize= vectsize*zn + (1.0-vectsize)*hasize;
VecSubf(har->no, vec, vec1);
- Normalise(har->no);
+ Normalize(har->no);
}
if(ma->mode & MA_HALO_XALPHA) har->type |= HA_XALPHA;
/* since vec is rotated in lampspace, this is how to get the cosine of angle */
/* precision is set 20% larger */
vec[2]*= 1.2f;
- Normalise(vec);
+ Normalize(vec);
inpr= - vec[2];
if(inpr>=lar->spotsi) {
}
}
- /* cannot normalise earlier, code above needs it at viewplane level */
- Normalise(shi->view);
+ /* cannot normalize earlier, code above needs it at viewplane level */
+ Normalize(shi->view);
}
/* calculate U and V, for scanline (silly render face u and v are in range -1 to 0) */
shi->vn[1]= l*n3[1]-u*n1[1]-v*n2[1];
shi->vn[2]= l*n3[2]-u*n1[2]-v*n2[2];
- Normalise(shi->vn);
+ Normalize(shi->vn);
}
else {
VECCOPY(shi->vn, shi->facenor);
shi->tang[1]= (l*s3[1] - u*s1[1] - v*s2[1]);
shi->tang[2]= (l*s3[2] - u*s1[2] - v*s2[2]);
/* qdn: normalize just in case */
- Normalise(shi->tang);
+ Normalize(shi->tang);
}
else shi->tang[0]= shi->tang[1]= shi->tang[2]= 0.0f;
}
shi->tang[0] = (s1[0] + s2[0] + s3[0]);
shi->tang[1] = (s1[1] + s2[1] + s3[1]);
shi->tang[2] = (s1[2] + s2[2] + s3[2]);
- Normalise(shi->tang);
+ Normalize(shi->tang);
}
}
}
}
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 */
}
/* ---------------- shaders ----------------------- */
-static double Normalise_d(double *n)
+static double Normalize_d(double *n)
{
double d;
VECSUB(vec[2], co, lar->area[2]);
VECSUB(vec[3], co, lar->area[3]);
- Normalise_d(vec[0]);
- Normalise_d(vec[1]);
- Normalise_d(vec[2]);
- Normalise_d(vec[3]);
+ Normalize_d(vec[0]);
+ Normalize_d(vec[1]);
+ Normalize_d(vec[2]);
+ Normalize_d(vec[3]);
/* cross product */
CROSS(cross[0], vec[0], vec[1]);
CROSS(cross[2], vec[2], vec[3]);
CROSS(cross[3], vec[3], vec[0]);
- Normalise_d(cross[0]);
- Normalise_d(cross[1]);
- Normalise_d(cross[2]);
- Normalise_d(cross[3]);
+ Normalize_d(cross[0]);
+ Normalize_d(cross[1]);
+ Normalize_d(cross[2]);
+ Normalize_d(cross[3]);
/* angles */
rad[0]= vec[0][0]*vec[1][0]+ vec[0][1]*vec[1][1]+ vec[0][2]*vec[1][2];
h[0] = l[0] + v[0];
h[1] = l[1] + v[1];
h[2] = l[2] + v[2];
- Normalise(h);
+ Normalize(h);
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
if(tangent) rslt= sasqrt(1.0f - rslt*rslt);
h[0]= v[0]+l[0];
h[1]= v[1]+l[1];
h[2]= v[2]+l[2];
- Normalise(h);
+ Normalize(h);
nh= n[0]*h[0]+n[1]*h[1]+n[2]*h[2];
if(tangent) nh= sasqrt(1.0f - nh*nh);
h[0]= v[0]+l[0];
h[1]= v[1]+l[1];
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 */
if(tangent) nh= sasqrt(1.0f - nh*nh);
h[0] = l[0] + v[0];
h[1] = l[1] + v[1];
h[2] = l[2] + v[2];
- Normalise(h);
+ Normalize(h);
rslt = h[0]*n[0] + h[1]*n[1] + h[2]*n[2];
if(tangent) rslt = sasqrt(1.0f - rslt*rslt);
h[0] = l[0] + v[0];
h[1] = l[1] + v[1];
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 */
if(tangent) nh = sasqrt(1.0f - nh*nh);
h[0]= v[0]+l[0];
h[1]= v[1]+l[1];
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 */
if(nh<0.0f) nh = 0.0f;
Lit_B[0] = l[0] - (realnl * n[0]);
Lit_B[1] = l[1] - (realnl * n[1]);
Lit_B[2] = l[2] - (realnl * n[2]);
- Normalise( Lit_B );
+ Normalize( Lit_B );
View_B[0] = v[0] - (nv * n[0]);
View_B[1] = v[1] - (nv * n[1]);
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];
if( t < 0 ) t = 0;
lv[1]+= view[1];
lv[2]+= view[2];
- Normalise(lv);
+ Normalize(lv);
t= vn[0]*lv[0]+vn[1]*lv[1]+vn[2]*lv[2];
// rotate to global coords
if(mtex->texco==TEXCO_ORCO || mtex->texco==TEXCO_UV) {
if(shi->vlr && shi->vlr->ob) {
- float len= Normalise(texres.nor);
+ float len= Normalize(texres.nor);
// can be optimized... (ton)
Mat4Mul3Vecfl(shi->vlr->ob->obmat, texres.nor);
Mat4Mul3Vecfl(R.viewmat, texres.nor);
- Normalise(texres.nor);
+ Normalize(texres.nor);
VecMulf(texres.nor, len);
}
}
shi->vn[2]+= dot*nor[2];
}
}
- Normalise(shi->vn);
+ Normalize(shi->vn);
/* this makes sure the bump is passed on to the next texture */
shi->orn[0]= -shi->vn[0];
else texres.tin*= stencilTin;
}
- /* colour mapping */
+ /* color mapping */
if(mtex->mapto & (WOMAP_HORIZ+WOMAP_ZENUP+WOMAP_ZENDOWN)) {
float tcol[3];
zspan.zofsx= -pa->disprect.xmin;
zspan.zofsy= -pa->disprect.ymin;
}
- /* to centre the sample position */
+ /* to center the sample position */
zspan.zofsx -= 0.5f;
zspan.zofsy -= 0.5f;
zspan.zofsx= -pa->disprect.xmin;
zspan.zofsy= -pa->disprect.ymin;
}
- /* to centre the sample position */
+ /* to center the sample position */
zspan.zofsx -= 0.5f;
zspan.zofsy -= 0.5f;
if(ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) tex_space_curve(ob->data);
}
break;
- case B_DOCENTRE:
- docentre(0);
+ case B_DOCENTER:
+ docenter(0);
break;
- case B_DOCENTRENEW:
- docentre_new();
+ case B_DOCENTERNEW:
+ docenter_new();
break;
- case B_DOCENTRECURSOR:
- docentre_cursor();
+ case B_DOCENTERCURSOR:
+ docenter_cursor();
break;
case B_SETSMOOTH:
case B_SETSOLID:
}
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_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_DOCENTRECURSOR, "Center Cursor", 10, 60, 170, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
+ 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_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_DOCENTERCURSOR, "Center Cursor", 10, 60, 170, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
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);
- 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_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_DOCENTRECURSOR, "Center Cursor", 600, 95, 150, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
+ 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_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_DOCENTERCURSOR, "Center Cursor", 600, 95, 150, 19, 0, 0, 0, 0, 0, "Shifts object's origin to cursor location");
uiBlockEndAlign(block);
if(cu->key) {
do_ob_ipo(ob);
where_is_object(ob);
VecSubf(vec, vec, ob->obmat[3]);
- prspeed= Normalise(vec);
+ prspeed= Normalize(vec);
scrarea_queue_winredraw(curarea);
}
break;
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");
- /* 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, "");
uiBlockBeginAlign(block);
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,
- "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,
- "Colour for edges in toon shading mode.");
+ "Color for edges in toon shading mode.");
uiBlockSetDirection(block, UI_TOP);
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,"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);
if(G.scene->r.mode & R_RAYTRACE)
/* crop extend clip */
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, "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");
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);
- 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");
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) ");
cbd= coba->data + coba->cur;
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);
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");
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, "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, "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, "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 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 color");
uiBlockEndAlign(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, 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);
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);
}
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, "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, "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 color or intensity of a texture");
}
if(flag & RAD_PHASE_FACES) uiBlockSetCol(block, TH_AUTO);
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_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_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 colors, unchanging input-meshes");
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");
/* MAP TO */
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_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_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_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_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 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 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 color of the zenith below");
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
uiBlockEndAlign(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, "Var ", 155,60,155,19, &(mtex->varfac), 0.0, 1.0, 0, 0, "Sets the amount the texture affects other values");
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, 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);
}
uiDefButF(block, COL, B_WORLDPRV, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, B_COLZEN, "");
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,"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,"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,"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 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 color at the horizon");
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,"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,"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,"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 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 color at the zenith");
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,"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,"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,"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 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 color");
uiBlockBeginAlign(block);
uiBlockSetCol(block, TH_BUT_SETTING1);
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 */
- 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);
uiDefButS(block, MENU, B_LAMPPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode");
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");
}
/* MAP TO */
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, 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_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_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 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_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");
uiBlockEndAlign(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 */
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");
if(!(ma->mode & MA_HALO)) {
uiBlockBeginAlign(block);
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_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_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 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_SHLESS, B_MATPRV, "Shadeless", 230,166,73,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
uiBlockBeginAlign(block);
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, "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, "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, "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 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 color of the rings with the RGB sliders");
}
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, "Spe", 83,77,40,20, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Sets the specular colour 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, "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 color 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;}
}
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, "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, "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 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");
}
/* move vector back */
Mat4Mul3Vecfl(imat, dirvec);
- if(0.0f != Normalise(dirvec)) {
+ if(0.0f != Normalize(dirvec)) {
float norvec[3], vec1[3], vec2[3], vec[3];
int a;
/* move vector back */
Mat4Mul3Vecfl(imat, dirvec);
- if(0.0f != Normalise(dirvec)) {
+ if(0.0f != Normalize(dirvec)) {
float norvech[3], norvect[3], vec[3];
VECCOPY(vec, dirvec);
scrarea_queue_winredraw(curarea);
}
-void image_viewcentre(void)
+void image_viewcenter(void)
{
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;
lavec[0]= -mat[2][0];
lavec[1]= -mat[2][1];
lavec[2]= -mat[2][2];
- Normalise(lavec);
+ Normalize(lavec);
sta[0]= mat[3][0]+ la->clipsta*lavec[0];
sta[1]= mat[3][1]+ la->clipsta*lavec[1];
/* 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;
- Normalise(lvec);
- Normalise(vvec); /* is this the correct vector ? */
+ Normalize(lvec);
+ Normalize(vvec); /* is this the correct vector ? */
Crossf(temp,vvec,lvec); /* equation for a plane through vvec en 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
three unknowns. We remove one unkown by rotating the plane to z=0 (the plane normal) */
q[1] = plane[1] ;
q[2] = -plane[0] ;
q[3] = 0 ;
- Normalise(&q[1]);
+ Normalize(&q[1]);
angle = saacos(plane[2])/2.0;
co = cos(angle);
/* and view aligned matrix: */
Mat4CpyMat4(imat, G.vd->viewinv);
- Normalise(imat[0]);
- Normalise(imat[1]);
+ Normalize(imat[0]);
+ Normalize(imat[1]);
/* for AA effects */
glGetFloatv(GL_CURRENT_COLOR, curcol);
float fvec[3];
char val[32]; /* Stores the measurement display text here */
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 */
if ((G.vd->grid) < 0.01)
mygetmatrix(tmat);
Mat4Invert(imat, tmat);
- Normalise(imat[0]);
- Normalise(imat[1]);
+ Normalize(imat[0]);
+ Normalize(imat[1]);
while(ml) {
/* calculus here, is reused in PFIELD_FORCE */
mygetmatrix(tmat);
Mat4Invert(imat, tmat);
-// Normalise(imat[0]); // we don't do this because field doesnt scale either... apart from wind!
-// Normalise(imat[1]);
+// Normalize(imat[0]); // we don't do this because field doesnt scale either... apart from wind!
+// Normalize(imat[1]);
if (pd->forcefield == PFIELD_WIND) {
float force_val;
}
/* 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);
if(bb==NULL) {
- centre[0]= centre[1]= centre[2]= 0.0;
+ center[0]= center[1]= center[2]= 0.0;
VECCOPY(size, ob->size);
}
else {
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]);
- centre[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0;
- centre[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0;
- centre[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0;
+ center[0]= (bb->vec[0][0] + bb->vec[4][0])/2.0;
+ center[1]= (bb->vec[0][1] + bb->vec[2][1])/2.0;
+ center[2]= (bb->vec[0][2] + bb->vec[1][2])/2.0;
}
}
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. */
if (oopscalex>1.1) {
mval[0]= (f1+f2-flen+1)/2;
/* Draw a page about the oops */
BIF_GetThemeColor3fv(TH_BACK, 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 */
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 */
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)
{
float ymid1, ymid2;
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);
/* draw the main strip body */
float len1, len2, vec[3];
VECCOPY(vec, v3d->persinv[0]);
- len1= Normalise(vec);
+ len1= Normalize(vec);
VECCOPY(vec, v3d->persinv[1]);
- len2= Normalise(vec);
+ len2= Normalize(vec);
v3d->pixsize= 2.0f*(len1>len2?len1:len2);
rect->ymax= mval[1];
retval= event;
- /* normalise */
+ /* normalize */
if(rect->xmin>rect->xmax) SWAP(int, rect->xmin, rect->xmax);
if(rect->ymin>rect->ymax) SWAP(int, rect->ymin, rect->ymax);
MetaElem *ml;
EditVert *eve;
EditBone *ebo;
- float total, centre[3], centroid[3];
+ float total, center[3], centroid[3];
int a;
tottrans= 0; // global!
centroid[2]/= total;
}
- centre[0]= (min[0]+max[0])/2.0;
- centre[1]= (min[1]+max[1])/2.0;
- centre[2]= (min[2]+max[2])/2.0;
+ center[0]= (min[0]+max[0])/2.0;
+ center[1]= (min[1]+max[1])/2.0;
+ center[2]= (min[2]+max[2])/2.0;
}
#include "blendef.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 */
#define TEST_EDITARMATURE {if(G.obedit==0) return; if( (G.vd->lay & G.obedit->lay)==0 ) return;}
}
}
-/* 0 == do centre, 1 == centre new, 2 == centre cursor */
-void docentre_armature (Object *ob, int centremode)
+/* 0 == do center, 1 == center new, 2 == center cursor */
+void docenter_armature (Object *ob, int centermode)
{
ListBase list;
EditBone *ebone;
list.first= list.last = NULL;
make_boneList(&list, &arm->bonebase, NULL);
- /* Find the centrepoint */
- if (centremode == 2) {
+ /* Find the centerpoint */
+ if (centermode == 2) {
VECCOPY(cent, give_cursor());
Mat4Invert(ob->imat, ob->obmat);
Mat4MulVecfl(ob->imat, cent);
BLI_freelistN(&list);
}
- /* Adjust object location for new centrepoint */
- if(centremode && G.obedit==0) {
+ /* Adjust object location for new centerpoint */
+ if(centermode && G.obedit==0) {
Mat3CpyMat4(omat, ob->obmat);
Mat3MulVecfl(omat, cent);
Mat3CpyMat4(persmat, G.vd->viewmat);
Mat3Inv(persinv, persmat);
- /* imat and centre and size */
+ /* imat and center and size */
Mat3CpyMat4(bmat, G.obedit->obmat);
Mat3Inv(imat, bmat);
n[0]= G.vd->viewinv[2][0];
n[1]= G.vd->viewinv[2][1];
n[2]= G.vd->viewinv[2][2];
- Normalise(n);
+ Normalize(n);
}
phi= M_PI/8.0;
if (G.vd) grid = G.vd->grid;
else grid = 1.0;
- /* imat and centre and size */
+ /* imat and center and size */
if(G.obedit) {
Mat3CpyMat4(mat, G.obedit->obmat);
switch (G.vd->around)
{
- case V3D_CENTRE: /* bounding box center */
+ case V3D_CENTER: /* bounding box center */
min[0]= min[1]= min[2]= 1e20f;
max[0]= max[1]= max[2]= -1e20f;
id= G.buts->lockpoin;
te= G.buts->lockpoin;
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==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]) ;
- Normalise(vec1);
- Normalise(vec2);
+ Normalize(vec1);
+ Normalize(vec2);
VecMulf(vec1, speed);
VecMulf(vec2, speed);
ml= ml->next;
}
- /* imat and centre and size */
+ /* imat and center and size */
Mat3CpyMat4(mat, G.obedit->obmat);
curs= give_cursor();
else CalcCent3f(cent2, efa2->v1->co, efa2->v2->co, efa2->v3->co);
VecSubf(cent1, cent2, cent1);
- Normalise(cent1);
+ Normalize(cent1);
inp= cent1[0]*efa1->n[0] + cent1[1]*efa1->n[1] + cent1[2]*efa1->n[2];
if(inp < -0.001 ) eed->f1= 1;
done= 1;
}
}
- if(done) Normalise(nor);
+ if(done) Normalize(nor);
- /* centre */
+ /* center */
VecAddf(cent, min, max);
VecMulf(cent, 0.5f);
VECCOPY(min, cent);
float dot;
VECCOPY(vec, min);
- Normalise(vec);
+ Normalize(vec);
dot= INPR(vec, nor);
if( fabs(dot)<0.999) {
float cross[3], si, q1[4];
Crossf(cross, nor, vec);
- Normalise(cross);
+ Normalize(cross);
dot= 0.5f*saacos(dot);
si= (float)sin(dot);
q1[0]= (float)cos(dot);
}
*me = G.obedit->data;
- /* imat and centre and size */
+ /* imat and center and size */
Mat3CpyMat4(mat, G.obedit->obmat);
return newob;
}
d= -d;
}
- /* centre vertices */
+ /* center vertices */
/* type 7, a cone can only have 1 one side filled
* if the cone has no capping, dont add vtop */
if((fill && type>1) || type == 7) {
we need the plane for this */
Crossf(vec, normal, plane);
Crossf(normal, plane, vec);
- Normalise(normal);
+ Normalize(normal);
} else if (ese->type==EDITFACE) {
EditFace *efa= ese->data;
VecCopyf(plane, vec);
}
}
- Normalise(plane);
+ Normalize(plane);
}
}
}
}
- Normalise(nor);
+ Normalize(nor);
/* set correct selection */
EM_clear_flag_all(SELECT);
}
}
- Normalise(nor); // translation normal grab
+ Normalize(nor); // translation normal grab
/* step 7: redo selection */
EM_clear_flag_all(SELECT);
efa= nextvl;
}
- Normalise(nor); // for grab
+ Normalize(nor); // for grab
/* for all vertices with eve->tmp.v!=0
if eve->f1==1: make edge
/* following Mesh convention; we use vertex coordinate itself for normal in this case */
for(eve= em->verts.first; eve; eve=eve->next) {
- if (Normalise(eve->no)==0.0) {
+ if (Normalize(eve->no)==0.0) {
VECCOPY(eve->no, eve->co);
- Normalise(eve->no);
+ Normalize(eve->no);
}
}
}
Mat3CpyMat4(bmat, ob->obmat);
Mat3Inv(imat, bmat);
- /* centre */
+ /* center */
curs= give_cursor();
cent[0]= curs[0]-ob->obmat[3][0];
cent[1]= curs[1]-ob->obmat[3][1];
vec[1]= eve->co[1]-cent[1];
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[1]= fac*(cent[1]+vec[1]*len) + facm*eve->co[1];
dvec[0]= G.vd->persinv[2][0];
dvec[1]= G.vd->persinv[2][1];
dvec[2]= G.vd->persinv[2][2];
- Normalise(dvec);
+ Normalize(dvec);
dvec[0]*= offs;
dvec[1]*= offs;
dvec[2]*= offs;
TEST_EDITMESH
if(multires_test()) return;
- /* imat and centre and size */
+ /* imat and center and size */
Mat3CpyMat4(bmat, G.obedit->obmat);
Mat3Inv(imat,bmat);
n[0]= G.vd->viewinv[2][0];
n[1]= G.vd->viewinv[2][1];
n[2]= G.vd->viewinv[2][2];
- Normalise(n);
+ Normalize(n);
}
q[0]= (float)cos(phi);
float len, fac, nor[3], nor1[3], nor2[3];
VecSubf(nor, edge->v1->co, edge->v2->co);
- len= 0.5f*Normalise(nor);
+ len= 0.5f*Normalize(nor);
VECCOPY(nor1, edge->v1->no);
VECCOPY(nor2, edge->v2->no);
}
else {
if(rad > 0.0) { /* subdivide sphere */
- Normalise(co);
+ Normalize(co);
co[0]*= rad;
co[1]*= rad;
co[2]*= rad;
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[2] = (edge->v2->no[2]-edge->v1->no[2])*percent + edge->v1->no[2];
- Normalise(ev->no);
+ Normalize(ev->no);
return ev;
}
VecSubf(c, v3, v2);
Crossf(n_a, a, no);
- Normalise(n_a);
+ Normalize(n_a);
Crossf(n_c, no, c);
- Normalise(n_c);
+ Normalize(n_c);
- Normalise(a);
- Normalise(c);
+ Normalize(a);
+ Normalize(c);
ac = Inpf(a, c);
if (ac == 1 || ac == -1) {
ac2 = ac * ac;
fac = (float)sqrt((ac2 + 2*ac + 1)/(1 - ac2) + 1);
VecAddf(mid, n_c, n_a);
- Normalise(mid);
+ Normalize(mid);
VecMulf(mid, d * fac);
VecAddf(mid, mid, v2);
VecCopyf(midvec, mid);
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);
- l_a = Normalise(a);
+ l_a = Normalize(a);
VecSubf(b, v4, v3);
- Normalise(b);
+ Normalize(b);
VecSubf(c, v1, v2);
- Normalise(c);
+ Normalize(c);
s_b = Inpf(a, c);
s_b = (float)sqrt(1 - (s_b * s_b));
EditFace *efa;
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;
while (efa) {
if (efa->f1 & flag) {
EditFace *efa;
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;
while (efa) {
VECCOPY(v1, efa->v1->co);
{
char Finished = 0, Canceled = 0, str[100], Recalc = 0;
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);
oval[0] = mval[0]; oval[1] = mval[1];
// Init grabz for window to vec conversions
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;
curval[1] = mval[1];
window_to_3d(vec, mval[0]-oval[0], mval[1]-oval[1]);
- d = Normalise(vec) / 10;
+ d = Normalize(vec) / 10;
drawd = d * fac;
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;
Base *base;
return;
}
- if(centremode==2) {
+ if(centermode==2) {
VECCOPY(cent, give_cursor());
Mat4Invert(base->object->imat, base->object->obmat);
Mat4MulVecfl(base->object->imat, cent);
}
me->flag |= ME_ISDONE;
- if(centremode) {
+ if(centermode) {
Mat3CpyMat4(omat, base->object->obmat);
VECCOPY(centn, cent);
nu1= cu->nurb.first;
}
- if(centremode==2) {
+ if(centermode==2) {
VECCOPY(cent, give_cursor());
Mat4Invert(base->object->imat, base->object->obmat);
Mat4MulVecfl(base->object->imat, cent);
nu= nu->next;
}
- if(centremode && G.obedit==0) {
+ if(centermode && G.obedit==0) {
Mat3CpyMat4(omat, base->object->obmat);
Mat3MulVecfl(omat, cent);
}
if(G.obedit) {
- if (centremode==0) {
+ if (centermode==0) {
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
}
break;
/* Function to recenter armatures in editarmature.c
* Bone + object locations are handled there.
*/
- docentre_armature(base->object, centremode);
+ docenter_armature(base->object, centermode);
if(G.obedit)
break;
BIF_undo_push("Do Center");
}
-void docentre_new(void)
+void docenter_new(void)
{
if(G.scene->id.lib) return;
error("Unable to center new in Edit Mode");
}
else {
- docentre(1);
+ docenter(1);
}
}
-void docentre_cursor(void)
+void docenter_cursor(void)
{
if(G.scene->id.lib) return;
error("Unable to center cursor in Edit Mode");
}
else {
- docentre(2);
+ docenter(2);
}
}
VecSubf(rc, oldloc, base);
/* the axis */
- len2= Normalise(axis);
+ len2= Normalize(axis);
Crossf(n, speed, axis);
- len= Normalise(n);
+ len= Normalize(n);
if(len==0.0) return 0;
dist= fabs( rc[0]*n[0] + rc[1]*n[1] + rc[2]*n[2] );
v1= v1->next;
VecSubf(speed, v1->co, oldloc);
- len= Normalise(speed);
+ len= Normalize(speed);
if(len==0.0) return 0;
VecSubf(rc, oldloc, base);
if(active) BIF_ThemeColor(TH_HEADER);
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) {
uiSetRoundBox(3);
uiRoundBoxEmboss(-0.5+area->headbutofs, -10.0, width-1.5+area->headbutofs, HEADERY-2.0, SCR_ROUND, active);
len= MIN4(len, len1, len2, len3);
- /* plus centre */
+ /* plus center */
vec[0]= (sa->v2->vec.x+sa->v3->vec.x)/2;
vec[1]= (sa->v1->vec.y+sa->v2->vec.y)/2;
/* 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
*/
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)) {
/* note; shift+alt goes to group-flush-selecting */
/* the dist defines a vector that is infront of the offset
to rotate the view about.
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
alter offset so the view dosent jump. */
add_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW);
break;
case 9:
- image_viewcentre();
+ image_viewcenter();
case 10: /* Display Normalized Coordinates */
G.sima->flag ^= SI_COORDFLOATS;
allqueue(REDRAWIMAGE, 0);
if (g_progress_bar) {
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;
fac3 = 0.9;
} else {
view3d_home(0);
break;
case 11: /* View Selected */
- centreview();
+ centerview();
break;
case 13: /* Play Back Animation */
play_anim(0);
} else error("Only meshes can be shrinked/fattened");
break;
case 10:
- docentre(0);
+ docenter(0);
break;
case 11:
- docentre_new();
+ docenter_new();
break;
case 12:
- docentre_cursor();
+ docenter_cursor();
break;
case 13:
initTransform(TFM_TILT, CTX_NONE);
uiBut *bt;
rctf butrct;
float aspect;
- int xsize, ysize, xof=0, yof=0, centre;
+ int xsize, ysize, xof=0, yof=0, center;
short dir1= 0, dir2=0;
/* first transform to screen coords, assuming matrix is stil OK */
if(but) {
short left=0, right=0, top=0, down=0;
- if(block->direction & UI_CENTRE) centre= ysize/2;
- else centre= 0;
+ if(block->direction & UI_CENTER) center= ysize/2;
+ else center= 0;
if( butrct.xmin-xsize > 0.0) left= 1;
if( butrct.xmax+xsize < G.curscreen->sizex) right= 1;
- if( butrct.ymin-ysize+centre > 0.0) down= 1;
- if( butrct.ymax+ysize-centre < G.curscreen->sizey) top= 1;
+ if( butrct.ymin-ysize+center > 0.0) down= 1;
+ if( butrct.ymax+ysize-center < G.curscreen->sizey) top= 1;
dir1= block->direction & UI_DIRECTION;
if(dir1==UI_LEFT) {
xof= butrct.xmin - block->maxx;
- if(dir2==UI_TOP) yof= butrct.ymin - block->miny-centre;
- else yof= butrct.ymax - block->maxy+centre;
+ if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
+ else yof= butrct.ymax - block->maxy+center;
}
else if(dir1==UI_RIGHT) {
xof= butrct.xmax - block->minx;
- if(dir2==UI_TOP) yof= butrct.ymin - block->miny-centre;
- else yof= butrct.ymax - block->maxy+centre;
+ if(dir2==UI_TOP) yof= butrct.ymin - block->miny-center;
+ else yof= butrct.ymax - block->maxy+center;
}
else if(dir1==UI_TOP) {
yof= butrct.ymax - block->miny;
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);
glReadPixels(x, y, 1, 1, GL_RGBA, GL_FLOAT, tempcol);
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);
update_picker_buts_hsv(but1->block, hsv, but1->poin);
update_picker_hex(but1->block, tempcol);
uiButSetFunc(bt, do_palette_sample_cb, bt, col);
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);
uiBlockBeginAlign(block);
fp[2]= -sqrt( radsq-dx*dx-dy*dy );
}
}
- Normalise(fp);
+ Normalize(fp);
ui_draw_but(but);
ui_block_flush_back(but->block);
{
uiBut *but;
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->maxx-block->minx > block->panel->sizex - 2*PNL_SAFETY ) {
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);
if( (block->maxy-block->miny) > block->panel->sizey - 2*PNL_SAFETY - tabsy) {
but= block->buttons.first;
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->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);
if(facx!=1.0) ui_check_but(but); /* for strlen */
but= but->next;
d2[1] = v3[1] - v2[1];
d2[2] = v3[2] - v2[2];
- Normalise(d1);
- Normalise(d2);
+ Normalize(d1);
+ Normalize(d2);
return d1[0]*d2[0] + d1[1]*d2[1] + d1[2]*d2[2];
}
area_normal.z+= me->mvert[node->Index].no[2];
node= node->next;
}
- Normalise(&area_normal.x);
+ Normalize(&area_normal.x);
if(outdir) {
area_normal.x= outdir->x * view + area_normal.x * (10-view);
area_normal.y= outdir->y * view + area_normal.y * (10-view);
area_normal.z= outdir->z * view + area_normal.z * (10-view);
}
- Normalise(&area_normal.x);
+ Normalize(&area_normal.x);
return area_normal;
}
void do_draw_brush(const EditData *e, const ListBase* active_verts)
add_face_normal(&norm,&me->mface[face->Index]);
face= face->next;
}
- Normalise(&norm.x);
+ Normalize(&norm.x);
me->mvert[vert->Index].no[0]=norm.x*32767;
me->mvert[vert->Index].no[1]=norm.y*32767;
VecSubf(&e->up.x, &e->up.x, &zero_loc.x);
VecSubf(&e->right.x, &e->right.x, &zero_loc.x);
VecSubf(&e->out.x, &e->out.x, &zero_loc.x);
- Normalise(&e->up.x);
- Normalise(&e->right.x);
- Normalise(&e->out.x);
+ Normalize(&e->up.x);
+ Normalize(&e->right.x);
+ Normalize(&e->out.x);
/* Initialize mirror modifier clipping */
for(i=0; i<3; ++i) {
static float gamfactor_table[RE_GAMMA_TABLE_SIZE];
static float inv_gamma_range_table[RE_GAMMA_TABLE_SIZE + 1];
static float inv_gamfactor_table[RE_GAMMA_TABLE_SIZE];
-static float colour_domain_table[RE_GAMMA_TABLE_SIZE + 1];
-static float colour_step;
-static float inv_colour_step;
+static float color_domain_table[RE_GAMMA_TABLE_SIZE + 1];
+static float color_step;
+static float inv_color_step;
static float valid_gamma;
static float valid_inv_gamma;
valid_gamma = gamma;
valid_inv_gamma = 1.0 / gamma;
- colour_step = 1.0 / RE_GAMMA_TABLE_SIZE;
- inv_colour_step = (float) RE_GAMMA_TABLE_SIZE;
+ color_step = 1.0 / RE_GAMMA_TABLE_SIZE;
+ inv_color_step = (float) RE_GAMMA_TABLE_SIZE;
/* We could squeeze out the two range tables to gain some memory. */
for (i = 0; i < RE_GAMMA_TABLE_SIZE; i++) {
- colour_domain_table[i] = i * colour_step;
- gamma_range_table[i] = pow(colour_domain_table[i],
+ color_domain_table[i] = i * color_step;
+ gamma_range_table[i] = pow(color_domain_table[i],
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);
}
/* rounding errors, we just set this explicitly. The last segment may */
/* have a different lenght than the other segments, but our */
/* 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;
inv_gamma_range_table[RE_GAMMA_TABLE_SIZE] = 1.0;
/* To speed up calculations, we make these calc factor tables. They are */
/* multiplication factors used in scaling the interpolation. */
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]) ;
- 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]) ;
}
int i;
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. */
/* We may have some performance problems here. Stretching up the LUT */
/* 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);
else if (i >= RE_GAMMA_TABLE_SIZE ) res = pow(c, valid_gamma);
else res = gamma_range_table[i] +
- ( (c - colour_domain_table[i]) * gamfactor_table[i]);
+ ( (c - color_domain_table[i]) * gamfactor_table[i]);
return res;
} /* end of float gammaCorrect(float col) */
int i;
float res = 0.0;
- i = floor(col*inv_colour_step);
- /* Negative colours are explicitly handled. */
+ i = floor(col*inv_color_step);
+ /* Negative colors are explicitly handled. */
if (i < 0) res = -pow(abs(col), valid_inv_gamma);
else if (i >= RE_GAMMA_TABLE_SIZE) res = pow(col, valid_inv_gamma);
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;
} /* end of float invGammaCorrect(float col) */
} else if(G.qual==LR_SHIFTKEY) {
G.vd->around= V3D_CENTROID;
} else if(G.qual==0) {
- G.vd->around= V3D_CENTRE;
+ G.vd->around= V3D_CENTER;
}
handle_view3d_around();
break;
case PADPERIOD: /* '.' */
if(G.qual==0)
- centreview();
+ centerview();
break;
case PAGEUPKEY:
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);
uiBlockBeginAlign(block);
break;
case PADPERIOD:
if(G.qual==0)
- image_viewcentre();
+ image_viewcenter();
break;
}
}
/* horizontal axis */
VECCOPY(q1+1, G.vd->viewinv[0]);
- Normalise(q1+1);
+ Normalize(q1+1);
phi= (float)(M_PI/360.0)*U.pad_rot_angle;
if(event==PAD2) phi= -phi;
si= (float)sin(phi);
else G.scene->proportional= 1;
break;
case 10:
- docentre(0);
+ docenter(0);
break;
case 11:
- docentre_new();
+ docenter_new();
break;
case 12:
- docentre_cursor();
+ docenter_cursor();
break;
}
allqueue(REDRAWVIEW3D, 0);
if(U.uiflag & USER_PLAINMENUS)
uiBlockSetDirection(block, UI_RIGHT);
else
- uiBlockSetDirection(block, UI_RIGHT|UI_CENTRE);
+ uiBlockSetDirection(block, UI_RIGHT|UI_CENTER);
return block;
}
if (td->flag & TD_NOACTION)
break;
- /* translate point to centre, rotate in such a way that outline==distance */
+ /* translate point to center, rotate in such a way that outline==distance */
VECCOPY(vec, td->iloc);
Mat3MulVecfl(td->mtx, vec);
float vec[3];
VecCopyf(vec, mat[0]);
- size[0]= Normalise(vec);
+ size[0]= Normalize(vec);
VecCopyf(vec, mat[1]);
- size[1]= Normalise(vec);
+ size[1]= Normalize(vec);
VecCopyf(vec, mat[2]);
- size[2]= Normalise(vec);
+ size[2]= Normalize(vec);
/* first tried with dotproduct... but the sign flip is crucial */
if( VECSIGNFLIP(mat[0], smat[0]) ) size[0]= -size[0];
VecSubf(vec, td->iloc, t->center);
- radius = Normalise(vec);
+ radius = Normalize(vec);
tratio = ratio * td->factor;
VECCOPY(axis, t->viewinv[2]);
VecMulf(axis, -1.0f);
- Normali