bool ShadingAction::isVisible(Node *node) { if ( getFrustumCulling() == false ) return true; getStatistics()->getElem(statCullTestedNodes)->inc(); DynamicVolume vol; // node->getWorldVolume( vol ); node->updateVolume(); vol = node->getVolume(); vol.transform(top_matrix()); if ( _frustum.intersect( vol ) ) { // fprintf(stderr,"%p: node 0x%p vis\n", Thread::getCurrent(), node); return true; } getStatistics()->getElem(statCulledNodes)->inc(); // fprintf(stderr,"%p: node 0x%p invis\n", Thread::getCurrent(), node); // _frustum.dump(); return false; }
void gs_matrix_scale3f(float x, float y, float z) { struct matrix3 *top_mat = top_matrix(thread_graphics); struct vec3 p; vec3_set(&p, x, y, z); matrix3_scale(top_mat, top_mat, &p); }
void gs_matrix_rotaa4f(float x, float y, float z, float angle) { struct matrix3 *top_mat = top_matrix(thread_graphics); struct axisang aa; axisang_set(&aa, x, y, z, angle); matrix3_rotate_aa(top_mat, top_mat, &aa); }
void gs_matrix_push(void) { graphics_t graphics = thread_graphics; struct matrix3 mat, *top_mat = top_matrix(graphics); memcpy(&mat, top_mat, sizeof(struct matrix3)); da_push_back(graphics->matrix_stack, &mat); graphics->cur_matrix++; }
void gs_matrix_translate3f(float x, float y, float z) { struct matrix3 *top_mat = top_matrix(thread_graphics); struct vec3 p; if (top_mat) { vec3_set(&p, x, y, z); matrix3_translate(top_mat, top_mat, &p); } }
void ShadingAction::dropLight(Light *pLight) { #if 0 if(pLight != NULL) { LightStore oStore; pLight->makeChunk(); oStore.first = pLight->getChunk().getCPtr(); oStore.second = _currMatrix.second; Matrix fromworld,tobeacon; // getActNode()->getToWorld(fromworld); fromworld = top_matrix(); fromworld.invert(); NodePtr beacon = pLight->getBeacon(); if(beacon == NullFC) { SINFO << "draw: no beacon set!" << std::endl; } else { beacon->getToWorld(tobeacon); tobeacon.mult(fromworld); oStore.second.mult(tobeacon); } _vLights.push_back(oStore); } #endif }
void gs_matrix_scale(const struct vec3 *scale) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_scale(top_mat, top_mat, scale); }
void gs_matrix_translate(const struct vec3 *pos) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_translate(top_mat, top_mat, pos); }
void gs_matrix_rotaa(const struct axisang *rot) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_rotate_aa(top_mat, top_mat, rot); }
void gs_matrix_rotquat(const struct quat *rot) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_rotate(top_mat, top_mat, rot); }
void gs_matrix_mul(const struct matrix3 *matrix) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_mul(top_mat, top_mat, matrix); }
void gs_matrix_get(struct matrix3 *dst) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_copy(dst, top_mat); }
void gs_matrix_set(const struct matrix3 *matrix) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_copy(top_mat, matrix); }
void gs_matrix_transpose(void) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_transpose(top_mat, top_mat); }
void gs_matrix_identity(void) { struct matrix3 *top_mat = top_matrix(thread_graphics); matrix3_identity(top_mat); }