forked from bartvdbraak/blender
replace VECCOPY with copy_v3_v3, same for 2d copy, also added vec copy functions for int & char.
This commit is contained in:
parent
85540d5aa7
commit
96d73bfdcf
@ -152,7 +152,7 @@ static void cdDM_getVertCo(DerivedMesh *dm, int index, float co_r[3])
|
|||||||
{
|
{
|
||||||
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
|
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
|
||||||
|
|
||||||
VECCOPY(co_r, cddm->mvert[index].co);
|
copy_v3_v3(co_r, cddm->mvert[index].co);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
|
static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
|
||||||
@ -161,7 +161,7 @@ static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; i < dm->numVertData; i++, mv++)
|
for(i = 0; i < dm->numVertData; i++, mv++)
|
||||||
VECCOPY(cos_r[i], mv->co);
|
copy_v3_v3(cos_r[i], mv->co);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cdDM_getVertNo(DerivedMesh *dm, int index, float no_r[3])
|
static void cdDM_getVertNo(DerivedMesh *dm, int index, float no_r[3])
|
||||||
@ -1246,39 +1246,39 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
|
|||||||
if( numdata != 0 ) {
|
if( numdata != 0 ) {
|
||||||
offset = 0;
|
offset = 0;
|
||||||
if(attribs.totorco) {
|
if(attribs.totorco) {
|
||||||
VECCOPY((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]);
|
copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]);
|
||||||
VECCOPY((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]);
|
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]);
|
||||||
VECCOPY((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]);
|
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]);
|
||||||
offset += sizeof(float)*3;
|
offset += sizeof(float)*3;
|
||||||
}
|
}
|
||||||
for(b = 0; b < attribs.tottface; b++) {
|
for(b = 0; b < attribs.tottface; b++) {
|
||||||
MTFace *tf = &attribs.tface[b].array[a];
|
MTFace *tf = &attribs.tface[b].array[a];
|
||||||
VECCOPY2D((float *)&varray[elementsize*curface*3+offset],tf->uv[0]);
|
copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[0]);
|
||||||
VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]);
|
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]);
|
||||||
|
|
||||||
VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]);
|
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]);
|
||||||
offset += sizeof(float)*2;
|
offset += sizeof(float)*2;
|
||||||
}
|
}
|
||||||
for(b = 0; b < attribs.totmcol; b++) {
|
for(b = 0; b < attribs.totmcol; b++) {
|
||||||
MCol *cp = &attribs.mcol[b].array[a*4 + 0];
|
MCol *cp = &attribs.mcol[b].array[a*4 + 0];
|
||||||
GLubyte col[4];
|
GLubyte col[4];
|
||||||
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
||||||
QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset], col);
|
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset], (char *)col);
|
||||||
cp = &attribs.mcol[b].array[a*4 + 1];
|
cp = &attribs.mcol[b].array[a*4 + 1];
|
||||||
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
||||||
QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize], col);
|
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize], (char *)col);
|
||||||
cp = &attribs.mcol[b].array[a*4 + 2];
|
cp = &attribs.mcol[b].array[a*4 + 2];
|
||||||
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
||||||
QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize*2], col);
|
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col);
|
||||||
offset += sizeof(unsigned char)*4;
|
offset += sizeof(unsigned char)*4;
|
||||||
}
|
}
|
||||||
if(attribs.tottang) {
|
if(attribs.tottang) {
|
||||||
float *tang = attribs.tang.array[a*4 + 0];
|
float *tang = attribs.tang.array[a*4 + 0];
|
||||||
QUATCOPY((float *)&varray[elementsize*curface*3+offset], tang);
|
copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang);
|
||||||
tang = attribs.tang.array[a*4 + 1];
|
tang = attribs.tang.array[a*4 + 1];
|
||||||
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
|
copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
|
||||||
tang = attribs.tang.array[a*4 + 2];
|
tang = attribs.tang.array[a*4 + 2];
|
||||||
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
|
copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
|
||||||
offset += sizeof(float)*4;
|
offset += sizeof(float)*4;
|
||||||
}
|
}
|
||||||
(void)offset;
|
(void)offset;
|
||||||
@ -1288,38 +1288,38 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
|
|||||||
if( numdata != 0 ) {
|
if( numdata != 0 ) {
|
||||||
offset = 0;
|
offset = 0;
|
||||||
if(attribs.totorco) {
|
if(attribs.totorco) {
|
||||||
VECCOPY((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]);
|
copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]);
|
||||||
VECCOPY((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]);
|
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]);
|
||||||
VECCOPY((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]);
|
copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]);
|
||||||
offset += sizeof(float)*3;
|
offset += sizeof(float)*3;
|
||||||
}
|
}
|
||||||
for(b = 0; b < attribs.tottface; b++) {
|
for(b = 0; b < attribs.tottface; b++) {
|
||||||
MTFace *tf = &attribs.tface[b].array[a];
|
MTFace *tf = &attribs.tface[b].array[a];
|
||||||
VECCOPY2D((float *)&varray[elementsize*curface*3+offset],tf->uv[2]);
|
copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[2]);
|
||||||
VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]);
|
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]);
|
||||||
VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]);
|
copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]);
|
||||||
offset += sizeof(float)*2;
|
offset += sizeof(float)*2;
|
||||||
}
|
}
|
||||||
for(b = 0; b < attribs.totmcol; b++) {
|
for(b = 0; b < attribs.totmcol; b++) {
|
||||||
MCol *cp = &attribs.mcol[b].array[a*4 + 2];
|
MCol *cp = &attribs.mcol[b].array[a*4 + 2];
|
||||||
GLubyte col[4];
|
GLubyte col[4];
|
||||||
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
||||||
QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset], col);
|
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset], (char *)col);
|
||||||
cp = &attribs.mcol[b].array[a*4 + 3];
|
cp = &attribs.mcol[b].array[a*4 + 3];
|
||||||
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
||||||
QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize], col);
|
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize], (char *)col);
|
||||||
cp = &attribs.mcol[b].array[a*4 + 0];
|
cp = &attribs.mcol[b].array[a*4 + 0];
|
||||||
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
|
||||||
QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize*2], col);
|
copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col);
|
||||||
offset += sizeof(unsigned char)*4;
|
offset += sizeof(unsigned char)*4;
|
||||||
}
|
}
|
||||||
if(attribs.tottang) {
|
if(attribs.tottang) {
|
||||||
float *tang = attribs.tang.array[a*4 + 2];
|
float *tang = attribs.tang.array[a*4 + 2];
|
||||||
QUATCOPY((float *)&varray[elementsize*curface*3+offset], tang);
|
copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang);
|
||||||
tang = attribs.tang.array[a*4 + 3];
|
tang = attribs.tang.array[a*4 + 3];
|
||||||
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
|
copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
|
||||||
tang = attribs.tang.array[a*4 + 0];
|
tang = attribs.tang.array[a*4 + 0];
|
||||||
QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
|
copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
|
||||||
offset += sizeof(float)*4;
|
offset += sizeof(float)*4;
|
||||||
}
|
}
|
||||||
(void)offset;
|
(void)offset;
|
||||||
@ -1439,7 +1439,7 @@ static void cdDM_foreachMappedFaceCenter(
|
|||||||
else
|
else
|
||||||
orig = i;
|
orig = i;
|
||||||
|
|
||||||
VECCOPY(cent, mv[mf->v1].co);
|
copy_v3_v3(cent, mv[mf->v1].co);
|
||||||
add_v3_v3(cent, mv[mf->v2].co);
|
add_v3_v3(cent, mv[mf->v2].co);
|
||||||
add_v3_v3(cent, mv[mf->v3].co);
|
add_v3_v3(cent, mv[mf->v3].co);
|
||||||
|
|
||||||
@ -1625,7 +1625,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *UNUSED(me))
|
|||||||
i++, eve = eve->next, index++) {
|
i++, eve = eve->next, index++) {
|
||||||
MVert *mv = &mvert[i];
|
MVert *mv = &mvert[i];
|
||||||
|
|
||||||
VECCOPY(mv->co, eve->co);
|
copy_v3_v3(mv->co, eve->co);
|
||||||
|
|
||||||
normal_float_to_short_v3(mv->no, eve->no);
|
normal_float_to_short_v3(mv->no, eve->no);
|
||||||
mv->bweight = (unsigned char) (eve->bweight * 255.0f);
|
mv->bweight = (unsigned char) (eve->bweight * 255.0f);
|
||||||
@ -1793,7 +1793,7 @@ void CDDM_apply_vert_coords(DerivedMesh *dm, float (*vertCoords)[3])
|
|||||||
cddm->mvert = vert;
|
cddm->mvert = vert;
|
||||||
|
|
||||||
for(i = 0; i < dm->numVertData; ++i, ++vert)
|
for(i = 0; i < dm->numVertData; ++i, ++vert)
|
||||||
VECCOPY(vert->co, vertCoords[i]);
|
copy_v3_v3(vert->co, vertCoords[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3])
|
void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3])
|
||||||
|
@ -183,8 +183,8 @@ static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, f
|
|||||||
if(cfra1 == cfra2)
|
if(cfra1 == cfra2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VECCOPY(keys[1].co, bp->pos);
|
copy_v3_v3(keys[1].co, bp->pos);
|
||||||
VECCOPY(keys[1].vel, bp->vec);
|
copy_v3_v3(keys[1].vel, bp->vec);
|
||||||
|
|
||||||
if(old_data) {
|
if(old_data) {
|
||||||
memcpy(keys[2].co, old_data, 3 * sizeof(float));
|
memcpy(keys[2].co, old_data, 3 * sizeof(float));
|
||||||
@ -202,8 +202,8 @@ static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, f
|
|||||||
|
|
||||||
mul_v3_fl(keys->vel, 1.0f / dfra);
|
mul_v3_fl(keys->vel, 1.0f / dfra);
|
||||||
|
|
||||||
VECCOPY(bp->pos, keys->co);
|
copy_v3_v3(bp->pos, keys->co);
|
||||||
VECCOPY(bp->vec, keys->vel);
|
copy_v3_v3(bp->vec, keys->vel);
|
||||||
}
|
}
|
||||||
static int ptcache_softbody_totpoint(void *soft_v, int UNUSED(cfra))
|
static int ptcache_softbody_totpoint(void *soft_v, int UNUSED(cfra))
|
||||||
{
|
{
|
||||||
@ -483,8 +483,8 @@ static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, flo
|
|||||||
if(cfra1 == cfra2)
|
if(cfra1 == cfra2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VECCOPY(keys[1].co, vert->x);
|
copy_v3_v3(keys[1].co, vert->x);
|
||||||
VECCOPY(keys[1].vel, vert->v);
|
copy_v3_v3(keys[1].vel, vert->v);
|
||||||
|
|
||||||
if(old_data) {
|
if(old_data) {
|
||||||
memcpy(keys[2].co, old_data, 3 * sizeof(float));
|
memcpy(keys[2].co, old_data, 3 * sizeof(float));
|
||||||
@ -502,8 +502,8 @@ static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, flo
|
|||||||
|
|
||||||
mul_v3_fl(keys->vel, 1.0f / dfra);
|
mul_v3_fl(keys->vel, 1.0f / dfra);
|
||||||
|
|
||||||
VECCOPY(vert->x, keys->co);
|
copy_v3_v3(vert->x, keys->co);
|
||||||
VECCOPY(vert->v, keys->vel);
|
copy_v3_v3(vert->v, keys->vel);
|
||||||
|
|
||||||
/* should vert->xconst be interpolated somehow too? - jahka */
|
/* should vert->xconst be interpolated somehow too? - jahka */
|
||||||
}
|
}
|
||||||
@ -2126,7 +2126,7 @@ int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
|
|||||||
}
|
}
|
||||||
void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
|
void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
|
||||||
{
|
{
|
||||||
Object *ob;
|
/* Object *ob; */ /* UNUSED */
|
||||||
PointCache *cache;
|
PointCache *cache;
|
||||||
/* float offset; unused for now */
|
/* float offset; unused for now */
|
||||||
float time, nexttime;
|
float time, nexttime;
|
||||||
@ -2143,7 +2143,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
|
|||||||
* is probably to interpolate results from two frames for that ..
|
* is probably to interpolate results from two frames for that ..
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ob= pid->ob;
|
/* ob= pid->ob; */ /* UNUSED */
|
||||||
cache= pid->cache;
|
cache= pid->cache;
|
||||||
|
|
||||||
if(timescale) {
|
if(timescale) {
|
||||||
|
@ -167,13 +167,11 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
|
|||||||
|
|
||||||
|
|
||||||
//Convert the vertex to tree coordinates
|
//Convert the vertex to tree coordinates
|
||||||
if(calc->vert)
|
if(calc->vert) {
|
||||||
{
|
copy_v3_v3(tmp_co, calc->vert[i].co);
|
||||||
VECCOPY(tmp_co, calc->vert[i].co);
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
copy_v3_v3(tmp_co, co);
|
||||||
VECCOPY(tmp_co, co);
|
|
||||||
}
|
}
|
||||||
space_transform_apply(&calc->local2target, tmp_co);
|
space_transform_apply(&calc->local2target, tmp_co);
|
||||||
|
|
||||||
@ -198,7 +196,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
|
|||||||
if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist;
|
if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist;
|
||||||
|
|
||||||
//Convert the coordinates back to mesh coordinates
|
//Convert the coordinates back to mesh coordinates
|
||||||
VECCOPY(tmp_co, nearest.co);
|
copy_v3_v3(tmp_co, nearest.co);
|
||||||
space_transform_invert(&calc->local2target, tmp_co);
|
space_transform_invert(&calc->local2target, tmp_co);
|
||||||
|
|
||||||
interp_v3_v3v3(co, co, tmp_co, weight); //linear interpolation
|
interp_v3_v3v3(co, co, tmp_co, weight); //linear interpolation
|
||||||
@ -228,11 +226,11 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
|
|||||||
//Apply space transform (TODO readjust dist)
|
//Apply space transform (TODO readjust dist)
|
||||||
if(transf)
|
if(transf)
|
||||||
{
|
{
|
||||||
VECCOPY( tmp_co, vert );
|
copy_v3_v3( tmp_co, vert );
|
||||||
space_transform_apply( transf, tmp_co );
|
space_transform_apply( transf, tmp_co );
|
||||||
co = tmp_co;
|
co = tmp_co;
|
||||||
|
|
||||||
VECCOPY( tmp_no, dir );
|
copy_v3_v3( tmp_no, dir );
|
||||||
space_transform_apply_normal( transf, tmp_no );
|
space_transform_apply_normal( transf, tmp_no );
|
||||||
no = tmp_no;
|
no = tmp_no;
|
||||||
|
|
||||||
@ -350,17 +348,17 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
|
|||||||
/* this coordinated are deformed by vertexCos only for normal projection (to get correct normals) */
|
/* this coordinated are deformed by vertexCos only for normal projection (to get correct normals) */
|
||||||
/* for other cases calc->varts contains undeformed coordinates and vertexCos should be used */
|
/* for other cases calc->varts contains undeformed coordinates and vertexCos should be used */
|
||||||
if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
|
if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
|
||||||
VECCOPY(tmp_co, calc->vert[i].co);
|
copy_v3_v3(tmp_co, calc->vert[i].co);
|
||||||
normal_short_to_float_v3(tmp_no, calc->vert[i].no);
|
normal_short_to_float_v3(tmp_no, calc->vert[i].no);
|
||||||
} else {
|
} else {
|
||||||
VECCOPY(tmp_co, co);
|
copy_v3_v3(tmp_co, co);
|
||||||
VECCOPY(tmp_no, proj_axis);
|
copy_v3_v3(tmp_no, proj_axis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VECCOPY(tmp_co, co);
|
copy_v3_v3(tmp_co, co);
|
||||||
VECCOPY(tmp_no, proj_axis);
|
copy_v3_v3(tmp_no, proj_axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -443,11 +441,11 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
|
|||||||
//Convert the vertex to tree coordinates
|
//Convert the vertex to tree coordinates
|
||||||
if(calc->vert)
|
if(calc->vert)
|
||||||
{
|
{
|
||||||
VECCOPY(tmp_co, calc->vert[i].co);
|
copy_v3_v3(tmp_co, calc->vert[i].co);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VECCOPY(tmp_co, co);
|
copy_v3_v3(tmp_co, co);
|
||||||
}
|
}
|
||||||
space_transform_apply(&calc->local2target, tmp_co);
|
space_transform_apply(&calc->local2target, tmp_co);
|
||||||
|
|
||||||
@ -478,7 +476,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
|
|||||||
if(dist > FLT_EPSILON)
|
if(dist > FLT_EPSILON)
|
||||||
interp_v3_v3v3(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation
|
interp_v3_v3v3(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist); //linear interpolation
|
||||||
else
|
else
|
||||||
VECCOPY( tmp_co, nearest.co );
|
copy_v3_v3( tmp_co, nearest.co );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Convert the coordinates back to mesh coordinates
|
//Convert the coordinates back to mesh coordinates
|
||||||
|
@ -54,11 +54,18 @@ MINLINE void swap_v2_v2(float a[2], float b[2]);
|
|||||||
MINLINE void swap_v3_v3(float a[3], float b[3]);
|
MINLINE void swap_v3_v3(float a[3], float b[3]);
|
||||||
MINLINE void swap_v4_v4(float a[4], float b[4]);
|
MINLINE void swap_v4_v4(float a[4], float b[4]);
|
||||||
|
|
||||||
|
/* char */
|
||||||
|
MINLINE void copy_v2_v2_char(char r[2], const char a[2]);
|
||||||
|
MINLINE void copy_v3_v3_char(char r[3], const char a[3]);
|
||||||
|
MINLINE void copy_v4_v4_char(char r[4], const char a[4]);
|
||||||
/* short */
|
/* short */
|
||||||
MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
|
MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
|
||||||
MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
|
MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
|
||||||
MINLINE void copy_v4_v4_short(short r[4], const short a[4]);
|
MINLINE void copy_v4_v4_short(short r[4], const short a[4]);
|
||||||
|
/* int */
|
||||||
|
MINLINE void copy_v2_v2_int(int r[2], const int a[2]);
|
||||||
|
MINLINE void copy_v3_v3_int(int r[3], const int a[3]);
|
||||||
|
MINLINE void copy_v4_v4_int(int r[4], const int a[4]);
|
||||||
|
|
||||||
/********************************* Arithmetic ********************************/
|
/********************************* Arithmetic ********************************/
|
||||||
|
|
||||||
|
@ -77,6 +77,28 @@ MINLINE void copy_v4_v4(float r[4], const float a[4])
|
|||||||
r[3]= a[3];
|
r[3]= a[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* short */
|
||||||
|
MINLINE void copy_v2_v2_char(char r[2], const char a[2])
|
||||||
|
{
|
||||||
|
r[0]= a[0];
|
||||||
|
r[1]= a[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
MINLINE void copy_v3_v3_char(char r[3], const char a[3])
|
||||||
|
{
|
||||||
|
r[0]= a[0];
|
||||||
|
r[1]= a[1];
|
||||||
|
r[2]= a[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
MINLINE void copy_v4_v4_char(char r[4], const char a[4])
|
||||||
|
{
|
||||||
|
r[0]= a[0];
|
||||||
|
r[1]= a[1];
|
||||||
|
r[2]= a[2];
|
||||||
|
r[3]= a[3];
|
||||||
|
}
|
||||||
|
|
||||||
/* short */
|
/* short */
|
||||||
MINLINE void copy_v2_v2_short(short r[2], const short a[2])
|
MINLINE void copy_v2_v2_short(short r[2], const short a[2])
|
||||||
{
|
{
|
||||||
@ -99,6 +121,28 @@ MINLINE void copy_v4_v4_short(short r[4], const short a[4])
|
|||||||
r[3]= a[3];
|
r[3]= a[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* int */
|
||||||
|
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
|
||||||
|
{
|
||||||
|
r[0]= a[0];
|
||||||
|
r[1]= a[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
|
||||||
|
{
|
||||||
|
r[0]= a[0];
|
||||||
|
r[1]= a[1];
|
||||||
|
r[2]= a[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
MINLINE void copy_v4_v4_int(int r[4], const int a[4])
|
||||||
|
{
|
||||||
|
r[0]= a[0];
|
||||||
|
r[1]= a[1];
|
||||||
|
r[2]= a[2];
|
||||||
|
r[3]= a[3];
|
||||||
|
}
|
||||||
|
|
||||||
MINLINE void swap_v2_v2(float a[2], float b[2])
|
MINLINE void swap_v2_v2(float a[2], float b[2])
|
||||||
{
|
{
|
||||||
SWAP(float, a[0], b[0]);
|
SWAP(float, a[0], b[0]);
|
||||||
|
@ -176,13 +176,13 @@ static void acf_generic_channel_color(bAnimContext *ac, bAnimListElem *ale, floa
|
|||||||
unsigned char cp[3];
|
unsigned char cp[3];
|
||||||
|
|
||||||
if (indent == 2) {
|
if (indent == 2) {
|
||||||
VECCOPY(cp, grp->cs.solid);
|
copy_v3_v3_char((char *)cp, grp->cs.solid);
|
||||||
}
|
}
|
||||||
else if (indent == 1) {
|
else if (indent == 1) {
|
||||||
VECCOPY(cp, grp->cs.select);
|
copy_v3_v3_char((char *)cp, grp->cs.select);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VECCOPY(cp, grp->cs.active);
|
copy_v3_v3_char((char *)cp, grp->cs.active);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* copy the colors over, transforming from bytes to floats */
|
/* copy the colors over, transforming from bytes to floats */
|
||||||
|
@ -157,14 +157,14 @@ static void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3])
|
|||||||
sub_v3_v3v3(nor, bone->tail, bone->head);
|
sub_v3_v3v3(nor, bone->tail, bone->head);
|
||||||
|
|
||||||
vec_roll_to_mat3(nor, roll, mat);
|
vec_roll_to_mat3(nor, roll, mat);
|
||||||
VECCOPY(up_axis, mat[2]);
|
copy_v3_v3(up_axis, mat[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float rollBoneByQuatAligned(EditBone *bone, float old_up_axis[3], float qrot[4], float qroll[4], float aligned_axis[3])
|
static float rollBoneByQuatAligned(EditBone *bone, float old_up_axis[3], float qrot[4], float qroll[4], float aligned_axis[3])
|
||||||
{
|
{
|
||||||
float nor[3], new_up_axis[3], x_axis[3], z_axis[3];
|
float nor[3], new_up_axis[3], x_axis[3], z_axis[3];
|
||||||
|
|
||||||
VECCOPY(new_up_axis, old_up_axis);
|
copy_v3_v3(new_up_axis, old_up_axis);
|
||||||
mul_qt_v3(qrot, new_up_axis);
|
mul_qt_v3(qrot, new_up_axis);
|
||||||
|
|
||||||
sub_v3_v3v3(nor, bone->tail, bone->head);
|
sub_v3_v3v3(nor, bone->tail, bone->head);
|
||||||
@ -236,7 +236,7 @@ static float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4]
|
|||||||
|
|
||||||
mul_qt_v3(qroll, normal);
|
mul_qt_v3(qroll, normal);
|
||||||
|
|
||||||
VECCOPY(new_up_axis, edge->up_axis);
|
copy_v3_v3(new_up_axis, edge->up_axis);
|
||||||
mul_qt_v3(qrot, new_up_axis);
|
mul_qt_v3(qrot, new_up_axis);
|
||||||
|
|
||||||
normalize_v3(new_up_axis);
|
normalize_v3(new_up_axis);
|
||||||
@ -252,7 +252,7 @@ float rollBoneByQuat(EditBone *bone, float old_up_axis[3], float qrot[4])
|
|||||||
{
|
{
|
||||||
float new_up_axis[3];
|
float new_up_axis[3];
|
||||||
|
|
||||||
VECCOPY(new_up_axis, old_up_axis);
|
copy_v3_v3(new_up_axis, old_up_axis);
|
||||||
mul_qt_v3(qrot, new_up_axis);
|
mul_qt_v3(qrot, new_up_axis);
|
||||||
|
|
||||||
return ED_rollBoneToVector(bone, new_up_axis, FALSE);
|
return ED_rollBoneToVector(bone, new_up_axis, FALSE);
|
||||||
@ -367,7 +367,7 @@ static RigNode *newRigNodeHead(RigGraph *rg, RigArc *arc, float p[3])
|
|||||||
node = MEM_callocN(sizeof(RigNode), "rig node");
|
node = MEM_callocN(sizeof(RigNode), "rig node");
|
||||||
BLI_addtail(&rg->nodes, node);
|
BLI_addtail(&rg->nodes, node);
|
||||||
|
|
||||||
VECCOPY(node->p, p);
|
copy_v3_v3(node->p, p);
|
||||||
node->degree = 1;
|
node->degree = 1;
|
||||||
node->arcs = NULL;
|
node->arcs = NULL;
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ static RigNode *newRigNode(RigGraph *rg, float p[3])
|
|||||||
node = MEM_callocN(sizeof(RigNode), "rig node");
|
node = MEM_callocN(sizeof(RigNode), "rig node");
|
||||||
BLI_addtail(&rg->nodes, node);
|
BLI_addtail(&rg->nodes, node);
|
||||||
|
|
||||||
VECCOPY(node->p, p);
|
copy_v3_v3(node->p, p);
|
||||||
node->degree = 0;
|
node->degree = 0;
|
||||||
node->arcs = NULL;
|
node->arcs = NULL;
|
||||||
|
|
||||||
@ -412,12 +412,12 @@ static void RIG_appendEdgeToArc(RigArc *arc, RigEdge *edge)
|
|||||||
|
|
||||||
if (edge->prev == NULL)
|
if (edge->prev == NULL)
|
||||||
{
|
{
|
||||||
VECCOPY(edge->head, arc->head->p);
|
copy_v3_v3(edge->head, arc->head->p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RigEdge *last_edge = edge->prev;
|
RigEdge *last_edge = edge->prev;
|
||||||
VECCOPY(edge->head, last_edge->tail);
|
copy_v3_v3(edge->head, last_edge->tail);
|
||||||
RIG_calculateEdgeAngles(last_edge, edge);
|
RIG_calculateEdgeAngles(last_edge, edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ static void RIG_addEdgeToArc(RigArc *arc, float tail[3], EditBone *bone)
|
|||||||
|
|
||||||
edge = MEM_callocN(sizeof(RigEdge), "rig edge");
|
edge = MEM_callocN(sizeof(RigEdge), "rig edge");
|
||||||
|
|
||||||
VECCOPY(edge->tail, tail);
|
copy_v3_v3(edge->tail, tail);
|
||||||
edge->bone = bone;
|
edge->bone = bone;
|
||||||
|
|
||||||
if (bone)
|
if (bone)
|
||||||
@ -489,10 +489,10 @@ static RigControl *cloneControl(RigGraph *rg, RigGraph *src_rg, RigControl *src_
|
|||||||
|
|
||||||
ctrl = newRigControl(rg);
|
ctrl = newRigControl(rg);
|
||||||
|
|
||||||
VECCOPY(ctrl->head, src_ctrl->head);
|
copy_v3_v3(ctrl->head, src_ctrl->head);
|
||||||
VECCOPY(ctrl->tail, src_ctrl->tail);
|
copy_v3_v3(ctrl->tail, src_ctrl->tail);
|
||||||
VECCOPY(ctrl->up_axis, src_ctrl->up_axis);
|
copy_v3_v3(ctrl->up_axis, src_ctrl->up_axis);
|
||||||
VECCOPY(ctrl->offset, src_ctrl->offset);
|
copy_v3_v3(ctrl->offset, src_ctrl->offset);
|
||||||
|
|
||||||
ctrl->tail_mode = src_ctrl->tail_mode;
|
ctrl->tail_mode = src_ctrl->tail_mode;
|
||||||
ctrl->flag = src_ctrl->flag;
|
ctrl->flag = src_ctrl->flag;
|
||||||
@ -531,9 +531,9 @@ static RigArc *cloneArc(RigGraph *rg, RigGraph *src_rg, RigArc *src_arc, GHash *
|
|||||||
|
|
||||||
edge = MEM_callocN(sizeof(RigEdge), "rig edge");
|
edge = MEM_callocN(sizeof(RigEdge), "rig edge");
|
||||||
|
|
||||||
VECCOPY(edge->head, src_edge->head);
|
copy_v3_v3(edge->head, src_edge->head);
|
||||||
VECCOPY(edge->tail, src_edge->tail);
|
copy_v3_v3(edge->tail, src_edge->tail);
|
||||||
VECCOPY(edge->up_axis, src_edge->up_axis);
|
copy_v3_v3(edge->up_axis, src_edge->up_axis);
|
||||||
|
|
||||||
edge->length = src_edge->length;
|
edge->length = src_edge->length;
|
||||||
edge->angle = src_edge->angle;
|
edge->angle = src_edge->angle;
|
||||||
@ -690,8 +690,8 @@ static void RIG_addControlBone(RigGraph *rg, EditBone *bone)
|
|||||||
{
|
{
|
||||||
RigControl *ctrl = newRigControl(rg);
|
RigControl *ctrl = newRigControl(rg);
|
||||||
ctrl->bone = bone;
|
ctrl->bone = bone;
|
||||||
VECCOPY(ctrl->head, bone->head);
|
copy_v3_v3(ctrl->head, bone->head);
|
||||||
VECCOPY(ctrl->tail, bone->tail);
|
copy_v3_v3(ctrl->tail, bone->tail);
|
||||||
getEditBoneRollUpAxis(bone, bone->roll, ctrl->up_axis);
|
getEditBoneRollUpAxis(bone, bone->roll, ctrl->up_axis);
|
||||||
ctrl->tail_mode = TL_NONE;
|
ctrl->tail_mode = TL_NONE;
|
||||||
|
|
||||||
@ -765,7 +765,7 @@ static int RIG_parentControl(RigControl *ctrl, EditBone *link)
|
|||||||
ctrl->link = link;
|
ctrl->link = link;
|
||||||
ctrl->flag = flag;
|
ctrl->flag = flag;
|
||||||
|
|
||||||
VECCOPY(ctrl->offset, offset);
|
copy_v3_v3(ctrl->offset, offset);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1146,7 +1146,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg)
|
|||||||
BLI_remlink(&arc->edges, first_edge);
|
BLI_remlink(&arc->edges, first_edge);
|
||||||
MEM_freeN(first_edge);
|
MEM_freeN(first_edge);
|
||||||
|
|
||||||
VECCOPY(arc->head->p, next_edge->head);
|
copy_v3_v3(arc->head->p, next_edge->head);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1222,7 +1222,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg)
|
|||||||
BLI_remlink(&arc->edges, first_edge);
|
BLI_remlink(&arc->edges, first_edge);
|
||||||
MEM_freeN(first_edge);
|
MEM_freeN(first_edge);
|
||||||
|
|
||||||
VECCOPY(arc->head->p, next_edge->head);
|
copy_v3_v3(arc->head->p, next_edge->head);
|
||||||
|
|
||||||
/* remove null edge in other arcs too */
|
/* remove null edge in other arcs too */
|
||||||
for (other_arc = rg->arcs.first; other_arc; other_arc = other_arc->next)
|
for (other_arc = rg->arcs.first; other_arc; other_arc = other_arc->next)
|
||||||
@ -1284,7 +1284,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg)
|
|||||||
BLI_remlink(&arc->edges, last_edge);
|
BLI_remlink(&arc->edges, last_edge);
|
||||||
MEM_freeN(last_edge);
|
MEM_freeN(last_edge);
|
||||||
|
|
||||||
VECCOPY(arc->tail->p, previous_edge->tail);
|
copy_v3_v3(arc->tail->p, previous_edge->tail);
|
||||||
previous_edge->angle = 0;
|
previous_edge->angle = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1755,7 +1755,7 @@ static void finalizeControl(RigGraph *rigg, RigControl *ctrl, float resize)
|
|||||||
sub_v3_v3v3(v1, ctrl->bone->tail, ctrl->bone->head);
|
sub_v3_v3v3(v1, ctrl->bone->tail, ctrl->bone->head);
|
||||||
sub_v3_v3v3(v2, tail_vec, ctrl->bone->head);
|
sub_v3_v3v3(v2, tail_vec, ctrl->bone->head);
|
||||||
|
|
||||||
VECCOPY(ctrl->bone->tail, tail_vec);
|
copy_v3_v3(ctrl->bone->tail, tail_vec);
|
||||||
|
|
||||||
rotation_between_vecs_to_quat(qtail, v1, v2);
|
rotation_between_vecs_to_quat(qtail, v1, v2);
|
||||||
mul_qt_qtqt(ctrl->qrot, qtail, ctrl->qrot);
|
mul_qt_qtqt(ctrl->qrot, qtail, ctrl->qrot);
|
||||||
@ -1791,7 +1791,7 @@ static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], f
|
|||||||
{
|
{
|
||||||
float parent_offset[3], tail_offset[3];
|
float parent_offset[3], tail_offset[3];
|
||||||
|
|
||||||
VECCOPY(parent_offset, ctrl->offset);
|
copy_v3_v3(parent_offset, ctrl->offset);
|
||||||
mul_v3_fl(parent_offset, resize);
|
mul_v3_fl(parent_offset, resize);
|
||||||
mul_qt_v3(qrot, parent_offset);
|
mul_qt_v3(qrot, parent_offset);
|
||||||
|
|
||||||
@ -1799,7 +1799,7 @@ static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], f
|
|||||||
|
|
||||||
ctrl->flag |= RIG_CTRL_HEAD_DONE;
|
ctrl->flag |= RIG_CTRL_HEAD_DONE;
|
||||||
|
|
||||||
QUATCOPY(ctrl->qrot, qrot);
|
copy_qt_qt(ctrl->qrot, qrot);
|
||||||
|
|
||||||
if (ctrl->tail_mode == TL_NONE)
|
if (ctrl->tail_mode == TL_NONE)
|
||||||
{
|
{
|
||||||
@ -1836,8 +1836,8 @@ static void repositionBone(bContext *C, RigGraph *rigg, RigEdge *edge, float vec
|
|||||||
|
|
||||||
rotation_between_vecs_to_quat(qrot, v1, v2);
|
rotation_between_vecs_to_quat(qrot, v1, v2);
|
||||||
|
|
||||||
VECCOPY(bone->head, vec0);
|
copy_v3_v3(bone->head, vec0);
|
||||||
VECCOPY(bone->tail, vec1);
|
copy_v3_v3(bone->tail, vec1);
|
||||||
|
|
||||||
if (!is_zero_v3(up_axis))
|
if (!is_zero_v3(up_axis))
|
||||||
{
|
{
|
||||||
|
@ -624,7 +624,7 @@ static void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *ite
|
|||||||
gluQuadricNormals(quad, GLU_SMOOTH);
|
gluQuadricNormals(quad, GLU_SMOOTH);
|
||||||
|
|
||||||
iter->head(iter);
|
iter->head(iter);
|
||||||
VECCOPY(head, iter->p);
|
copy_v3_v3(head, iter->p);
|
||||||
|
|
||||||
index = next_subdividion(toolsettings, iter, bone_start, end, head, tail);
|
index = next_subdividion(toolsettings, iter, bone_start, end, head, tail);
|
||||||
while (index != -1)
|
while (index != -1)
|
||||||
@ -640,7 +640,7 @@ static void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *ite
|
|||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
VECCOPY(head, tail);
|
copy_v3_v3(head, tail);
|
||||||
bone_start = index; // start next bone from current index
|
bone_start = index; // start next bone from current index
|
||||||
|
|
||||||
index = next_subdividion(toolsettings, iter, bone_start, end, head, tail);
|
index = next_subdividion(toolsettings, iter, bone_start, end, head, tail);
|
||||||
@ -748,7 +748,7 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
|
|||||||
|
|
||||||
if ((bone->flag & BONE_CONNECTED) == 0)
|
if ((bone->flag & BONE_CONNECTED) == 0)
|
||||||
{
|
{
|
||||||
VECCOPY(vec, bone->head);
|
copy_v3_v3(vec, bone->head);
|
||||||
mul_m4_v3(ob->obmat, vec);
|
mul_m4_v3(ob->obmat, vec);
|
||||||
project_short_noclip(ar, vec, pval);
|
project_short_noclip(ar, vec, pval);
|
||||||
|
|
||||||
@ -758,13 +758,13 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
|
|||||||
{
|
{
|
||||||
*dist = pdist;
|
*dist = pdist;
|
||||||
pt = &boneSnap;
|
pt = &boneSnap;
|
||||||
VECCOPY(pt->p, vec);
|
copy_v3_v3(pt->p, vec);
|
||||||
pt->type = PT_EXACT;
|
pt->type = PT_EXACT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VECCOPY(vec, bone->tail);
|
copy_v3_v3(vec, bone->tail);
|
||||||
mul_m4_v3(ob->obmat, vec);
|
mul_m4_v3(ob->obmat, vec);
|
||||||
project_short_noclip(ar, vec, pval);
|
project_short_noclip(ar, vec, pval);
|
||||||
|
|
||||||
@ -774,7 +774,7 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
|
|||||||
{
|
{
|
||||||
*dist = pdist;
|
*dist = pdist;
|
||||||
pt = &boneSnap;
|
pt = &boneSnap;
|
||||||
VECCOPY(pt->p, vec);
|
copy_v3_v3(pt->p, vec);
|
||||||
pt->type = PT_EXACT;
|
pt->type = PT_EXACT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1024,7 +1024,7 @@ static void sk_projectDrawPoint(bContext *C, float vec[3], SK_Stroke *stk, SK_Dr
|
|||||||
|
|
||||||
if (last != NULL)
|
if (last != NULL)
|
||||||
{
|
{
|
||||||
VECCOPY(fp, last->p);
|
copy_v3_v3(fp, last->p);
|
||||||
}
|
}
|
||||||
|
|
||||||
initgrabz(ar->regiondata, fp[0], fp[1], fp[2]);
|
initgrabz(ar->regiondata, fp[0], fp[1], fp[2]);
|
||||||
@ -1134,12 +1134,12 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
VECCOPY(vec, p1->p);
|
copy_v3_v3(vec, p1->p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_p == NULL)
|
if (last_p == NULL)
|
||||||
{
|
{
|
||||||
VECCOPY(p, vec);
|
copy_v3_v3(p, vec);
|
||||||
size = new_size;
|
size = new_size;
|
||||||
dist = 0;
|
dist = 0;
|
||||||
break;
|
break;
|
||||||
@ -1149,7 +1149,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
|
|||||||
|
|
||||||
if (new_dist < dist)
|
if (new_dist < dist)
|
||||||
{
|
{
|
||||||
VECCOPY(p, vec);
|
copy_v3_v3(p, vec);
|
||||||
dist = new_dist;
|
dist = new_dist;
|
||||||
size = new_size;
|
size = new_size;
|
||||||
}
|
}
|
||||||
@ -1161,7 +1161,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
|
|||||||
pt->type = dd->type;
|
pt->type = dd->type;
|
||||||
pt->mode = PT_SNAP;
|
pt->mode = PT_SNAP;
|
||||||
pt->size = size / 2;
|
pt->size = size / 2;
|
||||||
VECCOPY(pt->p, p);
|
copy_v3_v3(pt->p, p);
|
||||||
|
|
||||||
point_added = 1;
|
point_added = 1;
|
||||||
}
|
}
|
||||||
@ -1193,7 +1193,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
|
|||||||
|
|
||||||
if (spt != NULL)
|
if (spt != NULL)
|
||||||
{
|
{
|
||||||
VECCOPY(pt->p, spt->p);
|
copy_v3_v3(pt->p, spt->p);
|
||||||
point_added = 1;
|
point_added = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1207,7 +1207,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
|
|||||||
{
|
{
|
||||||
pt->type = dd->type;
|
pt->type = dd->type;
|
||||||
pt->mode = PT_SNAP;
|
pt->mode = PT_SNAP;
|
||||||
VECCOPY(pt->p, vec);
|
copy_v3_v3(pt->p, vec);
|
||||||
|
|
||||||
point_added = 1;
|
point_added = 1;
|
||||||
}
|
}
|
||||||
@ -1234,7 +1234,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk,
|
|||||||
int total;
|
int total;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
VECCOPY(final_p, pt.p);
|
copy_v3_v3(final_p, pt.p);
|
||||||
|
|
||||||
sk_projectDrawPoint(C, pt.p, stk, dd);
|
sk_projectDrawPoint(C, pt.p, stk, dd);
|
||||||
sk_appendStrokePoint(stk, &pt);
|
sk_appendStrokePoint(stk, &pt);
|
||||||
@ -1259,7 +1259,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk,
|
|||||||
sk_interpolateDepth(C, stk, i + 1, stk->nb_points - 2, length, distance);
|
sk_interpolateDepth(C, stk, i + 1, stk->nb_points - 2, length, distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
VECCOPY(stk->points[stk->nb_points - 1].p, final_p);
|
copy_v3_v3(stk->points[stk->nb_points - 1].p, final_p);
|
||||||
|
|
||||||
point_added = 1;
|
point_added = 1;
|
||||||
}
|
}
|
||||||
@ -1296,7 +1296,7 @@ static void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_S
|
|||||||
{
|
{
|
||||||
point_added = sk_getStrokeSnapPoint(C, pt, sketch, stk, dd);
|
point_added = sk_getStrokeSnapPoint(C, pt, sketch, stk, dd);
|
||||||
LAST_SNAP_POINT_VALID = 1;
|
LAST_SNAP_POINT_VALID = 1;
|
||||||
VECCOPY(LAST_SNAP_POINT, pt->p);
|
copy_v3_v3(LAST_SNAP_POINT, pt->p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1536,8 +1536,8 @@ static void sk_convertStroke(bContext *C, SK_Stroke *stk)
|
|||||||
{
|
{
|
||||||
bone = ED_armature_edit_bone_add(arm, "Bone");
|
bone = ED_armature_edit_bone_add(arm, "Bone");
|
||||||
|
|
||||||
VECCOPY(bone->head, head->p);
|
copy_v3_v3(bone->head, head->p);
|
||||||
VECCOPY(bone->tail, pt->p);
|
copy_v3_v3(bone->tail, pt->p);
|
||||||
|
|
||||||
mul_m4_v3(invmat, bone->head);
|
mul_m4_v3(invmat, bone->head);
|
||||||
mul_m4_v3(invmat, bone->tail);
|
mul_m4_v3(invmat, bone->tail);
|
||||||
|
@ -658,7 +658,7 @@ static void gp_stroke_newfrombuffer (tGPsdata *p)
|
|||||||
found_depth= TRUE;
|
found_depth= TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VECCOPY2D(mval_prev, mval);
|
copy_v2_v2_int(mval_prev, mval);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found_depth == FALSE) {
|
if (found_depth == FALSE) {
|
||||||
|
@ -1224,7 +1224,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3])
|
|||||||
int a, tot;
|
int a, tot;
|
||||||
|
|
||||||
if(but->editvec) {
|
if(but->editvec) {
|
||||||
VECCOPY(vec, but->editvec);
|
copy_v3_v3(vec, but->editvec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(but->rnaprop) {
|
if(but->rnaprop) {
|
||||||
@ -1248,7 +1248,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3])
|
|||||||
}
|
}
|
||||||
else if(but->pointype == FLO) {
|
else if(but->pointype == FLO) {
|
||||||
float *fp= (float *)but->poin;
|
float *fp= (float *)but->poin;
|
||||||
VECCOPY(vec, fp);
|
copy_v3_v3(vec, fp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (but->editvec==NULL) {
|
if (but->editvec==NULL) {
|
||||||
|
@ -1510,7 +1510,7 @@ static void widget_state(uiWidgetType *wt, int state)
|
|||||||
wt->wcol= *(wt->wcol_theme);
|
wt->wcol= *(wt->wcol_theme);
|
||||||
|
|
||||||
if(state & UI_SELECT) {
|
if(state & UI_SELECT) {
|
||||||
QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel)
|
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
|
||||||
|
|
||||||
if(state & UI_BUT_ANIMATED_KEY)
|
if(state & UI_BUT_ANIMATED_KEY)
|
||||||
widget_state_blend(wt->wcol.inner, wcol_state->inner_key_sel, wcol_state->blend);
|
widget_state_blend(wt->wcol.inner, wcol_state->inner_key_sel, wcol_state->blend);
|
||||||
@ -1519,7 +1519,7 @@ static void widget_state(uiWidgetType *wt, int state)
|
|||||||
else if(state & UI_BUT_DRIVEN)
|
else if(state & UI_BUT_DRIVEN)
|
||||||
widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend);
|
widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend);
|
||||||
|
|
||||||
VECCOPY(wt->wcol.text, wt->wcol.text_sel);
|
copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
|
||||||
|
|
||||||
if(state & UI_SELECT)
|
if(state & UI_SELECT)
|
||||||
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
|
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
|
||||||
@ -1604,7 +1604,7 @@ static void widget_state_option_menu(uiWidgetType *wt, int state)
|
|||||||
else {
|
else {
|
||||||
bTheme *btheme= U.themes.first; /* XXX */
|
bTheme *btheme= U.themes.first; /* XXX */
|
||||||
|
|
||||||
VECCOPY(wt->wcol.text, btheme->tui.wcol_menu_back.text);
|
copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1619,11 +1619,11 @@ static void widget_state_pulldown(uiWidgetType *wt, int state)
|
|||||||
{
|
{
|
||||||
wt->wcol= *(wt->wcol_theme);
|
wt->wcol= *(wt->wcol_theme);
|
||||||
|
|
||||||
QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel);
|
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
|
||||||
VECCOPY(wt->wcol.outline, wt->wcol.inner);
|
copy_v3_v3_char(wt->wcol.outline, wt->wcol.inner);
|
||||||
|
|
||||||
if(state & UI_ACTIVE)
|
if(state & UI_ACTIVE)
|
||||||
VECCOPY(wt->wcol.text, wt->wcol.text_sel);
|
copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* special case, menu items */
|
/* special case, menu items */
|
||||||
@ -1637,8 +1637,8 @@ static void widget_state_menu_item(uiWidgetType *wt, int state)
|
|||||||
wt->wcol.text[2]= 0.5f*(wt->wcol.text[2]+wt->wcol.text_sel[2]);
|
wt->wcol.text[2]= 0.5f*(wt->wcol.text[2]+wt->wcol.text_sel[2]);
|
||||||
}
|
}
|
||||||
else if(state & UI_ACTIVE) {
|
else if(state & UI_ACTIVE) {
|
||||||
QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel);
|
copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
|
||||||
VECCOPY(wt->wcol.text, wt->wcol.text_sel);
|
copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2197,7 +2197,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat
|
|||||||
|
|
||||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||||
|
|
||||||
QUATCOPY(wcol->inner, wcol->item);
|
copy_v4_v4_char(wcol->inner, wcol->item);
|
||||||
|
|
||||||
if(wcol->shadetop>wcol->shadedown)
|
if(wcol->shadetop>wcol->shadedown)
|
||||||
wcol->shadetop+= 20; /* XXX violates themes... */
|
wcol->shadetop+= 20; /* XXX violates themes... */
|
||||||
@ -2369,9 +2369,9 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
|
|||||||
if(!(state & UI_TEXTINPUT)) {
|
if(!(state & UI_TEXTINPUT)) {
|
||||||
|
|
||||||
/* slider part */
|
/* slider part */
|
||||||
VECCOPY(outline, wcol->outline);
|
copy_v3_v3_char(outline, wcol->outline);
|
||||||
VECCOPY(wcol->outline, wcol->item);
|
copy_v3_v3_char(wcol->outline, wcol->item);
|
||||||
VECCOPY(wcol->inner, wcol->item);
|
copy_v3_v3_char(wcol->inner, wcol->item);
|
||||||
|
|
||||||
if(!(state & UI_SELECT))
|
if(!(state & UI_SELECT))
|
||||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||||
@ -2397,7 +2397,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
|
|||||||
round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs);
|
round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs);
|
||||||
|
|
||||||
widgetbase_draw(&wtb1, wcol);
|
widgetbase_draw(&wtb1, wcol);
|
||||||
VECCOPY(wcol->outline, outline);
|
copy_v3_v3_char(wcol->outline, outline);
|
||||||
|
|
||||||
if(!(state & UI_SELECT))
|
if(!(state & UI_SELECT))
|
||||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||||
@ -2624,7 +2624,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
|
|||||||
|
|
||||||
widget_init(&wtb);
|
widget_init(&wtb);
|
||||||
|
|
||||||
VECCOPY(old_col, wcol->inner);
|
copy_v3_v3_char(old_col, wcol->inner);
|
||||||
|
|
||||||
/* abuse but->hsv - if it's non-zero, use this color as the box's background */
|
/* abuse but->hsv - if it's non-zero, use this color as the box's background */
|
||||||
if (but->col[3]) {
|
if (but->col[3]) {
|
||||||
@ -2643,7 +2643,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
|
|||||||
/* XXX, this doesnt work right since the color applies to buttons outside the box too. */
|
/* XXX, this doesnt work right since the color applies to buttons outside the box too. */
|
||||||
glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0);
|
glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0);
|
||||||
|
|
||||||
VECCOPY(wcol->inner, old_col);
|
copy_v3_v3_char(wcol->inner, old_col);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void widget_but(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
|
static void widget_but(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "BLI_listbase.h"
|
#include "BLI_listbase.h"
|
||||||
|
#include "BLI_math.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
|
|
||||||
#include "DNA_curve_types.h"
|
#include "DNA_curve_types.h"
|
||||||
@ -132,7 +133,7 @@ void load_editLatt(Object *obedit)
|
|||||||
|
|
||||||
bp= editlt->def;
|
bp= editlt->def;
|
||||||
while(tot--) {
|
while(tot--) {
|
||||||
VECCOPY(fp, bp->vec);
|
copy_v3_v3(fp, bp->vec);
|
||||||
fp+= 3;
|
fp+= 3;
|
||||||
bp++;
|
bp++;
|
||||||
}
|
}
|
||||||
|
@ -357,7 +357,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
|
|||||||
key= cache[a];
|
key= cache[a];
|
||||||
kmax= key->steps;
|
kmax= key->steps;
|
||||||
for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
|
for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
|
||||||
VECCOPY(mvert->co,key->co);
|
copy_v3_v3(mvert->co,key->co);
|
||||||
if(k) {
|
if(k) {
|
||||||
medge->v1= cvert-1;
|
medge->v1= cvert-1;
|
||||||
medge->v2= cvert;
|
medge->v2= cvert;
|
||||||
@ -376,7 +376,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
|
|||||||
key=cache[a];
|
key=cache[a];
|
||||||
kmax=key->steps;
|
kmax=key->steps;
|
||||||
for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
|
for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
|
||||||
VECCOPY(mvert->co,key->co);
|
copy_v3_v3(mvert->co,key->co);
|
||||||
if(k) {
|
if(k) {
|
||||||
medge->v1=cvert-1;
|
medge->v1=cvert-1;
|
||||||
medge->v2=cvert;
|
medge->v2=cvert;
|
||||||
|
@ -105,12 +105,30 @@
|
|||||||
|
|
||||||
#define IMAPAINT_CHAR_TO_FLOAT(c) ((c)/255.0f)
|
#define IMAPAINT_CHAR_TO_FLOAT(c) ((c)/255.0f)
|
||||||
|
|
||||||
#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { (c)[0]=FTOCHAR((f)[0]); (c)[1]=FTOCHAR((f)[1]); (c)[2]=FTOCHAR((f)[2]); }
|
#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { \
|
||||||
#define IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f) { (c)[0]=FTOCHAR((f)[0]); (c)[1]=FTOCHAR((f)[1]); (c)[2]=FTOCHAR((f)[2]); (c)[3]=FTOCHAR((f)[3]); }
|
(c)[0]= FTOCHAR((f)[0]); \
|
||||||
|
(c)[1]= FTOCHAR((f)[1]); \
|
||||||
|
(c)[2]= FTOCHAR((f)[2]); \
|
||||||
|
}
|
||||||
|
#define IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f) { \
|
||||||
|
(c)[0]= FTOCHAR((f)[0]); \
|
||||||
|
(c)[1]= FTOCHAR((f)[1]); \
|
||||||
|
(c)[2]= FTOCHAR((f)[2]); \
|
||||||
|
(c)[3]= FTOCHAR((f)[3]); \
|
||||||
|
}
|
||||||
|
#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { \
|
||||||
|
(f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \
|
||||||
|
(f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \
|
||||||
|
(f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \
|
||||||
|
}
|
||||||
|
#define IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c) { \
|
||||||
|
(f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]); \
|
||||||
|
(f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]); \
|
||||||
|
(f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]); \
|
||||||
|
(f)[3]= IMAPAINT_CHAR_TO_FLOAT((c)[3]); \
|
||||||
|
}
|
||||||
|
|
||||||
#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { (f)[0]=IMAPAINT_CHAR_TO_FLOAT((c)[0]); (f)[1]=IMAPAINT_CHAR_TO_FLOAT((c)[1]); (f)[2]=IMAPAINT_CHAR_TO_FLOAT((c)[2]); }
|
#define IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b)
|
||||||
#define IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c) { (f)[0]=IMAPAINT_CHAR_TO_FLOAT((c)[0]); (f)[1]=IMAPAINT_CHAR_TO_FLOAT((c)[1]); (f)[2]=IMAPAINT_CHAR_TO_FLOAT((c)[2]); (f)[3]=IMAPAINT_CHAR_TO_FLOAT((c)[3]); }
|
|
||||||
#define IMAPAINT_FLOAT_RGB_COPY(a, b) VECCOPY(a, b)
|
|
||||||
|
|
||||||
#define IMAPAINT_TILE_BITS 6
|
#define IMAPAINT_TILE_BITS 6
|
||||||
#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
|
#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS)
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "BLF_api.h"
|
#include "BLF_api.h"
|
||||||
|
|
||||||
|
#include "BLI_math.h"
|
||||||
#include "BLI_utildefines.h"
|
#include "BLI_utildefines.h"
|
||||||
|
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
|
|||||||
const char *line_stride= str + initial_offset; /* advance to the last line and draw it first */
|
const char *line_stride= str + initial_offset; /* advance to the last line and draw it first */
|
||||||
|
|
||||||
int sel_orig[2];
|
int sel_orig[2];
|
||||||
VECCOPY2D(sel_orig, cdc->sel);
|
copy_v2_v2_int(sel_orig, cdc->sel);
|
||||||
|
|
||||||
/* invert and swap for wrapping */
|
/* invert and swap for wrapping */
|
||||||
cdc->sel[0] = str_len - sel_orig[1];
|
cdc->sel[0] = str_len - sel_orig[1];
|
||||||
@ -178,7 +179,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VECCOPY2D(cdc->sel, sel_orig);
|
copy_v2_v2_int(cdc->sel, sel_orig);
|
||||||
STEP_SEL(-(str_len + 1));
|
STEP_SEL(-(str_len + 1));
|
||||||
}
|
}
|
||||||
else { /* simple, no wrap */
|
else { /* simple, no wrap */
|
||||||
|
@ -153,17 +153,17 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag)
|
|||||||
unsigned char cp[3];
|
unsigned char cp[3];
|
||||||
|
|
||||||
if (boneflag & BONE_DRAW_ACTIVE) {
|
if (boneflag & BONE_DRAW_ACTIVE) {
|
||||||
VECCOPY(cp, bcolor->active);
|
copy_v3_v3_char((char *)cp, bcolor->active);
|
||||||
if(!(boneflag & BONE_SELECTED)) {
|
if(!(boneflag & BONE_SELECTED)) {
|
||||||
cp_shade_color3ub(cp, -80);
|
cp_shade_color3ub(cp, -80);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (boneflag & BONE_SELECTED) {
|
else if (boneflag & BONE_SELECTED) {
|
||||||
VECCOPY(cp, bcolor->select);
|
copy_v3_v3_char((char *)cp, bcolor->select);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* a bit darker than solid */
|
/* a bit darker than solid */
|
||||||
VECCOPY(cp, bcolor->solid);
|
copy_v3_v3_char((char *)cp, bcolor->solid);
|
||||||
cp_shade_color3ub(cp, -50);
|
cp_shade_color3ub(cp, -50);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,13 +213,13 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag)
|
|||||||
unsigned char cp[3];
|
unsigned char cp[3];
|
||||||
|
|
||||||
if (boneflag & BONE_DRAW_ACTIVE) {
|
if (boneflag & BONE_DRAW_ACTIVE) {
|
||||||
VECCOPY(cp, bcolor->active);
|
copy_v3_v3_char((char *)cp, bcolor->active);
|
||||||
}
|
}
|
||||||
else if (boneflag & BONE_SELECTED) {
|
else if (boneflag & BONE_SELECTED) {
|
||||||
VECCOPY(cp, bcolor->select);
|
copy_v3_v3_char((char *)cp, bcolor->select);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VECCOPY(cp, bcolor->solid);
|
copy_v3_v3_char((char *)cp, bcolor->solid);
|
||||||
}
|
}
|
||||||
|
|
||||||
glColor3ubv(cp);
|
glColor3ubv(cp);
|
||||||
@ -239,15 +239,15 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag)
|
|||||||
unsigned char cp[3];
|
unsigned char cp[3];
|
||||||
|
|
||||||
if (boneflag & BONE_DRAW_ACTIVE) {
|
if (boneflag & BONE_DRAW_ACTIVE) {
|
||||||
VECCOPY(cp, bcolor->active);
|
copy_v3_v3_char((char *)cp, bcolor->active);
|
||||||
cp_shade_color3ub(cp, 10);
|
cp_shade_color3ub(cp, 10);
|
||||||
}
|
}
|
||||||
else if (boneflag & BONE_SELECTED) {
|
else if (boneflag & BONE_SELECTED) {
|
||||||
VECCOPY(cp, bcolor->select);
|
copy_v3_v3_char((char *)cp, bcolor->select);
|
||||||
cp_shade_color3ub(cp, -30);
|
cp_shade_color3ub(cp, -30);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VECCOPY(cp, bcolor->solid);
|
copy_v3_v3_char((char *)cp, bcolor->solid);
|
||||||
cp_shade_color3ub(cp, -30);
|
cp_shade_color3ub(cp, -30);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4922,7 +4922,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
|
|||||||
int skip= nu->resolu/16;
|
int skip= nu->resolu/16;
|
||||||
|
|
||||||
while (nr-->0) { /* accounts for empty bevel lists */
|
while (nr-->0) { /* accounts for empty bevel lists */
|
||||||
float fac= bevp->radius * ts->normalsize;
|
const float fac= bevp->radius * ts->normalsize;
|
||||||
float vec_a[3]; // Offset perpendicular to the curve
|
float vec_a[3]; // Offset perpendicular to the curve
|
||||||
float vec_b[3]; // Delta along the curve
|
float vec_b[3]; // Delta along the curve
|
||||||
|
|
||||||
@ -4939,8 +4939,8 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
|
|||||||
add_v3_v3(vec_a, bevp->vec);
|
add_v3_v3(vec_a, bevp->vec);
|
||||||
add_v3_v3(vec_b, bevp->vec);
|
add_v3_v3(vec_b, bevp->vec);
|
||||||
|
|
||||||
VECSUBFAC(vec_a, vec_a, bevp->dir, fac);
|
madd_v3_v3fl(vec_a, bevp->dir, -fac);
|
||||||
VECSUBFAC(vec_b, vec_b, bevp->dir, fac);
|
madd_v3_v3fl(vec_b, bevp->dir, -fac);
|
||||||
|
|
||||||
glBegin(GL_LINE_STRIP);
|
glBegin(GL_LINE_STRIP);
|
||||||
glVertex3fv(vec_a);
|
glVertex3fv(vec_a);
|
||||||
|
@ -3462,8 +3462,8 @@ int ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], cons
|
|||||||
data.margin= margin;
|
data.margin= margin;
|
||||||
data.depth= FLT_MAX;
|
data.depth= FLT_MAX;
|
||||||
|
|
||||||
VECCOPY2D(p1, mval_sta);
|
copy_v2_v2_int(p1, mval_sta);
|
||||||
VECCOPY2D(p2, mval_end);
|
copy_v2_v2_int(p2, mval_end);
|
||||||
|
|
||||||
plot_line_v2v2i(p1, p2, depth_segment_cb, &data);
|
plot_line_v2v2i(p1, p2, depth_segment_cb, &data);
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
|
|||||||
|
|
||||||
fly->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
|
fly->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
|
||||||
|
|
||||||
VECCOPY2D(fly->mval, event->mval)
|
copy_v2_v2_int(fly->mval, event->mval);
|
||||||
fly->ndof = NULL;
|
fly->ndof = NULL;
|
||||||
|
|
||||||
fly->time_lastdraw= fly->time_lastwheel= PIL_check_seconds_timer();
|
fly->time_lastdraw= fly->time_lastwheel= PIL_check_seconds_timer();
|
||||||
@ -475,7 +475,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
|
|||||||
fly->redraw = 1;
|
fly->redraw = 1;
|
||||||
}
|
}
|
||||||
else if (event->type == MOUSEMOVE) {
|
else if (event->type == MOUSEMOVE) {
|
||||||
VECCOPY2D(fly->mval, event->mval);
|
copy_v2_v2_int(fly->mval, event->mval);
|
||||||
}
|
}
|
||||||
else if (event->type == NDOF_MOTION) {
|
else if (event->type == NDOF_MOTION) {
|
||||||
// do these automagically get delivered? yes.
|
// do these automagically get delivered? yes.
|
||||||
|
@ -548,7 +548,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
|
|||||||
if (t->modifiers & MOD_CONSTRAINT_SELECT)
|
if (t->modifiers & MOD_CONSTRAINT_SELECT)
|
||||||
t->con.mode |= CON_SELECT;
|
t->con.mode |= CON_SELECT;
|
||||||
|
|
||||||
VECCOPY2D(t->mval, event->mval);
|
copy_v2_v2_int(t->mval, event->mval);
|
||||||
|
|
||||||
// t->redraw |= TREDRAW_SOFT; /* Use this for soft redraw. Might cause flicker in object mode */
|
// t->redraw |= TREDRAW_SOFT; /* Use this for soft redraw. Might cause flicker in object mode */
|
||||||
t->redraw |= TREDRAW_HARD;
|
t->redraw |= TREDRAW_HARD;
|
||||||
|
@ -941,7 +941,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
|
|||||||
|
|
||||||
if (event)
|
if (event)
|
||||||
{
|
{
|
||||||
VECCOPY2D(t->imval, event->mval);
|
copy_v2_v2_int(t->imval, event->mval);
|
||||||
t->event_type = event->type;
|
t->event_type = event->type;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -409,7 +409,7 @@ int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event)
|
|||||||
t->modifiers |= MOD_PRECISION;
|
t->modifiers |= MOD_PRECISION;
|
||||||
/* shift is modifier for higher precision transform
|
/* shift is modifier for higher precision transform
|
||||||
* store the mouse position where the normal movement ended */
|
* store the mouse position where the normal movement ended */
|
||||||
VECCOPY2D(mi->precision_mval, event->mval);
|
copy_v2_v2_int(mi->precision_mval, event->mval);
|
||||||
mi->precision = 1;
|
mi->precision = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -80,7 +80,7 @@ static void make_vertexcos__mapFunc(void *userData, int index, float *co, float
|
|||||||
if(!mappedData->flags[index]) {
|
if(!mappedData->flags[index]) {
|
||||||
/* we need coord from prototype vertex, not it clones or images,
|
/* we need coord from prototype vertex, not it clones or images,
|
||||||
suppose they stored in the beginning of vertex array stored in DM */
|
suppose they stored in the beginning of vertex array stored in DM */
|
||||||
VECCOPY(vec, co);
|
copy_v3_v3(vec, co);
|
||||||
mappedData->flags[index]= 1;
|
mappedData->flags[index]= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double tim
|
|||||||
|
|
||||||
if(!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) {
|
if(!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) {
|
||||||
lamp->dynenergy = lamp->energy;
|
lamp->dynenergy = lamp->energy;
|
||||||
VECCOPY(lamp->dyncol, lamp->col);
|
copy_v3_v3(lamp->dyncol, lamp->col);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lamp->dynenergy = 0.0f;
|
lamp->dynenergy = 0.0f;
|
||||||
@ -306,14 +306,14 @@ void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float v
|
|||||||
lamp= nlink->data;
|
lamp= nlink->data;
|
||||||
|
|
||||||
if(material->dynproperty & DYN_LAMP_VEC) {
|
if(material->dynproperty & DYN_LAMP_VEC) {
|
||||||
VECCOPY(lamp->dynvec, lamp->vec);
|
copy_v3_v3(lamp->dynvec, lamp->vec);
|
||||||
normalize_v3(lamp->dynvec);
|
normalize_v3(lamp->dynvec);
|
||||||
negate_v3(lamp->dynvec);
|
negate_v3(lamp->dynvec);
|
||||||
mul_mat3_m4_v3(viewmat, lamp->dynvec);
|
mul_mat3_m4_v3(viewmat, lamp->dynvec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(material->dynproperty & DYN_LAMP_CO) {
|
if(material->dynproperty & DYN_LAMP_CO) {
|
||||||
VECCOPY(lamp->dynco, lamp->co);
|
copy_v3_v3(lamp->dynco, lamp->co);
|
||||||
mul_m4_v3(viewmat, lamp->dynco);
|
mul_m4_v3(viewmat, lamp->dynco);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1472,8 +1472,8 @@ void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[][4])
|
|||||||
copy_m4_m4(mat, obmat);
|
copy_m4_m4(mat, obmat);
|
||||||
normalize_m4(mat);
|
normalize_m4(mat);
|
||||||
|
|
||||||
VECCOPY(lamp->vec, mat[2]);
|
copy_v3_v3(lamp->vec, mat[2]);
|
||||||
VECCOPY(lamp->co, mat[3]);
|
copy_v3_v3(lamp->co, mat[3]);
|
||||||
copy_m4_m4(lamp->obmat, mat);
|
copy_m4_m4(lamp->obmat, mat);
|
||||||
invert_m4_m4(lamp->imat, mat);
|
invert_m4_m4(lamp->imat, mat);
|
||||||
}
|
}
|
||||||
|
@ -205,9 +205,9 @@ static void where_is_ik_bone(bPoseChannel *pchan, float ik_mat[][3]) // nr = t
|
|||||||
mul_m4_m4m4(pchan->pose_mat, ikmat, pchan->chan_mat);
|
mul_m4_m4m4(pchan->pose_mat, ikmat, pchan->chan_mat);
|
||||||
|
|
||||||
/* calculate head */
|
/* calculate head */
|
||||||
VECCOPY(pchan->pose_head, pchan->pose_mat[3]);
|
copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]);
|
||||||
/* calculate tail */
|
/* calculate tail */
|
||||||
VECCOPY(vec, pchan->pose_mat[1]);
|
copy_v3_v3(vec, pchan->pose_mat[1]);
|
||||||
mul_v3_fl(vec, pchan->bone->length);
|
mul_v3_fl(vec, pchan->bone->length);
|
||||||
add_v3_v3v3(pchan->pose_tail, pchan->pose_head, vec);
|
add_v3_v3v3(pchan->pose_tail, pchan->pose_head, vec);
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
|
|||||||
copy_m4_m4(rootmat, pchan->parent->pose_mat);
|
copy_m4_m4(rootmat, pchan->parent->pose_mat);
|
||||||
else
|
else
|
||||||
unit_m4(rootmat);
|
unit_m4(rootmat);
|
||||||
VECCOPY(rootmat[3], pchan->pose_head);
|
copy_v3_v3(rootmat[3], pchan->pose_head);
|
||||||
|
|
||||||
mul_m4_m4m4(imat, rootmat, ob->obmat);
|
mul_m4_m4m4(imat, rootmat, ob->obmat);
|
||||||
invert_m4_m4(goalinv, imat);
|
invert_m4_m4(goalinv, imat);
|
||||||
@ -359,7 +359,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
|
|||||||
/* and set and transform goal */
|
/* and set and transform goal */
|
||||||
mul_m4_m4m4(goal, rootmat, goalinv);
|
mul_m4_m4m4(goal, rootmat, goalinv);
|
||||||
|
|
||||||
VECCOPY(goalpos, goal[3]);
|
copy_v3_v3(goalpos, goal[3]);
|
||||||
copy_m3_m4(goalrot, goal);
|
copy_m3_m4(goalrot, goal);
|
||||||
|
|
||||||
/* same for pole vector target */
|
/* same for pole vector target */
|
||||||
@ -372,7 +372,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mul_m4_m4m4(goal, rootmat, goalinv);
|
mul_m4_m4m4(goal, rootmat, goalinv);
|
||||||
VECCOPY(polepos, goal[3]);
|
copy_v3_v3(polepos, goal[3]);
|
||||||
poleconstrain= 1;
|
poleconstrain= 1;
|
||||||
|
|
||||||
/* for pole targets, we blend the result of the ik solver
|
/* for pole targets, we blend the result of the ik solver
|
||||||
@ -398,7 +398,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
|
|||||||
|
|
||||||
/* end effector in world space */
|
/* end effector in world space */
|
||||||
copy_m4_m4(end_pose, pchan->pose_mat);
|
copy_m4_m4(end_pose, pchan->pose_mat);
|
||||||
VECCOPY(end_pose[3], pchan->pose_tail);
|
copy_v3_v3(end_pose[3], pchan->pose_tail);
|
||||||
mul_serie_m4(world_pose, goalinv, ob->obmat, end_pose, NULL, NULL, NULL, NULL, NULL);
|
mul_serie_m4(world_pose, goalinv, ob->obmat, end_pose, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
/* blend position */
|
/* blend position */
|
||||||
|
@ -558,7 +558,7 @@ static bool target_callback(const iTaSC::Timestamp& timestamp, const iTaSC::Fram
|
|||||||
pchan = pchan->parent;
|
pchan = pchan->parent;
|
||||||
float chanmat[4][4];
|
float chanmat[4][4];
|
||||||
copy_m4_m4(chanmat, pchan->pose_mat);
|
copy_m4_m4(chanmat, pchan->pose_mat);
|
||||||
VECCOPY(chanmat[3], pchan->pose_tail);
|
copy_v3_v3(chanmat[3], pchan->pose_tail);
|
||||||
mul_serie_m4(restmat, target->owner->obmat, chanmat, target->eeRest, NULL, NULL, NULL, NULL, NULL);
|
mul_serie_m4(restmat, target->owner->obmat, chanmat, target->eeRest, NULL, NULL, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -585,7 +585,7 @@ static bool base_callback(const iTaSC::Timestamp& timestamp, const iTaSC::Frame&
|
|||||||
pchan = pchan->parent;
|
pchan = pchan->parent;
|
||||||
float chanmat[4][4];
|
float chanmat[4][4];
|
||||||
copy_m4_m4(chanmat, pchan->pose_mat);
|
copy_m4_m4(chanmat, pchan->pose_mat);
|
||||||
VECCOPY(chanmat[3], pchan->pose_tail);
|
copy_v3_v3(chanmat[3], pchan->pose_tail);
|
||||||
// save the base as a frame too so that we can compute deformation
|
// save the base as a frame too so that we can compute deformation
|
||||||
// after simulation
|
// after simulation
|
||||||
ikscene->baseFrame.setValue(&chanmat[0][0]);
|
ikscene->baseFrame.setValue(&chanmat[0][0]);
|
||||||
@ -1662,12 +1662,12 @@ static void execute_scene(Scene* blscene, IK_Scene* ikscene, bItasc* ikparam, fl
|
|||||||
pchan = ikchan->pchan;
|
pchan = ikchan->pchan;
|
||||||
// tail mat
|
// tail mat
|
||||||
ikchan->frame.getValue(&pchan->pose_mat[0][0]);
|
ikchan->frame.getValue(&pchan->pose_mat[0][0]);
|
||||||
VECCOPY(pchan->pose_tail, pchan->pose_mat[3]);
|
copy_v3_v3(pchan->pose_tail, pchan->pose_mat[3]);
|
||||||
// shift to head
|
// shift to head
|
||||||
VECCOPY(yaxis, pchan->pose_mat[1]);
|
copy_v3_v3(yaxis, pchan->pose_mat[1]);
|
||||||
mul_v3_fl(yaxis, length);
|
mul_v3_fl(yaxis, length);
|
||||||
sub_v3_v3v3(pchan->pose_mat[3], pchan->pose_mat[3], yaxis);
|
sub_v3_v3v3(pchan->pose_mat[3], pchan->pose_mat[3], yaxis);
|
||||||
VECCOPY(pchan->pose_head, pchan->pose_mat[3]);
|
copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]);
|
||||||
// add scale
|
// add scale
|
||||||
mul_v3_fl(pchan->pose_mat[0], scale);
|
mul_v3_fl(pchan->pose_mat[0], scale);
|
||||||
mul_v3_fl(pchan->pose_mat[1], scale);
|
mul_v3_fl(pchan->pose_mat[1], scale);
|
||||||
|
@ -283,7 +283,7 @@ static void rna_EditBone_connected_check(EditBone *ebone)
|
|||||||
if(ebone->parent) {
|
if(ebone->parent) {
|
||||||
if(ebone->flag & BONE_CONNECTED) {
|
if(ebone->flag & BONE_CONNECTED) {
|
||||||
/* Attach this bone to its parent */
|
/* Attach this bone to its parent */
|
||||||
VECCOPY(ebone->head, ebone->parent->tail);
|
copy_v3_v3(ebone->head, ebone->parent->tail);
|
||||||
|
|
||||||
if(ebone->flag & BONE_ROOTSEL)
|
if(ebone->flag & BONE_ROOTSEL)
|
||||||
ebone->parent->flag |= BONE_TIPSEL;
|
ebone->parent->flag |= BONE_TIPSEL;
|
||||||
@ -350,7 +350,7 @@ static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values)
|
|||||||
sub_v3_v3v3(delta, ebone->tail, ebone->head);
|
sub_v3_v3v3(delta, ebone->tail, ebone->head);
|
||||||
vec_roll_to_mat3(delta, ebone->roll, tmat);
|
vec_roll_to_mat3(delta, ebone->roll, tmat);
|
||||||
copy_m4_m3(mat, tmat);
|
copy_m4_m3(mat, tmat);
|
||||||
VECCOPY(mat[3], ebone->head);
|
copy_v3_v3(mat[3], ebone->head);
|
||||||
|
|
||||||
memcpy(values, mat, 16 * sizeof(float));
|
memcpy(values, mat, 16 * sizeof(float));
|
||||||
}
|
}
|
||||||
@ -363,12 +363,12 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po
|
|||||||
|
|
||||||
/* update our parent */
|
/* update our parent */
|
||||||
if(ebone->parent && ebone->flag & BONE_CONNECTED)
|
if(ebone->parent && ebone->flag & BONE_CONNECTED)
|
||||||
VECCOPY(ebone->parent->tail, ebone->head)
|
copy_v3_v3(ebone->parent->tail, ebone->head);
|
||||||
|
|
||||||
/* update our children if necessary */
|
/* update our children if necessary */
|
||||||
for(child = arm->edbo->first; child; child=child->next)
|
for(child = arm->edbo->first; child; child=child->next)
|
||||||
if(child->parent == ebone && (child->flag & BONE_CONNECTED))
|
if(child->parent == ebone && (child->flag & BONE_CONNECTED))
|
||||||
VECCOPY(child->head, ebone->tail);
|
copy_v3_v3(child->head, ebone->tail);
|
||||||
|
|
||||||
if(arm->flag & ARM_MIRROR_EDIT) {
|
if(arm->flag & ARM_MIRROR_EDIT) {
|
||||||
eboflip= ED_armature_bone_get_mirrored(arm->edbo, ebone);
|
eboflip= ED_armature_bone_get_mirrored(arm->edbo, ebone);
|
||||||
@ -381,12 +381,12 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po
|
|||||||
|
|
||||||
/* update our parent */
|
/* update our parent */
|
||||||
if(eboflip->parent && eboflip->flag & BONE_CONNECTED)
|
if(eboflip->parent && eboflip->flag & BONE_CONNECTED)
|
||||||
VECCOPY(eboflip->parent->tail, eboflip->head);
|
copy_v3_v3(eboflip->parent->tail, eboflip->head);
|
||||||
|
|
||||||
/* update our children if necessary */
|
/* update our children if necessary */
|
||||||
for(child = arm->edbo->first; child; child=child->next)
|
for(child = arm->edbo->first; child; child=child->next)
|
||||||
if(child->parent == eboflip && (child->flag & BONE_CONNECTED))
|
if(child->parent == eboflip && (child->flag & BONE_CONNECTED))
|
||||||
VECCOPY (child->head, eboflip->tail);
|
copy_v3_v3 (child->head, eboflip->tail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
/* vector defines */
|
/* vector defines */
|
||||||
|
|
||||||
#define CROSS(dest, a, b) { dest[0]= a[1] * b[2] - a[2] * b[1]; dest[1]= a[2] * b[0] - a[0] * b[2]; dest[2]= a[0] * b[1] - a[1] * b[0]; }
|
#define CROSS(dest, a, b) { dest[0]= a[1] * b[2] - a[2] * b[1]; dest[1]= a[2] * b[0] - a[0] * b[2]; dest[2]= a[0] * b[1] - a[1] * b[0]; }
|
||||||
#define VECMUL(dest, f) { dest[0]*= f; dest[1]*= f; dest[2]*= f; }
|
|
||||||
|
|
||||||
struct HaloRen;
|
struct HaloRen;
|
||||||
struct ShadeInput;
|
struct ShadeInput;
|
||||||
|
@ -704,7 +704,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* rotate to envmap space, if object is set */
|
/* rotate to envmap space, if object is set */
|
||||||
VECCOPY(vec, texvec);
|
copy_v3_v3(vec, texvec);
|
||||||
if(env->object) mul_m3_v3(env->obimat, vec);
|
if(env->object) mul_m3_v3(env->obimat, vec);
|
||||||
else mul_mat3_m4_v3(R.viewinv, vec);
|
else mul_mat3_m4_v3(R.viewinv, vec);
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ static void ibuf_get_color(float *col, struct ImBuf *ibuf, int x, int y)
|
|||||||
}
|
}
|
||||||
else if(ibuf->channels==3) {
|
else if(ibuf->channels==3) {
|
||||||
float *fp= ibuf->rect_float + 3*ofs;
|
float *fp= ibuf->rect_float + 3*ofs;
|
||||||
VECCOPY(col, fp);
|
copy_v3_v3(col, fp);
|
||||||
col[3]= 1.0f;
|
col[3]= 1.0f;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -84,7 +84,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
|
|||||||
|
|
||||||
ir= ig= ib= 0.0;
|
ir= ig= ib= 0.0;
|
||||||
|
|
||||||
VECCOPY(rco, har->co);
|
copy_v3_v3(rco, har->co);
|
||||||
dco[0]=dco[1]=dco[2]= 1.0f/har->rad;
|
dco[0]=dco[1]=dco[2]= 1.0f/har->rad;
|
||||||
|
|
||||||
vn= har->no;
|
vn= har->no;
|
||||||
@ -97,7 +97,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
|
|||||||
|
|
||||||
/* lampdist cacluation */
|
/* lampdist cacluation */
|
||||||
if(lar->type==LA_SUN || lar->type==LA_HEMI) {
|
if(lar->type==LA_SUN || lar->type==LA_HEMI) {
|
||||||
VECCOPY(lv, lar->vec);
|
copy_v3_v3(lv, lar->vec);
|
||||||
lampdist= 1.0;
|
lampdist= 1.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -146,7 +146,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
|
|||||||
memset(&shi, 0, sizeof(ShadeInput));
|
memset(&shi, 0, sizeof(ShadeInput));
|
||||||
/* end warning! - Campbell */
|
/* end warning! - Campbell */
|
||||||
|
|
||||||
VECCOPY(shi.co, rco);
|
copy_v3_v3(shi.co, rco);
|
||||||
shi.osatex= 0;
|
shi.osatex= 0;
|
||||||
do_lamp_tex(lar, lv, &shi, lacol, LA_TEXTURE);
|
do_lamp_tex(lar, lv, &shi, lacol, LA_TEXTURE);
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
|
|||||||
float x, lvrot[3];
|
float x, lvrot[3];
|
||||||
|
|
||||||
/* rotate view to lampspace */
|
/* rotate view to lampspace */
|
||||||
VECCOPY(lvrot, lv);
|
copy_v3_v3(lvrot, lv);
|
||||||
mul_m3_v3(lar->imat, lvrot);
|
mul_m3_v3(lar->imat, lvrot);
|
||||||
|
|
||||||
x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2]));
|
x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2]));
|
||||||
@ -610,7 +610,7 @@ void shadeSkyPixel(float collector[4], float fx, float fy, short thread)
|
|||||||
|
|
||||||
if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
|
if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
|
||||||
/* 1. solid color */
|
/* 1. solid color */
|
||||||
VECCOPY(collector, &R.wrld.horr);
|
copy_v3_v3(collector, &R.wrld.horr);
|
||||||
|
|
||||||
collector[3] = 0.0f;
|
collector[3] = 0.0f;
|
||||||
}
|
}
|
||||||
|
@ -153,7 +153,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
|
|||||||
state.time = cfra;
|
state.time = cfra;
|
||||||
if(psys_get_particle_state(&sim, i, &state, 0)) {
|
if(psys_get_particle_state(&sim, i, &state, 0)) {
|
||||||
|
|
||||||
VECCOPY(partco, state.co);
|
copy_v3_v3(partco, state.co);
|
||||||
|
|
||||||
if (pd->psys_cache_space == TEX_PD_OBJECTSPACE)
|
if (pd->psys_cache_space == TEX_PD_OBJECTSPACE)
|
||||||
mul_m4_v3(ob->imat, partco);
|
mul_m4_v3(ob->imat, partco);
|
||||||
@ -217,7 +217,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob)
|
|||||||
for(i=0; i < pd->totpoints; i++, mvert++) {
|
for(i=0; i < pd->totpoints; i++, mvert++) {
|
||||||
float co[3];
|
float co[3];
|
||||||
|
|
||||||
VECCOPY(co, mvert->co);
|
copy_v3_v3(co, mvert->co);
|
||||||
|
|
||||||
switch(pd->ob_cache_space) {
|
switch(pd->ob_cache_space) {
|
||||||
case TEX_PD_OBJECTSPACE:
|
case TEX_PD_OBJECTSPACE:
|
||||||
@ -423,7 +423,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
|
|||||||
(pd->flag&TEX_PD_FALLOFF_CURVE ? pd->falloff_curve : NULL), pd->falloff_speed_scale*0.001f);
|
(pd->flag&TEX_PD_FALLOFF_CURVE ? pd->falloff_curve : NULL), pd->falloff_speed_scale*0.001f);
|
||||||
noise_fac = pd->noise_fac * 0.5f; /* better default */
|
noise_fac = pd->noise_fac * 0.5f; /* better default */
|
||||||
|
|
||||||
VECCOPY(co, texvec);
|
copy_v3_v3(co, texvec);
|
||||||
|
|
||||||
if (point_data_used(pd)) {
|
if (point_data_used(pd)) {
|
||||||
/* does a BVH lookup to find accumulated density and additional point data *
|
/* does a BVH lookup to find accumulated density and additional point data *
|
||||||
@ -480,7 +480,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
|
|||||||
if (pd->coba) {
|
if (pd->coba) {
|
||||||
if (do_colorband(pd->coba, age, col)) {
|
if (do_colorband(pd->coba, age, col)) {
|
||||||
texres->talpha= 1;
|
texres->talpha= 1;
|
||||||
VECCOPY(&texres->tr, col);
|
copy_v3_v3(&texres->tr, col);
|
||||||
texres->tin *= col[3];
|
texres->tin *= col[3];
|
||||||
texres->ta = texres->tin;
|
texres->ta = texres->tin;
|
||||||
}
|
}
|
||||||
@ -493,7 +493,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
|
|||||||
if (pd->coba) {
|
if (pd->coba) {
|
||||||
if (do_colorband(pd->coba, speed, col)) {
|
if (do_colorband(pd->coba, speed, col)) {
|
||||||
texres->talpha= 1;
|
texres->talpha= 1;
|
||||||
VECCOPY(&texres->tr, col);
|
copy_v3_v3(&texres->tr, col);
|
||||||
texres->tin *= col[3];
|
texres->tin *= col[3];
|
||||||
texres->ta = texres->tin;
|
texres->ta = texres->tin;
|
||||||
}
|
}
|
||||||
@ -503,7 +503,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
|
|||||||
case TEX_PD_COLOR_PARTVEL:
|
case TEX_PD_COLOR_PARTVEL:
|
||||||
texres->talpha= 1;
|
texres->talpha= 1;
|
||||||
mul_v3_fl(vec, pd->speed_scale);
|
mul_v3_fl(vec, pd->speed_scale);
|
||||||
VECCOPY(&texres->tr, vec);
|
copy_v3_v3(&texres->tr, vec);
|
||||||
texres->ta = texres->tin;
|
texres->ta = texres->tin;
|
||||||
break;
|
break;
|
||||||
case TEX_PD_COLOR_CONSTANT:
|
case TEX_PD_COLOR_CONSTANT:
|
||||||
|
@ -768,18 +768,17 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
VECCOPY(tmp_rgb, rgbrect);
|
copy_v3_v3(tmp_rgb, rgbrect);
|
||||||
if(rgbrect[3]!=1.0f) { /* de-premul */
|
if(rgbrect[3]!=1.0f) { /* de-premul */
|
||||||
float div= 1.0f/rgbrect[3];
|
mul_v3_fl(tmp_rgb, 1.0f/rgbrect[3]);
|
||||||
VECMUL(tmp_rgb, div);
|
|
||||||
}
|
}
|
||||||
shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
|
shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
|
||||||
if(rgbrect[3]!=1.0f) { /* premul */
|
if(rgbrect[3]!=1.0f) { /* premul */
|
||||||
VECMUL(tmp_rgb, rgbrect[3]);
|
mul_v3_fl(tmp_rgb, rgbrect[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(done==0) {
|
if(done==0) {
|
||||||
VECCOPY(rgb, tmp_rgb);
|
copy_v3_v3(rgb, tmp_rgb);
|
||||||
done = 1;
|
done = 1;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -793,7 +792,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
|
|||||||
|
|
||||||
/* if at least for one sun lamp aerial perspective was applied*/
|
/* if at least for one sun lamp aerial perspective was applied*/
|
||||||
if(done) {
|
if(done) {
|
||||||
VECCOPY(rgbrect, rgb);
|
copy_v3_v3(rgbrect, rgb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1533,13 +1532,13 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
|
|||||||
then clamp to avoid a too large contribution from a single pixel */
|
then clamp to avoid a too large contribution from a single pixel */
|
||||||
shi->osatex= 1;
|
shi->osatex= 1;
|
||||||
|
|
||||||
VECCOPY(nor, shi->facenor);
|
copy_v3_v3(nor, shi->facenor);
|
||||||
calc_view_vector(shi->facenor, sx, sy);
|
calc_view_vector(shi->facenor, sx, sy);
|
||||||
normalize_v3(shi->facenor);
|
normalize_v3(shi->facenor);
|
||||||
shade_input_set_viewco(shi, x, y, sx, sy, z);
|
shade_input_set_viewco(shi, x, y, sx, sy, z);
|
||||||
orthoarea= len_v3(shi->dxco)*len_v3(shi->dyco);
|
orthoarea= len_v3(shi->dxco)*len_v3(shi->dyco);
|
||||||
|
|
||||||
VECCOPY(shi->facenor, nor);
|
copy_v3_v3(shi->facenor, nor);
|
||||||
shade_input_set_viewco(shi, x, y, sx, sy, z);
|
shade_input_set_viewco(shi, x, y, sx, sy, z);
|
||||||
*area= len_v3(shi->dxco)*len_v3(shi->dyco);
|
*area= len_v3(shi->dxco)*len_v3(shi->dyco);
|
||||||
*area= MIN2(*area, 2.0f*orthoarea);
|
*area= MIN2(*area, 2.0f*orthoarea);
|
||||||
@ -1572,8 +1571,8 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
|
|||||||
shade_samples_do_AO(ssamp);
|
shade_samples_do_AO(ssamp);
|
||||||
shade_material_loop(shi, &shr);
|
shade_material_loop(shi, &shr);
|
||||||
|
|
||||||
VECCOPY(co, shi->co);
|
copy_v3_v3(co, shi->co);
|
||||||
VECCOPY(color, shr.combined);
|
copy_v3_v3(color, shr.combined);
|
||||||
|
|
||||||
/* texture blending */
|
/* texture blending */
|
||||||
/* texfac= shi->mat->sss_texfac; */ /* UNUSED */
|
/* texfac= shi->mat->sss_texfac; */ /* UNUSED */
|
||||||
@ -1711,7 +1710,7 @@ void zbufshade_sss_tile(RenderPart *pa)
|
|||||||
|
|
||||||
totpoint++;
|
totpoint++;
|
||||||
|
|
||||||
VECADD(fcol, fcol, color);
|
add_v3_v3(fcol, color);
|
||||||
fcol[3]= 1.0f;
|
fcol[3]= 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1730,7 +1729,7 @@ void zbufshade_sss_tile(RenderPart *pa)
|
|||||||
shade_sample_sss(&ssamp, mat, obi, vlr, quad, x, y, *rz,
|
shade_sample_sss(&ssamp, mat, obi, vlr, quad, x, y, *rz,
|
||||||
co[totpoint], color[totpoint], &area[totpoint]);
|
co[totpoint], color[totpoint], &area[totpoint]);
|
||||||
|
|
||||||
VECADD(fcol, fcol, color[totpoint]);
|
add_v3_v3(fcol, color[totpoint]);
|
||||||
fcol[3]= 1.0f;
|
fcol[3]= 1.0f;
|
||||||
totpoint++;
|
totpoint++;
|
||||||
}
|
}
|
||||||
@ -1753,7 +1752,7 @@ void zbufshade_sss_tile(RenderPart *pa)
|
|||||||
/* to indicate this is a back sample */
|
/* to indicate this is a back sample */
|
||||||
area[totpoint]= -area[totpoint];
|
area[totpoint]= -area[totpoint];
|
||||||
|
|
||||||
VECADD(fcol, fcol, color[totpoint]);
|
add_v3_v3(fcol, color[totpoint]);
|
||||||
fcol[3]= 1.0f;
|
fcol[3]= 1.0f;
|
||||||
totpoint++;
|
totpoint++;
|
||||||
}
|
}
|
||||||
@ -2068,7 +2067,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
|
|||||||
if(bs->type==RE_BAKE_NORMALS) {
|
if(bs->type==RE_BAKE_NORMALS) {
|
||||||
float nor[3];
|
float nor[3];
|
||||||
|
|
||||||
VECCOPY(nor, shi->vn);
|
copy_v3_v3(nor, shi->vn);
|
||||||
|
|
||||||
if(R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
|
if(R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
|
||||||
else if(R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
|
else if(R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
|
||||||
@ -2076,16 +2075,16 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
|
|||||||
|
|
||||||
/* bitangent */
|
/* bitangent */
|
||||||
if(tvn && ttang) {
|
if(tvn && ttang) {
|
||||||
VECCOPY(mat[0], ttang);
|
copy_v3_v3(mat[0], ttang);
|
||||||
cross_v3_v3v3(mat[1], tvn, ttang);
|
cross_v3_v3v3(mat[1], tvn, ttang);
|
||||||
mul_v3_fl(mat[1], ttang[3]);
|
mul_v3_fl(mat[1], ttang[3]);
|
||||||
VECCOPY(mat[2], tvn);
|
copy_v3_v3(mat[2], tvn);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VECCOPY(mat[0], shi->nmaptang);
|
copy_v3_v3(mat[0], shi->nmaptang);
|
||||||
cross_v3_v3v3(mat[1], shi->nmapnorm, shi->nmaptang);
|
cross_v3_v3v3(mat[1], shi->nmapnorm, shi->nmaptang);
|
||||||
mul_v3_fl(mat[1], shi->nmaptang[3]);
|
mul_v3_fl(mat[1], shi->nmaptang[3]);
|
||||||
VECCOPY(mat[2], shi->nmapnorm);
|
copy_v3_v3(mat[2], shi->nmapnorm);
|
||||||
}
|
}
|
||||||
|
|
||||||
invert_m3_m3(imat, mat);
|
invert_m3_m3(imat, mat);
|
||||||
@ -2115,7 +2114,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
|
|||||||
shr.alpha = shi->alpha;
|
shr.alpha = shi->alpha;
|
||||||
}
|
}
|
||||||
else if(bs->type==RE_BAKE_SHADOW) {
|
else if(bs->type==RE_BAKE_SHADOW) {
|
||||||
VECCOPY(shr.combined, shr.shad);
|
copy_v3_v3(shr.combined, shr.shad);
|
||||||
shr.alpha = shi->alpha;
|
shr.alpha = shi->alpha;
|
||||||
}
|
}
|
||||||
else if(bs->type==RE_BAKE_SPEC_COLOR) {
|
else if(bs->type==RE_BAKE_SPEC_COLOR) {
|
||||||
@ -2158,7 +2157,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
|
|||||||
|
|
||||||
if(bs->rect_float) {
|
if(bs->rect_float) {
|
||||||
float *col= bs->rect_float + 4*(bs->rectx*y + x);
|
float *col= bs->rect_float + 4*(bs->rectx*y + x);
|
||||||
VECCOPY(col, shr.combined);
|
copy_v3_v3(col, shr.combined);
|
||||||
if (bs->type==RE_BAKE_ALL || bs->type==RE_BAKE_TEXTURE) {
|
if (bs->type==RE_BAKE_ALL || bs->type==RE_BAKE_TEXTURE) {
|
||||||
col[3]= shr.alpha;
|
col[3]= shr.alpha;
|
||||||
} else {
|
} else {
|
||||||
@ -2336,15 +2335,15 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
|
|||||||
if(obi->flag & R_TRANSFORMED)
|
if(obi->flag & R_TRANSFORMED)
|
||||||
mul_m4_v3(obi->mat, shi->co);
|
mul_m4_v3(obi->mat, shi->co);
|
||||||
|
|
||||||
VECCOPY(shi->dxco, bs->dxco);
|
copy_v3_v3(shi->dxco, bs->dxco);
|
||||||
VECCOPY(shi->dyco, bs->dyco);
|
copy_v3_v3(shi->dyco, bs->dyco);
|
||||||
|
|
||||||
quad= bs->quad;
|
quad= bs->quad;
|
||||||
bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v);
|
bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v);
|
||||||
|
|
||||||
if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
|
if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
|
||||||
shade_input_set_shade_texco(shi);
|
shade_input_set_shade_texco(shi);
|
||||||
VECCOPY(tvn, shi->nmapnorm);
|
copy_v3_v3(tvn, shi->nmapnorm);
|
||||||
copy_v4_v4(ttang, shi->nmaptang);
|
copy_v4_v4(ttang, shi->nmaptang);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2359,7 +2358,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
|
|||||||
memset(&minisec, 0, sizeof(minisec));
|
memset(&minisec, 0, sizeof(minisec));
|
||||||
minco[0]= minco[1]= minco[2]= 0.0f;
|
minco[0]= minco[1]= minco[2]= 0.0f;
|
||||||
|
|
||||||
VECCOPY(bs->dir, shi->vn);
|
copy_v3_v3(bs->dir, shi->vn);
|
||||||
|
|
||||||
for(sign=-1; sign<=1; sign+=2) {
|
for(sign=-1; sign<=1; sign+=2) {
|
||||||
memset(&isec, 0, sizeof(isec));
|
memset(&isec, 0, sizeof(isec));
|
||||||
@ -2375,7 +2374,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
|
|||||||
if(!hit || len_v3v3(shi->co, co) < len_v3v3(shi->co, minco)) {
|
if(!hit || len_v3v3(shi->co, co) < len_v3v3(shi->co, minco)) {
|
||||||
minisec= isec;
|
minisec= isec;
|
||||||
mindist= dist;
|
mindist= dist;
|
||||||
VECCOPY(minco, co);
|
copy_v3_v3(minco, co);
|
||||||
hit= 1;
|
hit= 1;
|
||||||
dir = sign;
|
dir = sign;
|
||||||
}
|
}
|
||||||
@ -2395,7 +2394,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
|
|||||||
obi= (ObjectInstanceRen*)minisec.hit.ob;
|
obi= (ObjectInstanceRen*)minisec.hit.ob;
|
||||||
vlr= (VlakRen*)minisec.hit.face;
|
vlr= (VlakRen*)minisec.hit.face;
|
||||||
quad= (minisec.isect == 2);
|
quad= (minisec.isect == 2);
|
||||||
VECCOPY(shi->co, minco);
|
copy_v3_v3(shi->co, minco);
|
||||||
|
|
||||||
u= -minisec.u;
|
u= -minisec.u;
|
||||||
v= -minisec.v;
|
v= -minisec.v;
|
||||||
|
@ -672,7 +672,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
|
|||||||
else ver++;
|
else ver++;
|
||||||
|
|
||||||
if(clipflag[a]) {
|
if(clipflag[a]) {
|
||||||
VECCOPY(vec, ver->co);
|
copy_v3_v3(vec, ver->co);
|
||||||
mul_m4_v3(obviewmat, vec);
|
mul_m4_v3(obviewmat, vec);
|
||||||
/* Z on visible side of lamp space */
|
/* Z on visible side of lamp space */
|
||||||
if(vec[2] < 0.0f) {
|
if(vec[2] < 0.0f) {
|
||||||
@ -2063,7 +2063,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
|
|||||||
float dface, fac, siz;
|
float dface, fac, siz;
|
||||||
|
|
||||||
RE_vlakren_get_normal(&R, obi, vlr, nor);
|
RE_vlakren_get_normal(&R, obi, vlr, nor);
|
||||||
VECCOPY(v1, vlr->v1->co);
|
copy_v3_v3(v1, vlr->v1->co);
|
||||||
if(obi->flag & R_TRANSFORMED)
|
if(obi->flag & R_TRANSFORMED)
|
||||||
mul_m4_v3(obi->mat, v1);
|
mul_m4_v3(obi->mat, v1);
|
||||||
|
|
||||||
@ -2463,7 +2463,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
|
|||||||
samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
|
samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
|
||||||
samp->shadfac= &apn->shadfac[a];
|
samp->shadfac= &apn->shadfac[a];
|
||||||
|
|
||||||
VECCOPY(samp->zco, zco);
|
copy_v3_v3(samp->zco, zco);
|
||||||
bound_rectf((rctf *)&root.box, samp->zco);
|
bound_rectf((rctf *)&root.box, samp->zco);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2479,7 +2479,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
|
|||||||
samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
|
samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
|
||||||
samp->shadfac= &apn->shadfac[a];
|
samp->shadfac= &apn->shadfac[a];
|
||||||
|
|
||||||
VECCOPY(samp->zco, zco);
|
copy_v3_v3(samp->zco, zco);
|
||||||
bound_rectf((rctf *)&root.box, samp->zco);
|
bound_rectf((rctf *)&root.box, samp->zco);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,8 +127,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
|
|||||||
if(shi->passflag & SCE_PASS_SHADOW)
|
if(shi->passflag & SCE_PASS_SHADOW)
|
||||||
VECADDISFAC(shr->shad, shr_t.shad, fac);
|
VECADDISFAC(shr->shad, shr_t.shad, fac);
|
||||||
|
|
||||||
VECMUL(shi->vn, -1.0f);
|
negate_v3(shi->vn);
|
||||||
VECMUL(shi->facenor, -1.0f);
|
negate_v3(shi->facenor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* depth >= 1 when ray-shading */
|
/* depth >= 1 when ray-shading */
|
||||||
|
@ -139,12 +139,9 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
|
|||||||
spoint->dtco[1]= data[0]*p[0][1] + data[1]*p[1][1] + data[2]*p[2][1] + data[3]*p[3][1];
|
spoint->dtco[1]= data[0]*p[0][1] + data[1]*p[1][1] + data[2]*p[2][1] + data[3]*p[3][1];
|
||||||
spoint->dtco[2]= data[0]*p[0][2] + data[1]*p[1][2] + data[2]*p[2][2] + data[3]*p[3][2];
|
spoint->dtco[2]= data[0]*p[0][2] + data[1]*p[1][2] + data[2]*p[2][2] + data[3]*p[3][2];
|
||||||
|
|
||||||
copy_v3_v3(spoint->tan, spoint->dtco);
|
normalize_v3_v3(spoint->tan, spoint->dtco);
|
||||||
normalize_v3(spoint->tan);
|
normalize_v3_v3(spoint->nor, spoint->co);
|
||||||
|
negate_v3(spoint->nor);
|
||||||
copy_v3_v3(spoint->nor, spoint->co);
|
|
||||||
VECMUL(spoint->nor, -1.0f);
|
|
||||||
normalize_v3(spoint->nor);
|
|
||||||
|
|
||||||
spoint->width= strand_eval_width(ma, spoint->strandco);
|
spoint->width= strand_eval_width(ma, spoint->strandco);
|
||||||
|
|
||||||
|
@ -623,7 +623,7 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob
|
|||||||
|
|
||||||
copy_v3_v3(pa->bbmin, bbmin);
|
copy_v3_v3(pa->bbmin, bbmin);
|
||||||
copy_v3_v3(pa->voxel, voxel);
|
copy_v3_v3(pa->voxel, voxel);
|
||||||
VECCOPY(pa->res, res); /* int's */
|
copy_v3_v3_int(pa->res, res);
|
||||||
|
|
||||||
pa->minx = minx; pa->maxx = maxx;
|
pa->minx = minx; pa->maxx = maxx;
|
||||||
pa->miny = miny; pa->maxy = maxy;
|
pa->miny = miny; pa->maxy = maxy;
|
||||||
|
@ -241,7 +241,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
|
|||||||
size_t i;
|
size_t i;
|
||||||
float *heat;
|
float *heat;
|
||||||
|
|
||||||
VECCOPY(vd->resol, smd->domain->res);
|
copy_v3_v3_int(vd->resol, smd->domain->res);
|
||||||
totRes= vd_resol_size(vd);
|
totRes= vd_resol_size(vd);
|
||||||
|
|
||||||
// scaling heat values from -2.0-2.0 to 0.0-1.0
|
// scaling heat values from -2.0-2.0 to 0.0-1.0
|
||||||
@ -262,7 +262,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
|
|||||||
size_t i;
|
size_t i;
|
||||||
float *xvel, *yvel, *zvel;
|
float *xvel, *yvel, *zvel;
|
||||||
|
|
||||||
VECCOPY(vd->resol, smd->domain->res);
|
copy_v3_v3_int(vd->resol, smd->domain->res);
|
||||||
totRes= vd_resol_size(vd);
|
totRes= vd_resol_size(vd);
|
||||||
|
|
||||||
// scaling heat values from -2.0-2.0 to 0.0-1.0
|
// scaling heat values from -2.0-2.0 to 0.0-1.0
|
||||||
@ -286,7 +286,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
|
|||||||
smoke_turbulence_get_res(smd->domain->wt, vd->resol);
|
smoke_turbulence_get_res(smd->domain->wt, vd->resol);
|
||||||
density = smoke_turbulence_get_density(smd->domain->wt);
|
density = smoke_turbulence_get_density(smd->domain->wt);
|
||||||
} else {
|
} else {
|
||||||
VECCOPY(vd->resol, smd->domain->res);
|
copy_v3_v3_int(vd->resol, smd->domain->res);
|
||||||
density = smoke_get_density(smd->domain->fluid);
|
density = smoke_get_density(smd->domain->fluid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user