void CCharShape::TraverseDagForShadow(const TCharNode *node, const TMatrix<4, 4>& mat) { TMatrix<4, 4> new_matrix = mat * node->trans; if (node->visible && node->render_shadow) DrawShadowSphere (new_matrix); TCharNode* child = node->child; while (child != NULL) { TraverseDagForShadow (child, new_matrix); child = child->next; } }
void CCharShape::DrawShadow () { if (g_game.light_id == 1 || g_game.light_id == 3) return; ScopedRenderMode rm(TUX_SHADOW); glColor(shad_col); TCharNode *node = GetNode(0); if (node == NULL) { Message ("couldn't find tux's root node"); return; } TraverseDagForShadow(node, TMatrix<4, 4>::getIdentity()); }
void CCharShape::TraverseDagForShadow (const TCharNode *node, const TMatrix mat) { TMatrix new_matrix; MultiplyMatrices (new_matrix, mat, node->trans); if (node->visible && node->render_shadow) DrawShadowSphere (new_matrix); TCharNode* child = node->child; while (child != NULL) { TraverseDagForShadow (child, new_matrix); child = child->next; } }
void CCharShape::DrawShadow () { TMatrix model_matrix; TCharNode *node; if (g_game.light_id == 1 || g_game.light_id == 3) return; set_gl_options (TUX_SHADOW); glColor4f (shad_col.r, shad_col.g, shad_col.b, shad_col.a); MakeIdentityMatrix (model_matrix); if (GetNode (0, &node) == false) { Message ("couldn't find tux's root node", ""); return; } TraverseDagForShadow (node, model_matrix); }
void CCharShape::DrawShadow () { TMatrix model_matrix; if (g_game.light_id == 1 || g_game.light_id == 3) return; ScopedRenderMode rm(TUX_SHADOW); glColor4f (shad_col.r, shad_col.g, shad_col.b, shad_col.a); MakeIdentityMatrix (model_matrix); TCharNode *node = GetNode(0); if (node == NULL) { Message ("couldn't find tux's root node", ""); return; } TraverseDagForShadow (node, model_matrix); }