This class implements quaternions and the commonly used algebraic operations on quaternions. The class is templated: you can use either float or double precision. Supports using quaternions to represent/manipulate rotations.
License type: MIT (X11),
as described in quaternion.h.
This is a very permissive licence. You can use this code in your products if you are a company. Academic use is allowed too of course (but please acknowledge). See the license text (in quaternion.h) for the exact legal interpretation.
Dependencies: none.
quaternion.h
quaternion.cpp
example.cpp
Version: 1.0. Released: Mar 04, 2007
Classes 'RigidBodyDynamics' and 'RigidBodyDynamics_GeneralTensor' implement 6-DOF rigid dynamics of a single rigid body, as explained, for example, in:
David Baraff: "An Introduction to Physically Based Modeling: Rigid Body Simulation I: Unconstrained Rigid Body Dynamics" (SIGGRAPH 97 Course Notes)In other words, these two classes allow you to simulate the motion of a single rigid body, under any specified (potentially time-varying) external forces and torques. Arbitrary tensors of inertia are supported. The solution is computed by numerically timestepping the ordinary differential equations of rigid body motion, derived from the Newton's 2nd law, and conservation of linear momentum and angular momentum. For example, ballistic motion can be simulated if gravity is used as the external force. Objects bouncing off the ground/impacting other objects can be simulated if you combine 'RigidBodyDynamics' (or 'RigidBodyDynamics_GeneralTensor') with a collision detection algorithm that provides the contact external forces.
License type: MIT (X11),
as described in rigidBodyDynamics.h.
This is a very permissive licence. You can use this code in your products if you are a company. Academic use is allowed too of course (but please acknowledge). See the license text (in rigidBodyDynamics.h) for the exact legal interpretation.
Dependencies: Quaternion C++ class (see above).
rigidBodyDynamics.h
rigidBodyDynamics.cpp
rigidBodyDynamics_generalTensor.h
rigidBodyDynamics_generalTensor.cpp
example.cpp
Version: 1.0. Released: Mar 04, 2007
This class integrates a single harmonic oscillator, that is,
this code can timestep the following one-dimensional Ordinary Differential Equation:
M * q''(t) + C * q'(t) + K * q(t) = f(t), where M,C,K are scalar constants, and f=f(t) is a given (discretely sampled) function of time, and q=q(t) is the unknown (i.e., what we are solving for). The system must be underdamped (as is the case in, e.g., sound simulations): C < 2 * sqrt(M*K).
Doug L. James, Jernej Barbic, Dinesh K. Pai: Precomputed Acoustic Transfer: Output-sensitive, accurate sound generation for geometrically complex vibration sources, ACM Transactions on Graphics 25(3) (SIGGRAPH 2006), p. 987-995, Boston, MA, August 2006.License type: MIT (X11), as stated in harmonicOscillator_IIR.h. This is a very permissive licence. You can use this code in your products if you are a company. Academic use is allowed too of course (but please acknowledge). See the license text (in harmonicOscillator_IIR.h) for the exact legal interpretation.