Documentation


OctreeODEEngine.cpp

Go to the documentation of this file.
00001 //
00002 // C++ Implementation: OctreeODEEngine
00003 //
00004 // Description: 
00005 //
00006 //
00007 // Author: François Faure <>, (C) 2004
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 #include "OctreeODEEngine.h"
00013 #include "ConstrainedVertex.h"
00014 
00015 
00016 namespace animal {
00017 
00018 namespace octree {
00019 
00020 OctreeODEEngine::OctreeODEEngine(Vec3d bboxMin, Vec3d bboxMax, MFVec3f *points, MFVec3f normals, unsigned int nMaxPointsPerCell)
00021  : OctreeEngine(bboxMin, bboxMax, points, normals, nMaxPointsPerCell)
00022 {
00023 }
00024 
00025 
00026 OctreeODEEngine::~OctreeODEEngine()
00027 {
00028 }
00029 
00030 void OctreeODEEngine::integrate_VVerlet( FloatingPointType h )
00031 /*  Sta& s,
00032     Real h,
00033     Der& d)*/
00034 {
00035     int a= ConstrainedVertex::ACC;
00036     
00037     // get accelerations for this time step
00038     compute_accelerations(ConstrainedVertex::ACC, ConstrainedVertex::POS, ConstrainedVertex::VEL);
00039 
00040     // velocity at half timestep is...
00041     v_eq_a_plus_alpha_b(ConstrainedVertex::VELHALF, ConstrainedVertex::VEL, h/2, ConstrainedVertex::ACC);
00042 
00043     // the updated position at time t+Delta_t is...
00044     v_eq_a_plus_alpha_b(ConstrainedVertex::POS, ConstrainedVertex::POS, h, ConstrainedVertex::VELHALF );
00045 
00046     // acceleration at time t+Delta_t based on updated positions is...
00047     // note: we are using halfstep velocities to predict acceleration at update time here
00048     compute_accelerations(ConstrainedVertex::ACC, ConstrainedVertex::POS, ConstrainedVertex::VELHALF);
00049 
00050     // and finally, the velocity at time t+Delta_t is...
00051     v_eq_a_plus_alpha_b(ConstrainedVertex::VEL, ConstrainedVertex::VELHALF, h/2, ConstrainedVertex::ACC);
00052 
00053 }
00054 
00055 };
00056 
00057 };

Generated on Thu Dec 23 13:52:26 2004 by doxygen 1.3.6