18#include "Topology/DiscreteElements.h"
27 template<
typename TDataType>
32 typedef typename TDataType::Real
Real;
33 typedef typename TDataType::Coord
Coord;
34 typedef typename TDataType::Matrix
Matrix;
50 DEF_VAR(std::vector<Animation2JointConfig>, BindingConfiguration, std::vector<Animation2JointConfig>(),
"Animation Joint Config");
67 for (
size_t channel = 0; channel < 3; channel++)
69 float tempTime = std::fmod(time, (*animTime[channel]).back());
71 std::vector<Real>& animData = *animTime[channel];
72 for (
size_t j = 0; j < animData.size() - 1; j++)
74 if (tempTime > animData[j] && tempTime <= animData[j + 1])
76 float v = (tempTime - animData[j]) / (animData[j + 1] - animData[j]);
78 keyFrame[channel] = j;
DEF_INSTANCE_IN(JointAnimationInfo, JointAnimationInfo,"Animation objects")
void onEvent(PKeyboardEvent event) override
DEF_VAR_IN(Real, DeltaTime,"")
::dyno::FixedJoint< Real > FixedJoint
void getFrameAndWeight(float time, Vec3i &keyFrame, Vec3f &weight, std::vector< std::vector< Real > * > animTime)
::dyno::PointJoint< Real > PointJoint
::dyno::BallAndSocketJoint< Real > BallAndSocketJoint
::dyno::SliderJoint< Real > SliderJoint
::dyno::HingeJoint< Real > HingeJoint
~AnimationDriver() override
DEF_VAR(Real, Speed, 4,"Speed")
DEF_VAR(std::vector< Animation2JointConfig >, BindingConfiguration, std::vector< Animation2JointConfig >(), "Animation Joint Config")
DECLARE_TCLASS(AnimationDriver, TDataType)
DEF_INSTANCE_IN(DiscreteElements< TDataType >, Topology, "Topology")
This is an implementation of AdditiveCCD based on peridyno.