HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_Rolloff.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: GEO Library (C++)
7  *
8  * COMMENTS: Rolloff class for proportional modeling
9  *
10  */
11 
12 #ifndef __GEO_Rolloff_h__
13 #define __GEO_Rolloff_h__
14 
15 #include "GEO_API.h"
16 // This must match PRM_Shared::prmSoftTypes in order...
17 
19 {
25 };
26 
27 class TS_MetaKernel;
28 
29 
31 {
32 public:
34  float r = 1.0f, bool c = true,
35  float tdeg0 = 0.0f, float tdeg1 = 0.0f,
36  TS_MetaKernel *kernel = 0);
37 
38  // Not all rolloff functions require a fsqrted distance, so
39  // avoid it if necessary.
40  float apply(float dist2, bool normalize = true) const;
41 
42  void radius(float r) {
43  myRadius = (r >= 0.0f ? r : 0.0f);
44  myRadius2 = myRadius * myRadius;
45  }
46  float radius() const { return myRadius; }
47  float radius2() const { return myRadius2; }
48 
49  void connected(bool c) { myConnected = c; }
50  bool connected() const { return myConnected; }
51 
52  void type(GEO_RolloffType t) { myType = t; }
53 
54 
55 private:
56  GEO_RolloffType myType;
57  float myRadius; // normalized
58  float myRadius2; // myRadius squared cached for speed
59  bool myConnected;
60 
61  float myTanRad0; // Angle of tangent slope
62  float myTanRad1;
63  TS_MetaKernel *myKernel; // My meta kernel
64 };
65 
66 #endif
bool connected() const
Definition: GEO_Rolloff.h:50
void radius(float r)
Definition: GEO_Rolloff.h:42
void connected(bool c)
Definition: GEO_Rolloff.h:49
float radius() const
Definition: GEO_Rolloff.h:46
float radius2() const
Definition: GEO_Rolloff.h:47
GLfloat f
Definition: glcorearb.h:1926
GEO_RolloffType
Definition: GEO_Rolloff.h:18
#define GEO_API
Definition: GEO_API.h:14
GLdouble t
Definition: glad.h:2397
void type(GEO_RolloffType t)
Definition: GEO_Rolloff.h:52
GLboolean r
Definition: glcorearb.h:1222
constexpr T normalize(UT_FixedVector< T, D > &a) noexcept