Skip to content

Commit df0328e

Browse files
committed
Merge branch 'Nezteb-master'
2 parents 5ee6195 + 0cac032 commit df0328e

File tree

1 file changed

+0
-82
lines changed

1 file changed

+0
-82
lines changed

c_src/matrix.c

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ static const float matrix_identity[16] = {
2222

2323
#define MATRIX_SIZE (sizeof(float) * 16)
2424

25-
2625
//=============================================================================
2726
// utilities
2827

@@ -205,8 +204,6 @@ void matrix_project_vector3(float mx[], float* x, float* y, float* z) {
205204
*z = mx_out[11];
206205
}
207206

208-
209-
210207
//=============================================================================
211208
// Erlang NIF stuff from here down.
212209

@@ -241,7 +238,6 @@ nif_close(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
241238
}
242239
}
243240

244-
245241
//-----------------------------------------------------------------------------
246242
// add two matrices together. result is stored in a new matrix
247243

@@ -304,7 +300,6 @@ nif_subtract(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
304300
return result;
305301
}
306302

307-
308303
//-----------------------------------------------------------------------------
309304
// multiply two matrices together. result is stored in a new matrix
310305

@@ -336,7 +331,6 @@ nif_multiply(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
336331
return result;
337332
}
338333

339-
340334
//-----------------------------------------------------------------------------
341335
// multiply two matrices together. result is stored in a new matrix
342336

@@ -449,8 +443,6 @@ nif_divide_scalar(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
449443
return result;
450444
}
451445

452-
453-
454446
//-----------------------------------------------------------------------------
455447
// calculate the scalar determinant
456448

@@ -522,7 +514,6 @@ nif_adjugate(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
522514
return result;
523515
}
524516

525-
526517
//-----------------------------------------------------------------------------
527518
// project a 2d vector by a matrix
528519
static ERL_NIF_TERM
@@ -592,79 +583,6 @@ nif_project_vector2s(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
592583
return result;
593584
}
594585

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-
668586
//=============================================================================
669587
// erl housekeeping. This is the list of functions available to the erl side
670588

0 commit comments

Comments
 (0)