git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@88 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
parent
daa4946d5f
commit
1902cdcb48
55
sources/reactphysics3d/engine/NumericalIntegrator.cpp
Normal file
55
sources/reactphysics3d/engine/NumericalIntegrator.cpp
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2009 Daniel Chappuis *
|
||||||
|
****************************************************************************
|
||||||
|
* This file is part of ReactPhysics3D. *
|
||||||
|
* *
|
||||||
|
* ReactPhysics3D is free software: you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* ReactPhysics3D is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with ReactPhysics3D. If not, see <http://www.gnu.org/licenses/>. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
// Libraries
|
||||||
|
#include "NumericalIntegrator.h"
|
||||||
|
|
||||||
|
// We want to use the ReactPhysics3D namespace
|
||||||
|
using namespace reactphysics3d;
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
NumericalIntegrator::NumericalIntegrator() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy-constructor
|
||||||
|
NumericalIntegrator::NumericalIntegrator(const NumericalIntegrator& integrator) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Destructor
|
||||||
|
NumericalIntegrator::~NumericalIntegrator() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute a derivative body state at time t+dt
|
||||||
|
DerivativeBodyState NumericalIntegrator::evaluate(BodyState& bodyState, const Time& time, const Time& timeStep) {
|
||||||
|
// TODO : Implement this method
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compute a derivative body state at time t + dt according to the last derivative body state
|
||||||
|
DerivativeBodyState NumericalIntegrator::evaluate(BodyState& bodyState, const Time& time, const Time& timeStep,
|
||||||
|
const BodyState& lastDerivativeBodyState) {
|
||||||
|
// TODO : Implement this method
|
||||||
|
}
|
||||||
|
|
||||||
|
// Integrate a body state over time
|
||||||
|
void NumericalIntegrator::integrate(BodyState& bodyState, const Time& t, const Time& dt) {
|
||||||
|
// TODO : Implement this method
|
||||||
|
}
|
53
sources/reactphysics3d/engine/NumericalIntegrator.h
Normal file
53
sources/reactphysics3d/engine/NumericalIntegrator.h
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* Copyright (C) 2009 Daniel Chappuis *
|
||||||
|
****************************************************************************
|
||||||
|
* This file is part of ReactPhysics3D. *
|
||||||
|
* *
|
||||||
|
* ReactPhysics3D is free software: you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* ReactPhysics3D is distributed in the hope that it will be useful, *
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
|
* GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the GNU General Public License *
|
||||||
|
* along with ReactPhysics3D. If not, see <http://www.gnu.org/licenses/>. *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
#ifndef NUMERICALINTEGRATOR_H
|
||||||
|
#define NUMERICALINTEGRATOR_H
|
||||||
|
|
||||||
|
// Libraries
|
||||||
|
#include "../body/BodyState.h"
|
||||||
|
#include "../body/DerivativeBodyState.h"
|
||||||
|
|
||||||
|
// Namespace ReactPhysics3D
|
||||||
|
namespace reactphysics3d {
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------
|
||||||
|
Class NumericalIntegrator :
|
||||||
|
This class will be used to solve the differential equation of
|
||||||
|
movement by integrating a body state. This integrator implements
|
||||||
|
the RK4 integrator.
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
class NumericalIntegrator {
|
||||||
|
private :
|
||||||
|
DerivativeBodyState evaluate(BodyState& bodyState, const Time& time, const Time& timeStep); // Compute a derivative body state
|
||||||
|
DerivativeBodyState evaluate(BodyState& bodyState, const Time& time,
|
||||||
|
const Time& timeStep, const BodyState& lastDerivativeBodyState); // Compute a derivative body state
|
||||||
|
|
||||||
|
public :
|
||||||
|
NumericalIntegrator(); // Constructor
|
||||||
|
NumericalIntegrator(const NumericalIntegrator& integrator); // Copy-constructor
|
||||||
|
virtual ~NumericalIntegrator(); // Destructor
|
||||||
|
|
||||||
|
void integrate(BodyState& bodyState, const Time& t, const Time& dt); // Integrate a body state over time
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user