void Select_AplyMatrix (bool bSnap) { brush_t *b; face_t *f; int i, j; vec3_t temp; for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) { for (f=b->brush_faces ; f ; f=f->next) { for (i=0 ; i<3 ; i++) { VectorSubtract (f->planepts[i], select_origin, temp); for (j=0 ; j<3 ; j++) f->planepts[i][j] = DotProduct(temp, select_matrix[j]) + select_origin[j]; } if (select_fliporder) { VectorCopy (f->planepts[0], temp); VectorCopy (f->planepts[2], f->planepts[0]); VectorCopy (temp, f->planepts[2]); } } Brush_Build(b, bSnap); if (b->patchBrush) { Patch_ApplyMatrix(b->nPatchID, select_origin, select_matrix); } } }
void Select_ApplyMatrix( bool bSnap, bool bRotation, int nAxis, float fDeg ) { brush_s* b; face_s* f; int i, j; edVec3_c temp; for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next ) { for ( f = b->brush_faces ; f ; f = f->next ) { for ( i = 0 ; i < 3 ; i++ ) { temp = f->planepts[i] - select_origin; for ( j = 0 ; j < 3 ; j++ ) f->planepts[i][j] = temp.dotProduct( select_matrix[j] ) + select_origin[j]; } if ( select_fliporder ) { // swap the points temp = f->planepts[0]; f->planepts[0] = f->planepts[2]; f->planepts[2] = temp; } } //if(b->owner->eclass->fixedsize) //{ // if (bRotation && b->owner->md3Class) // { // b->owner->vRotation[nAxis] += fDeg; // } //} Brush_Build( b, bSnap ); if ( b->patchBrush ) { //Patch_ApplyMatrix(b->nPatchID, select_origin, select_matrix); Patch_ApplyMatrix( b->pPatch, select_origin, select_matrix, bSnap ); } //if (b->terrainBrush) //{ // Terrain_ApplyMatrix(b->pTerrain, select_origin, select_matrix, bSnap); //} } }
void Select_ApplyMatrix (bool bSnap, bool bRotation, int nAxis, float fDeg) { brush_t *b; face_t *f; int i, j; vec3_t temp; for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next) { for (f=b->brush_faces ; f ; f=f->next) { for (i=0 ; i<3 ; i++) { VectorSubtract (f->planepts[i], select_origin, temp); for (j=0 ; j<3 ; j++) f->planepts[i][j] = DotProduct(temp, select_matrix[j]) + select_origin[j]; } if (select_fliporder) { VectorCopy (f->planepts[0], temp); VectorCopy (f->planepts[2], f->planepts[0]); VectorCopy (temp, f->planepts[2]); } } if(b->owner->eclass->fixedsize) { if (bRotation && b->owner->md3Class) { b->owner->vRotation[nAxis] += fDeg; } } Brush_Build(b, bSnap); if (b->patchBrush) { //Patch_ApplyMatrix(b->nPatchID, select_origin, select_matrix); Patch_ApplyMatrix(b->pPatch, select_origin, select_matrix, bSnap); } if (b->terrainBrush) { Terrain_ApplyMatrix(b->pTerrain, select_origin, select_matrix, bSnap); } } }