@@ -592,79 +592,6 @@ nif_project_vector2s(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
592
592
return result ;
593
593
}
594
594
595
- //-----------------------------------------------------------------------------
596
- // project a 2d vector by a matrix
597
- // static ERL_NIF_TERM
598
- // nif_project_vector3(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
599
- // ErlNifBinary mx_term;
600
- // float * mx;
601
- // float x, y, z;
602
-
603
- // // get the a matrix
604
- // if ( !enif_inspect_binary(env, argv[0], &mx_term) ) {return enif_make_badarg(env);}
605
- // if ( mx_term.size != MATRIX_SIZE ) {return enif_make_badarg(env);}
606
- // mx = (float*) mx_term.data;
607
-
608
- // // get the x, y, z of the vector
609
- // if ( !get_float_num(env, argv[1], &x) ) {return enif_make_badarg(env);}
610
- // if ( !get_float_num(env, argv[2], &y) ) {return enif_make_badarg(env);}
611
- // if ( !get_float_num(env, argv[3], &z) ) {return enif_make_badarg(env);}
612
-
613
- // // project the vector
614
- // matrix_project_vector3( mx, &x, &y, &z );
615
-
616
- // // return the result
617
- // return enif_make_tuple3(
618
- // env,
619
- // enif_make_double(env, x),
620
- // enif_make_double(env, y),
621
- // enif_make_double(env, z)
622
- // );
623
- // }
624
-
625
- //-----------------------------------------------------------------------------
626
- // project a packed 2d vector binary by a matrix
627
- // typedef struct { float x; float y; float z; } vector3_f;
628
- // static ERL_NIF_TERM
629
- // nif_project_vector3s(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
630
- // ERL_NIF_TERM result;
631
- // ErlNifBinary mx_term;
632
- // ErlNifBinary v_in_term;
633
- // float * mx;
634
- // int vector_count;
635
- // vector3_f* v_in;
636
- // vector3_f* v_out;
637
- // float x, y, z;
638
-
639
- // // get the matrix
640
- // if ( !enif_inspect_binary(env, argv[0], &mx_term) ) {return enif_make_badarg(env);}
641
- // if ( mx_term.size != MATRIX_SIZE ) {return enif_make_badarg(env);}
642
- // mx = (float*) mx_term.data;
643
-
644
- // // get the vectors
645
- // if ( !enif_inspect_binary(env, argv[1], &v_in_term) ) {return enif_make_badarg(env);}
646
- // if ( (v_in_term.size % (sizeof(float)*3)) != 0 ) {return enif_make_badarg(env);}
647
- // vector_count = v_in_term.size / (sizeof(float)*3);
648
- // v_in = (vector3_f*)v_in_term.data;
649
-
650
- // // allocate the outgoing vector binary
651
- // v_out = (vector3_f*)enif_make_new_binary(env, v_in_term.size, &result);
652
-
653
- // // fill in the answers
654
- // for ( int i = 0; i < vector_count; i++ ) {
655
- // x = v_in[i].x;
656
- // y = v_in[i].y;
657
- // z = v_in[i].z;
658
- // matrix_project_vector3( mx, &x, &y, &z );
659
- // v_out[i].x = x;
660
- // v_out[i].y = y;
661
- // v_out[i].z = z;
662
- // }
663
-
664
- // // return the resulting binary
665
- // return result;
666
- // }
667
-
668
595
//=============================================================================
669
596
// erl housekeeping. This is the list of functions available to the erl side
670
597
0 commit comments