PeriDyno 1.0.0
Loading...
Searching...
No Matches
AnimationCurve.h
Go to the documentation of this file.
1#pragma once
2#include "Array/ArrayList.h"
3
4typedef long long LongLong;
5
6namespace dyno{
7
8 #define FBXTIME 46186158000L
9 #define BEFORE -1
10 #define ANIM_SPEED 1.f
11
12 template<typename TDataType>
14 {
15 public:
16 typedef typename TDataType::Real Real;
17 typedef typename TDataType::Coord Coord;
18 typedef typename ::dyno::Mat4f Mat;
19
21 AnimationCurve(int size, Real dx, Real dy, Real dz);
23
24 void set(int index, const std::vector<LongLong>& tim, const std::vector<Real>& val);
25
26 // 转换为FBXTIME
29
30 void setInitVal(Coord init){
31 m_initVal[0] = init[0];
32 m_initVal[1] = init[1];
33 m_initVal[2] = init[2];
34 }
35
36 // 获取递增时间下该时刻的曲线值
38 // 获取任意时刻的曲线值
40 // 循环获取曲线值
42
43 public:
45 // (X,Y,Z)
46 int m_cur[3];
49 std::vector<LongLong> m_times[3]; // 若不存在曲线,则只有一个 [0]
50 std::vector<Real> m_values[3];
51 };
52}
long long LongLong
#define FBXTIME
#define ANIM_SPEED
double Real
Definition Typedef.inl:23
Real fbxTimeToSeconds(LongLong value)
void setInitVal(Coord init)
void set(int index, const std::vector< LongLong > &tim, const std::vector< Real > &val)
LongLong secondsToFbxTime(Real value)
Coord getCurveValueAlong(Real ptime)
Coord getCurveValueCycle(Real ptime)
std::vector< Real > m_values[3]
Coord getCurveValueAll(Real ptime)
std::vector< LongLong > m_times[3]
TDataType::Real Real
TDataType::Coord Coord
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25