Revision: 47014
          http://brlcad.svn.sourceforge.net/brlcad/?rev=47014&view=rev
Author:   abhi2011
Date:     2011-10-02 09:08:53 +0000 (Sun, 02 Oct 2011)
Log Message:
-----------
checked to see if some subtle positioning issues could be solved by not 
calculating the BB each iteration, but that created large differences between 
the correct and rendered position, so sticking with the recalculation of BB 
each iteration approach and focusing on adding rt

Modified Paths:
--------------
    brlcad/trunk/src/libged/simulate/simphysics.cpp
    brlcad/trunk/src/libged/simulate/simulate.c

Modified: brlcad/trunk/src/libged/simulate/simphysics.cpp
===================================================================
--- brlcad/trunk/src/libged/simulate/simphysics.cpp     2011-10-01 21:04:10 UTC 
(rev 47013)
+++ brlcad/trunk/src/libged/simulate/simphysics.cpp     2011-10-02 09:08:53 UTC 
(rev 47014)
@@ -43,30 +43,32 @@
  * Prints the 16 by 16 transform matrices for debugging
  *
  */
-void print_matrices(struct simulation_params *sim_params, char *rb_namep, 
mat_t t, btScalar *m)
+void print_matrices(char *rb_namep, mat_t t, btScalar *m)
 {
     int i, j;
+    char buffer[800];
 
-    bu_vls_printf(sim_params->result_str, "------------Transformation 
matrices(%s)--------------\n",
+    sprintf(buffer, "------------Phy : Transformation 
matrices(%s)--------------\n",
             rb_namep);
 
     for (i=0 ; i<4 ; i++) {
         for (j=0 ; j<4 ; j++) {
-            bu_vls_printf(sim_params->result_str, "t[%d]: %f\t", (j*4 + i), 
t[j*4 + i] );
+               sprintf(buffer, "%st[%d]: %f\t", buffer, (j*4 + i), t[j*4 + i] 
);
         }
-        bu_vls_printf(sim_params->result_str, "\n");
+        sprintf(buffer, "%s\n", buffer);
     }
 
-    bu_vls_printf(sim_params->result_str, "\n");
+    sprintf(buffer, "%s\n", buffer);
 
     for (i=0 ; i<4 ; i++) {
         for (j=0 ; j<4 ; j++) {
-            bu_vls_printf(sim_params->result_str, "m[%d]: %f\t", (j*4 + i), 
m[j*4 + i] );
+            sprintf(buffer, "%sm[%d]: %f\t", buffer, (j*4 + i), m[j*4 + i] );
         }
-        bu_vls_printf(sim_params->result_str, "\n");
+        sprintf(buffer, "%s\n", buffer);
     }
 
-    bu_vls_printf(sim_params->result_str, 
"-------------------------------------------------------\n");
+    sprintf(buffer, 
"%s-------------------------------------------------------\n", buffer);
+    bu_log(buffer);
 
 }
 
@@ -231,7 +233,7 @@
             //Copy the transform matrix
             MAT_COPY(current_node->m, m);
 
-            //print_matrices(sim_params, current_node->rb_namep, 
current_node->m, m);
+            print_matrices(current_node->rb_namep, current_node->m, m);
 
             //Get the state of the body
             current_node->state = bb_RigidBody->getActivationState();

Modified: brlcad/trunk/src/libged/simulate/simulate.c
===================================================================
--- brlcad/trunk/src/libged/simulate/simulate.c 2011-10-01 21:04:10 UTC (rev 
47013)
+++ brlcad/trunk/src/libged/simulate/simulate.c 2011-10-02 09:08:53 UTC (rev 
47014)
@@ -68,21 +68,23 @@
  * Prints a 16 by 16 transform matrix for debugging
  *
  */
-void print_matrix(struct simulation_params *sim_params, char *rb_namep, mat_t 
t)
+void print_matrix(char *rb_namep, mat_t t)
 {
        int i, j;
+       char buffer[500];
 
-       bu_vls_printf(sim_params->result_str, "------------Transformation 
matrix(%s)--------------\n",
+       sprintf(buffer, "------------Transformation matrix(%s)--------------\n",
                        rb_namep);
 
        for (i=0 ; i<4 ; i++) {
                for (j=0 ; j<4 ; j++) {
-                       bu_vls_printf(sim_params->result_str, "t[%d]: %f\t", 
(i*4 + j), t[i*4 + j] );
+                       sprintf(buffer, "%st[%d]: %f\t", buffer, (i*4 + j), 
t[i*4 + j] );
                }
-               bu_vls_printf(sim_params->result_str, "\n");
+               sprintf(buffer, "%s\n", buffer);
        }
 
-       bu_vls_printf(sim_params->result_str, 
"-------------------------------------------------------\n");
+       sprintf(buffer, 
"%s-------------------------------------------------------\n", buffer);
+       bu_log(buffer);
 }
 
 
@@ -578,7 +580,7 @@
                /* Get the internal representation of the object */
                GED_DB_GET_INTERNAL(gedp, &intern, current_node->dp, 
bn_mat_identity, &rt_uniresource, GED_ERROR);
 
-               print_matrix(sim_params, current_node->dp->d_namep, 
current_node->m);
+               print_matrix(current_node->dp->d_namep, current_node->m);
 
                /* Translate to origin without any rotation, before applying 
rotation */
                MAT_IDN(m);
@@ -613,7 +615,7 @@
                m[14] = current_node->m[14];
                MAT_TRANSPOSE(t, m);
 
-               print_matrix(sim_params, current_node->dp->d_namep, t);
+               print_matrix(current_node->dp->d_namep, t);
 
                if (rt_matrix_transform(&intern, t, &intern, 0, 
gedp->ged_wdbp->dbip, &rt_uniresource) < 0){
                        bu_vls_printf(gedp->ged_result_str, "apply_transforms: 
ERROR rt_matrix_transform(%s) failed while \

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to