Definition at line 824 of file landscape.h.
Public Member Functions | |
| float | eval (float s, float t) const |
| Evaluate. | |
| void | makeInteriors () |
| make default Interiors, according to Vertices and Tangents. | |
Data Fields | |
| float | Interiors [4] |
| The interiors, ia,ib,ic,id. NB: interiors are points, not vectors. | |
| float | Tangents [8] |
| The tangents ab, ba, bc, cb, cd, dc, da, ad. NB: tangents are points, not vectors. | |
| float | Vertices [4] |
| The vertices a,b,c,d of the quad patch. | |
|
||||||||||||
|
Evaluate.
Definition at line 2743 of file landscape.cpp. Referenced by NL3D::CLandscape::getHeightFieldDeltaZ().
02744 {
02745 float p;
02746
02747 float ps2 = ps * ps;
02748 float ps1 = 1.0f - ps;
02749 float ps12 = ps1 * ps1;
02750 float s0 = ps12 * ps1;
02751 float s1 = 3.0f * ps * ps12;
02752 float s2 = 3.0f * ps2 * ps1;
02753 float s3 = ps2 * ps;
02754 float pt2 = pt * pt;
02755 float pt1 = 1.0f - pt;
02756 float pt12 = pt1 * pt1;
02757 float t0 = pt12 * pt1;
02758 float t1 = 3.0f * pt * pt12;
02759 float t2 = 3.0f * pt2 * pt1;
02760 float t3 = pt2 * pt;
02761
02762 p = Vertices[0] * s0 * t0 +
02763 Tangents[7] * s1 * t0 +
02764 Tangents[6] * s2 * t0 +
02765 Vertices[3] * s3 * t0;
02766 p+= Tangents[0] * s0 * t1 +
02767 Interiors[0]* s1 * t1 +
02768 Interiors[3]* s2 * t1 +
02769 Tangents[5] * s3 * t1;
02770 p+= Tangents[1] * s0 * t2 +
02771 Interiors[1]* s1 * t2 +
02772 Interiors[2]* s2 * t2 +
02773 Tangents[4] * s3 * t2;
02774 p+= Vertices[1] * s0 * t3 +
02775 Tangents[2] * s1 * t3 +
02776 Tangents[3] * s2 * t3 +
02777 Vertices[2] * s3 * t3;
02778
02779 return p;
02780 }
|
|
|
make default Interiors, according to Vertices and Tangents.
Definition at line 2731 of file landscape.cpp. Referenced by NL3D::CLandscape::setHeightField().
02732 {
02733 float &a = Vertices[0];
02734 float &b = Vertices[1];
02735 float &c = Vertices[2];
02736 float &d = Vertices[3];
02737 Interiors[0] = Tangents[7] + Tangents[0] - a;
02738 Interiors[1] = Tangents[1] + Tangents[2] - b;
02739 Interiors[2] = Tangents[3] + Tangents[4] - c;
02740 Interiors[3] = Tangents[5] + Tangents[6] - d;
02741 }
|
|
|
The interiors, ia,ib,ic,id. NB: interiors are points, not vectors.
Definition at line 831 of file landscape.h. |
|
|
The tangents ab, ba, bc, cb, cd, dc, da, ad. NB: tangents are points, not vectors.
Definition at line 829 of file landscape.h. Referenced by NL3D::CLandscape::setHeightField(). |
|
|
The vertices a,b,c,d of the quad patch.
Definition at line 827 of file landscape.h. Referenced by NL3D::CLandscape::setHeightField(). |
1.3.6