HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_AgentClip.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GU_AgentClip.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GU_AgentClip__
12 #define __GU_AgentClip__
13 
14 #include "GU_API.h"
15 
16 #include "GU_AgentRig.h"
17 
18 #include <UT/UT_Array.h>
19 #include <UT/UT_Assert.h>
20 #include <UT/UT_IntrusivePtr.h>
21 #include <UT/UT_Lock.h>
22 #include <UT/UT_Matrix3.h>
23 #include <UT/UT_Matrix4.h>
24 #include <UT/UT_Quaternion.h>
25 #include <UT/UT_SharedPtr.h>
26 #include <UT/UT_StringArray.h>
27 #include <UT/UT_StringHolder.h>
28 #include <UT/UT_StringMap.h>
29 #include <UT/UT_SymMatrix3.h>
30 #include <UT/UT_ValArray.h>
31 #include <UT/UT_Vector3.h>
32 #include <UT/UT_VectorTypes.h>
33 #include <SYS/SYS_Inline.h>
34 #include <SYS/SYS_Math.h>
35 #include <SYS/SYS_Types.h>
36 
37 class CL_Clip;
39 class UT_BitArray;
40 class UT_StringArray;
41 
42 /// A factored transform geared for animation blending.
43 template <typename T>
45 {
46 public:
48 
50  GU_AgentXformT() = default;
51 
53  : myStretch(scale)
54  , myRotate(0, 0, 0, 0)
55  , myTranslate(0, 0, 0)
56  {
57  }
58 
59  const UT_SymMatrix3T<T>& stretch() const { return myStretch; }
60  const UT_QuaternionT<T>& rotate() const { return myRotate; }
61  const UT_Vector3T<T>& translate() const { return myTranslate; }
62 
63  void zero()
64  {
65  myStretch.zero();
66  myRotate.assign(0, 0, 0, 0);
67  myTranslate.assign(0, 0, 0);
68  }
69  void identity()
70  {
71  myStretch.identity();
72  myRotate.identity();
73  myTranslate.assign(0, 0, 0);
74  }
75 
76  /// Set the transform, in SRT/XYZ transform order.
77  /// The rotations are given in radians.
79  T tx, T ty, T tz,
80  T rx, T ry, T rz,
81  T sx, T sy, T sz)
82  {
84  myStretch.setScale(sx, sy, sz);
85  myRotate.updateFromEuler(UT_Vector3T<T>(rx, ry, rz), xord);
86  myTranslate.assign(tx, ty, tz);
87  }
88 
89  /// Set the transform, in SRT transform order.
90  /// The rotations are specified by a quaternion.
92  const UT_Vector3T<T> &t, const UT_QuaternionT<T> &r,
93  const UT_Vector3T<T> &s)
94  {
95  myStretch.setScale(s);
96  myRotate = r;
97  myTranslate = t;
98  }
99 
100  template <typename S>
102  S& tx, S& ty, S& tz,
103  S& rx, S& ry, S& rz,
104  S& sx, S& sy, S& sz) const
105  {
106  tx = myTranslate[0];
107  ty = myTranslate[1];
108  tz = myTranslate[2];
109 
111  UT_Vector3D r = myRotate.computeRotations(xord);
112  rx = r[0];
113  ry = r[1];
114  rz = r[2];
115 
116  sx = myStretch(0, 0);
117  sy = myStretch(1, 1);
118  sz = myStretch(2, 2);
119  }
120 
121  /// Set this to a linear interpolation of the two given transforms:
122  /// *this = a + t*(b - a)
123  void setLerp(const type& a, const type& b, T t)
124  {
125  myStretch.lerp(a.myStretch, b.myStretch, t);
126 
127  if (dot(a.myRotate, b.myRotate) >= 0)
128  myRotate.lerp(a.myRotate, b.myRotate, t);
129  else
130  myRotate.lerp(a.myRotate, -b.myRotate, t);
131  // NOTE: We don't normalize myRotate since this is already handled when
132  // we call UT_QuaternionT::getRotationMatrix().
133 
134  myTranslate = SYSlerp(a.myTranslate, b.myTranslate, t);
135  }
136 
137  void addScaled(T s, const type& xform)
138  {
139  myStretch += xform.myStretch * s;
140  if (dot(myRotate, xform.myRotate) >= 0)
141  myRotate += xform.myRotate * s;
142  else
143  myRotate += xform.myRotate * -s;
144  myTranslate += xform.myTranslate * s;
145  }
146 
147  /// Perform an additive blend with the specified percentage.
148  void concat(T t, const type& xform)
149  {
150  myRotate.normalize();
151 
152  myTranslate += myRotate.rotate(xform.myTranslate * t);
153 
154  UT_QuaternionT<T> additive_r = xform.myRotate;
155  additive_r.normalize();
156  UT_QuaternionT<T> new_r = myRotate * additive_r;
157 
158  if (dot(myRotate, new_r) < 0)
159  new_r.negate();
160 
161  myRotate.lerp(myRotate, new_r, t);
162  }
163 
165  {
166  // Set m to the transform myStretch*myRotate*myTranslate
167  if (!myStretch.isIdentity())
168  {
169  UT_Matrix3T<T> sr;
170  myRotate.getRotationMatrix(sr);
171  sr.leftMult(myStretch);
172  m = sr;
173  }
174  else
175  myRotate.getTransformMatrix(m);
176 
177  m.setTranslates(myTranslate);
178  }
179 
180 private:
181  UT_SymMatrix3T<T> myStretch;
182  UT_QuaternionT<T> myRotate;
183  UT_Vector3T<T> myTranslate;
184 };
188 
189 // Declare as POD for UT_Array optimizations.
191 
193 typedef UT_IntrusivePtr<GU_AgentClip> GU_AgentClipPtr;
195 typedef UT_Array<GU_AgentClipConstPtr> GU_AgentClipPtrArray;
196 
197 
198 /// An agent motion clip
199 ///
200 /// It is represented as array of samples, where each sample has
201 /// transformsPerSample() number of transforms. These transforms can be "local"
202 /// (corresponding to the transform hierarchy of rig()), or "world" where they
203 /// are multiplied all the way up to a root node in the rig.
204 class GU_API GU_AgentClip : public UT_IntrusiveRefCounter<GU_AgentClip>
205 {
206 public:
207 
217 
218  /// Create an empty clip
219  static GU_AgentClipPtr addClip(
220  const UT_StringHolder &name,
221  const GU_AgentRigConstPtr &rig);
222 
223  /// Create a clip by loading a clip file from disk.
224  static GU_AgentClipPtr addClipFromFile(
225  const UT_StringHolder &name,
226  const UT_StringHolder &filename,
227  const GU_AgentRigConstPtr& rig,
228  bool delay_load,
229  UT_StringArray& errors);
230 
231  /// Create a clone of a clip, referencing the specified rig.
232  /// 'copy_external_ref' should be disabled if the new clip will be
233  /// further modified.
234  static GU_AgentClipPtr addClipCopy(const GU_AgentClip &src,
235  const GU_AgentRigConstPtr &rig,
236  bool copy_external_ref);
237 
238  /// Compute the world transforms 'matrices' from the local 'xforms'
239  /// corresponding to the transforms in 'rig'.
240  static void computeWorldTransforms(
241  const GU_AgentRig& rig,
242  const XformArray& xforms,
243  Matrix4Array& matrices);
244 
245  /// Compute the local transforms 'matrices' from the local 'xforms'
246  /// corresponding to the transforms in 'rig'.
247  static void computeLocalTransforms(
248  const GU_AgentRig& rig,
249  const XformArray& xforms,
250  Matrix4Array& matrices);
251 
252  /// Given the local transforms 'xforms' corresponding to 'rig', convert
253  /// them to world transforms in-place.
254  /// The optional 'in_world_space' array can be used to specify if some
255  /// transforms in 'xforms' are already in world space.
256  static void computeWorldTransforms(
257  const GU_AgentRig& rig,
258  const UT_BitArray *in_world_space,
259  Matrix4Array& xforms);
260 
261  /// Given the world transforms 'xforms' corresponding to 'rig', convert
262  /// them to local transforms in-place.
263  /// The optional 'in_world_space' array can be used to specify if only some
264  /// transforms in 'xforms' are currently in world space.
265  static void computeLocalTransforms(
266  const GU_AgentRig& rig,
267  const UT_BitArray *in_world_space,
268  Matrix4Array& xforms);
269 
270  /// Replaces whitespace, special characters, etc with underscores.
271  static void forceValidName(UT_String &clipname)
272  { clipname.forceValidVariableName(".-"); }
273 
274 private:
275  GU_AgentClip(const UT_StringHolder &name,
276  const UT_StringHolder &filename,
277  const GU_AgentRigConstPtr &rig)
278  : myName(name)
279  , myFileName(filename)
280  , myIsFile(filename.isstring())
281  , myIsLoaded(!filename.isstring())
282  , myHasLoadErrors(false)
283  , myNumXformTracks(0)
284  , myRig(rig)
285  , myStart(0)
286  , mySampleRate(24.0)
287  {
288  }
289 
290 public:
291 
292  ~GU_AgentClip();
293 
294  int64 getMemoryUsage(bool inclusive) const;
295 
296  /// Set this clip to have the specified number of samples, filled with
297  /// identity transforms.
298  ///
299  /// @pre num_samples must be larger than 0.
300  void init(exint num_samples);
301 
302  /// Load from clip.
303  void load(const CL_Clip &clip);
304 
305  /// Copy from another agent clip, and inherit the external reference if
306  /// there is one. If the rigs are different, identity matrices will be used
307  /// for the additional joints.
308  void load(const GU_AgentClip &clip);
309 
310  /// Return the number of transform tracks of the clip that was loaded into
311  /// this clip.
312  // This is currently only used for consistency checks.
313  int numTransformTracks() const
314  { ensureLoaded(); return myNumXformTracks; }
315 
316  /// Save to clip
317  void save(CL_Clip &clip,
318  bool worldspace = false) const;
319 
320  const UT_StringHolder& name() const
321  { return myName; }
322 
323  /// Returns whether the clip references a file on disk.
324  bool isFile() const
325  { return myIsFile; }
326  /// Returns the name of the file referenced by the clip.
327  const UT_StringHolder& fileName() const
328  { UT_ASSERT(isFile()); return myFileName; }
329  /// Clears the external file reference. The clip's contents will also be
330  /// loaded from disk if necessary.
331  void clearIsFile();
332 
333  /// Returns whether the clip's contents have been loaded from disk.
334  bool isLoaded() const
335  { UT_ASSERT(isFile()); return myIsLoaded; }
336  /// Returns whether there were errors when loading the clip from disk.
337  bool hasLoadErrors() const
338  { return myHasLoadErrors; }
339  /// Explicitly loads the clip from disk.
340  bool loadFromFile(
341  UT_StringArray *errors = nullptr) const;
342 
343  const GU_AgentRig& rig() const
344  { return *myRig; }
345 
346  /// Number of transforms in each sample
348  {
349  ensureLoaded();
350  if (myLocalTransforms.entries() < 1)
351  return 0;
352  return myLocalTransforms(0).entries();
353  }
354 
355  /// Number of samples in this clip
357  {
358  ensureLoaded();
359  return myLocalTransforms.entries();
360  }
361 
362  /// Start time of this clip in seconds
363  /// @{
364  fpreal start() const
365  { ensureLoaded(); return myStart; }
367  { ensureLoaded(); myStart = t; }
368  /// @}
369 
370  /// Length of the clip, in seconds.
371  fpreal length() const
372  {
373  return sampleCount() / sampleRate();
374  }
375 
376  /// Sample rate of this clip
377  /// @{
379  { ensureLoaded(); return mySampleRate; }
380  void setSampleRate(fpreal sample_rate)
381  {
382  ensureLoaded();
383  mySampleRate = sample_rate;
384  }
385  /// @}
386 
387  /// Directly set the local transforms for this clip (as an alternative to
388  /// using GU_AgentClip::load()).
389  ///
390  /// @param samples An array of local transform samples
391  ///
392  /// @pre samples (and each sample within) must be at least length 1
393  /// @pre Each entry in samples must be the same length
394  /// @post sampleCount() == samples.entries()
395  /// @post transformsPerSample() == samples.last().entries()
396  void setLocalTransforms(
398 
399  /// Edit the transforms for a specific sample in the clip.
400  void setLocalTransforms(exint sample_i,
401  const XformArray &xforms);
402 
403  const XformArray& localTransforms(exint sample_i) const
404  {
405  ensureLoaded();
406  return myLocalTransforms(sample_i);
407  }
408  Matrix4ArrayConstPtr worldTransforms(exint sample_i) const
409  {
410  ensureLoaded();
411  return myWorldTransforms(sample_i);
412  }
413 
414  /// Samples a transform in the clip at a specific time.
415  void sampleTransform(exint i, fpreal seconds,
416  bool worldspace,
417  Matrix4 &xform_sample) const;
418 
419  /// Add an extra channel into the clip (as an alternative to
420  /// GU_AgentClip::load()).
421  /// If a channel with the same name already exists, its data is replaced
422  /// with the new samples.
423  ///
424  /// @param name Unique name of the channel.
425  /// @param samples Float array with length sampleCount().
426  void addChannel(const UT_StringHolder &name,
427  const FloatType *samples);
428 
429  /// Finds a channel by name. Returns -1 if the channel does not exist.
430  exint findChannel(const UT_StringRef &name) const;
431  /// Samples a channel in the clip at a specific time.
432  /// The channel indices from GU_AgentRig are valid indices for the clip's
433  /// channels.
434  /// For transforms, use GU_AgentClip::sampleTransform().
435  FloatType sampleChannel(exint channel_index,
436  fpreal seconds) const;
437  /// Returns the number of non-transform channels in the clip. This value
438  /// will be >= GU_AgentRig::channelCount().
439  exint channelCount() const;
440  /// Returns the name of the specified channel.
441  const UT_StringHolder &channelName(exint i) const;
442  /// Builds a list of all channel names in the clip (channels defined by
443  /// GU_AgentRig, plus any spare channels).
444  UT_StringArray channelNames() const;
445 
446  /// Add a scaled version of our local transforms using the given clip time.
447  /// If the time in seconds exceeds the length of our clip, then it is
448  /// wrapped around.
449  void addScaledLocalTransforms(
450  XformArray& dst,
451  fpreal scale,
452  fpreal seconds) const;
453  /// Variant of addScaledLocalTransforms that only affects a subset of the
454  /// joints.
455  ///
456  /// @param inv_total_weight Inverse of the total blend weight at each joint.
457  void addScaledLocalTransforms(
458  XformArray &dst,
459  const UT_BitArray &joints,
460  fpreal scale,
461  const UT_Array<fpreal> &inv_total_weights,
462  fpreal seconds) const;
463  /// Perform an additive blend with the specified percentage.
464  void concatLocalTransforms(
465  XformArray &dst,
466  const GU_AgentTransformGroup &xform_grp,
467  fpreal percent,
468  fpreal seconds) const;
469  void addScaledLocalTransform(
470  Xform& xform,
471  exint i,
472  fpreal scale,
473  fpreal seconds) const;
474 
475  /// Adds a scaled version of the channel values given a clip time. Only the
476  /// channels defined on GU_AgentRig are included.
477  void addScaledChannelValues(
478  FloatArray &dst,
479  const UT_BitArray &channels,
480  fpreal scale,
481  const UT_Array<fpreal> &inv_total_weights,
482  fpreal seconds) const;
483 
485  {
486  ensureLoaded();
487  return (seconds - myStart) * mySampleRate;
488  }
489  inline fpreal secondsFromSample(fpreal sample) const
490  {
491  ensureLoaded();
492  return myStart + (sample / mySampleRate);
493  }
495  {
496  return (exint)
497  SYSrint(sampleFromSeconds(seconds));
498  }
500  {
501  fpreal len = sampleCount();
502  fpreal s = SYSfmod(
503  sampleFromSeconds(seconds),
504  len);
505  if (s >= 0)
506  return s;
507  else
508  return s + len;
509  }
510 
511 private:
512  /// Called before any clip data is accessed to ensure that the clip has
513  /// been loaded from disk.
514  SYS_FORCE_INLINE void ensureLoaded() const
515  {
516  if (!myIsLoaded)
517  loadFromFile();
518  }
519 
520  /// Removes the clip from the agent clip file cache.
521  void removeFromFileCache();
522 
523  /// Given a sample time in seconds, find the two samples that we need to
524  /// interpolate between.
525  void getSamples(fpreal scale, fpreal seconds,
526  exint& sample_a, fpreal& weight_a,
527  exint& sample_b, fpreal& weight_b) const;
528 
529  /// Initialize myChannelValueSamples with the channels defined on
530  /// GU_AgentRig.
531  void initChannels(exint num_samples);
532 
533  /// Build myWorldTransforms from myLocalTransforms.
534  void computeWorldSpaceSamples();
535 
536  UT_StringHolder myName;
537  UT_StringHolder myFileName;
538  bool myIsFile;
539  /// Tracks whether the clip's contents have been loaded from disk.
540  bool myIsLoaded;
541  /// Records whether there were any errors when the clip was delay-loaded.
542  bool myHasLoadErrors;
543  int myNumXformTracks; // put here for the same ABI
544  GU_AgentRigConstPtr myRig;
545  fpreal myStart;
546  fpreal mySampleRate;
547 
548  /// The local transforms for the rig, at each sample.
549  UT_Array<XformArray> myLocalTransforms;
550  /// The world transforms for the rig, at each sample.
551  UT_Array<Matrix4ArrayPtr> myWorldTransforms;
552 
553  /// The (non-transform) channel values in the clip, at each sample.
554  /// Channels are ordered beginning with the channels defined on
555  /// GU_AgentRig.
556  UT_Array<FloatArrayPtr> myChannelValueSamples;
557  /// List of spare channels not defined on GU_AgentRig. These are stored at
558  /// the end of myChannelValueSamples[i].
559  UT_StringArray mySpareChannelNames;
560  /// Index into myChannelValueSamples[i] for each channel in
561  /// mySpareChannelNames.
562  UT_StringMap<int> mySpareChannelIndex;
563 
564  /// Lock for delayed loading of the clip data.
565  mutable UT_Lock myDelayLoadLock;
566 };
567 
568 inline exint
570 {
571  ensureLoaded();
572 
573  // First, see if this channel is defined on the rig.
574  exint i = myRig->findChannel(name);
575  if (i >= 0)
576  return i;
577 
578  // Otherwise, it would need to be a spare channel.
579  auto it = mySpareChannelIndex.find(name);
580  return it != mySpareChannelIndex.end() ? it->second : -1;
581 }
582 
583 inline const UT_StringHolder &
585 {
586  ensureLoaded();
587 
588  // Grab the channel name from the rig, unless it is a spare channel.
589  if (i < myRig->channelCount())
590  return myRig->channelName(i);
591  else
592  return mySpareChannelNames[i - myRig->channelCount()];
593 }
594 
595 inline exint
597 {
598  ensureLoaded();
599  return myRig->channelCount() + mySpareChannelNames.entries();
600 }
601 
602 #endif
GLdouble s
Definition: glew.h:1390
GU_AgentXformT< float > GU_AgentXformF
Definition: GU_AgentClip.h:185
fpreal sampleFromSeconds(fpreal seconds) const
Definition: GU_AgentClip.h:484
void leftMult(const UT_SymMatrix3T< S > &m)
Multiply given symmetric matrix on the left.
Definition: UT_Matrix3.h:340
GT_API const UT_StringHolder filename
GLenum src
Definition: glew.h:2410
GU_AgentXformT(T scale)
Definition: GU_AgentClip.h:52
int numTransformTracks() const
Definition: GU_AgentClip.h:313
GLuint const GLchar * name
Definition: glew.h:1814
GU_AgentXformT< double > GU_AgentXformD
Definition: GU_AgentClip.h:186
IMF_EXPORT int & sampleCount(char *base, int xStride, int yStride, int x, int y)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:643
SYS_FORCE_INLINE GU_AgentXformT()=default
GLenum GLenum GLenum GLenum GLenum scale
Definition: glew.h:13880
GLboolean GLboolean GLboolean GLboolean a
Definition: glew.h:9477
static void forceValidName(UT_String &clipname)
Replaces whitespace, special characters, etc with underscores.
Definition: GU_AgentClip.h:271
exint findChannel(const UT_StringRef &name) const
Finds a channel by name. Returns -1 if the channel does not exist.
Definition: GU_AgentClip.h:569
void setLerp(const type &a, const type &b, T t)
Definition: GU_AgentClip.h:123
GU_AgentXformT< T > type
Definition: GU_AgentClip.h:47
void getTransform(S &tx, S &ty, S &tz, S &rx, S &ry, S &rz, S &sx, S &sy, S &sz) const
Definition: GU_AgentClip.h:101
Generic symmetric 3x3 matrix.
Definition: UT_SymMatrix3.h:27
const GLdouble * m
Definition: glew.h:9124
fpreal wrappedSampleFromSeconds(fpreal seconds) const
Definition: GU_AgentClip.h:499
void setStart(fpreal t)
Definition: GU_AgentClip.h:366
void setTransform(T tx, T ty, T tz, T rx, T ry, T rz, T sx, T sy, T sz)
Definition: GU_AgentClip.h:78
const UT_Vector3T< T > & translate() const
Definition: GU_AgentClip.h:61
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
Definition: UT_Matrix2.h:604
Matrix4ArrayConstPtr worldTransforms(exint sample_i) const
Definition: GU_AgentClip.h:408
3D Vector class.
A reference counter base class for use with UT_IntrusivePtr.
const GU_AgentRig & rig() const
Definition: GU_AgentClip.h:343
fpreal start() const
Definition: GU_AgentClip.h:364
UT_Matrix4T< FloatType > Matrix4
Definition: GU_AgentClip.h:213
UT_SharedPtr< FloatArray > FloatArrayPtr
Definition: GU_AgentClip.h:210
long long int64
Definition: SYS_Types.h:111
UT_Array< Matrix4 > Matrix4Array
Definition: GU_AgentClip.h:214
A rig for the agent primitive.
Definition: GU_AgentRig.h:34
GU_AgentXformT< fpreal > GU_AgentXformR
Definition: GU_AgentClip.h:187
const UT_SymMatrix3T< T > & stretch() const
Definition: GU_AgentClip.h:59
void getMatrix4(UT_Matrix4T< T > &m) const
Definition: GU_AgentClip.h:164
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
int64 exint
Definition: SYS_Types.h:120
A factored transform geared for animation blending.
Definition: GU_AgentClip.h:44
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
Definition: CE_Vector.h:218
void concat(T t, const type &xform)
Perform an additive blend with the specified percentage.
Definition: GU_AgentClip.h:148
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
int int forceValidVariableName(const char *safechars=NULL)
GLenum GLenum dst
Definition: glew.h:2410
#define SYS_DECLARE_IS_POD(T)
Declare a type as POD.
bool isFile() const
Returns whether the clip references a file on disk.
Definition: GU_AgentClip.h:324
Wrapper around hboost::intrusive_ptr.
UT_Array< FloatType > FloatArray
Definition: GU_AgentClip.h:209
GU_AgentXformT< FloatType > Xform
Definition: GU_AgentClip.h:211
#define GU_API
Definition: GU_API.h:14
exint channelCount() const
Definition: GU_AgentClip.h:596
const XformArray & localTransforms(exint sample_i) const
Definition: GU_AgentClip.h:403
UT_SharedPtr< const Matrix4Array > Matrix4ArrayConstPtr
Definition: GU_AgentClip.h:216
fpreal32 SYSrint(fpreal32 val)
Definition: SYS_Floor.h:163
void setTranslates(const UT_Vector3T< S > &translates)
Definition: UT_Matrix4.h:1335
const UT_StringHolder & channelName(exint i) const
Returns the name of the specified channel.
Definition: GU_AgentClip.h:584
void setTransform(const UT_Vector3T< T > &t, const UT_QuaternionT< T > &r, const UT_Vector3T< T > &s)
Definition: GU_AgentClip.h:91
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:453
void setSampleRate(fpreal sample_rate)
Definition: GU_AgentClip.h:380
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
UT_Array< Xform > XformArray
Definition: GU_AgentClip.h:212
const UT_StringHolder & name() const
Definition: GU_AgentClip.h:320
double fpreal
Definition: SYS_Types.h:276
Quaternion class.
Definition: UT_Quaternion.h:51
fpreal32 FloatType
Definition: GU_AgentClip.h:208
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
fpreal length() const
Length of the clip, in seconds.
Definition: GU_AgentClip.h:371
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
exint nearestSampleFromSeconds(fpreal seconds) const
Definition: GU_AgentClip.h:494
UT_SharedPtr< Matrix4Array > Matrix4ArrayPtr
Definition: GU_AgentClip.h:215
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
const UT_StringHolder & fileName() const
Returns the name of the file referenced by the clip.
Definition: GU_AgentClip.h:327
#define const
Definition: zconf.h:214
void addScaled(T s, const type &xform)
Definition: GU_AgentClip.h:137
fpreal sampleRate() const
Definition: GU_AgentClip.h:378
bool hasLoadErrors() const
Returns whether there were errors when loading the clip from disk.
Definition: GU_AgentClip.h:337
GLfloat seconds
Definition: wglew.h:950
fpreal secondsFromSample(fpreal sample) const
Definition: GU_AgentClip.h:489
GLsizei samples
Definition: glew.h:2998
exint transformsPerSample() const
Number of transforms in each sample.
Definition: GU_AgentClip.h:347
float fpreal32
Definition: SYS_Types.h:195
GLdouble GLdouble t
Definition: glew.h:1398
bool isLoaded() const
Returns whether the clip's contents have been loaded from disk.
Definition: GU_AgentClip.h:334
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
exint sampleCount() const
Number of samples in this clip.
Definition: GU_AgentClip.h:356
const UT_QuaternionT< T > & rotate() const
Definition: GU_AgentClip.h:60
GLenum GLsizei len
Definition: glew.h:7752