Esempio n. 1
0
void s4_concmat(Stack4 *s, Matrix4 *md, Matrix4 *im)
{
  *s->mtop = m4_m4prod(*md, *s->mtop );
  if ( im == (Matrix4 *)0)
    *s->itop = m4_m4prod(*s->itop, m4_inverse(*md));
  else
    *s->itop = m4_m4prod(*s->itop, *im);
}
Esempio n. 2
0
void anm_get_inv_matrix(struct anm_node *node, mat4_t mat, anm_time_t tm)
{
    struct mat_cache *cache = pthread_getspecific(node->cache_key);
    if(!cache) {
        cache = malloc(sizeof *cache);
        assert(cache);

        pthread_mutex_lock(&node->cache_list_lock);
        cache->next = node->cache_list;
        node->cache_list = cache;
        pthread_mutex_unlock(&node->cache_list_lock);

        cache->inv_time = ANM_TIME_INVAL;
        cache->inv_time = ANM_TIME_INVAL;
        pthread_setspecific(node->cache_key, cache);
    }

    if(cache->inv_time != tm) {
        anm_get_matrix(node, mat, tm);
        m4_inverse(cache->inv_matrix, mat);
        cache->inv_time = tm;
    }
    m4_copy(mat, cache->inv_matrix);
}
Esempio n. 3
0
void anm_get_node_inv_matrix(struct anm_node *node, mat4_t mat, anm_time_t tm)
{
    mat4_t tmp;
    anm_get_node_matrix(node, tmp, tm);
    m4_inverse(mat, tmp);
}
Esempio n. 4
0
void s4_loadmat(Stack4 *s, Matrix4 *md, Matrix4 *im)
{
  *s->mtop = *md;
  *s->itop = (im == (Matrix4 *)0)? m4_inverse(*md) : *im;
}