[brlcad-commits] SF.net SVN: brlcad:[47009] brlcad/trunk/src/libged/simulate
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <abh...@us...> - 2011-10-01 13:20:50
|
Revision: 47009 http://brlcad.svn.sourceforge.net/brlcad/?rev=47009&view=rev Author: abhi2011 Date: 2011-10-01 13:20:43 +0000 (Sat, 01 Oct 2011) Log Message: ----------- Added contact manifold related members to the sim_params struct to communicate them back to libged and display them Modified Paths: -------------- brlcad/trunk/src/libged/simulate/simcollisionalgo.cpp brlcad/trunk/src/libged/simulate/simulate.c brlcad/trunk/src/libged/simulate/simulate.h Modified: brlcad/trunk/src/libged/simulate/simcollisionalgo.cpp =================================================================== --- brlcad/trunk/src/libged/simulate/simcollisionalgo.cpp 2011-10-01 11:40:20 UTC (rev 47008) +++ brlcad/trunk/src/libged/simulate/simcollisionalgo.cpp 2011-10-01 13:20:43 UTC (rev 47009) @@ -121,10 +121,13 @@ btVector3 ptA = pt.getPositionWorldOnA(); btVector3 ptB = pt.getPositionWorldOnB(); - bu_log("processCollision: contact %d of %d, %s(%f, %f, %f) , %s(%f, %f, %f)\n", + bu_log("processCollision: contact %d of %d, %s(%f, %f, %f) , %s(%f, %f, %f) \ + n(%f, %f, %f)\n", j+1, numContacts, upA->rb_namep, ptA[0], ptA[1], ptA[2], - upB->rb_namep, ptB[0], ptB[1], ptB[2]); + upB->rb_namep, ptB[0], ptB[1], ptB[2], + pt.m_normalWorldOnB[0], pt.m_normalWorldOnB[1], pt.m_normalWorldOnB[2]); + } } Modified: brlcad/trunk/src/libged/simulate/simulate.c =================================================================== --- brlcad/trunk/src/libged/simulate/simulate.c 2011-10-01 11:40:20 UTC (rev 47008) +++ brlcad/trunk/src/libged/simulate/simulate.c 2011-10-01 13:20:43 UTC (rev 47009) @@ -656,7 +656,7 @@ for (i=0 ; i < sim_params.duration ; i++) { - bu_log("%s: ------------------------- Iteration %d -----------------------\n", argv[0], i); + bu_log("%s: ------------------------- Iteration %d -----------------------\n", argv[0], i+1); rv = get_bb(gedp, &sim_params); if (rv != GED_OK){ @@ -685,6 +685,7 @@ next_node = current_node->next; bu_free(current_node, "simulate : current_node"); current_node = next_node; + sim_params.num_bodies--; } Modified: brlcad/trunk/src/libged/simulate/simulate.h =================================================================== --- brlcad/trunk/src/libged/simulate/simulate.h 2011-10-01 11:40:20 UTC (rev 47008) +++ brlcad/trunk/src/libged/simulate/simulate.h 2011-10-01 13:20:43 UTC (rev 47009) @@ -37,6 +37,18 @@ #define DISABLE_DEACTIVATION 4 #define DISABLE_SIMULATION 5 +#define MAX_CONTACTS_PER_MANIFOLD 4 + +struct sim_contact { + vect_t ptA, ptB; + vect_t normalB; +}; + +struct sim_manifold { + int num_contacts; + struct sim_contact rb_contacts[MAX_CONTACTS_PER_MANIFOLD]; +}; + /* Contains information about a single rigid body constructed from a BRL-CAD region. * This structure is the node of a linked list containing the geometry to be added to the sim * Only the bb is currently present, but physical properties like elasticity, custom forces @@ -58,6 +70,9 @@ vect_t linear_velocity; /**< @brief linear velocity components */ vect_t angular_velocity; /**< @brief angular velocity components */ + /* Manifolds in which this body participates and is body B, only body B has manifold info*/ + int num_manifolds; + struct sim_manifold *first_manifold; }; /* Contains the simulation parameters, such as number of rigid bodies, @@ -74,6 +89,8 @@ }; + + #endif /* SIMULATE_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |