29 #include "../precompiled.h"
51 if ( this->sweptSpline ) {
95 v = d.
Cross( previousFrame[2] );
119 axis[0][0] = 1.0f - ( yy + zz );
120 axis[0][1] = xy - wz;
121 axis[0][2] = xz + wy;
122 axis[1][0] = xy + wz;
123 axis[1][1] = 1.0f - ( xx + zz );
124 axis[1][2] = yz - wx;
125 axis[2][0] = xz - wy;
126 axis[2][1] = yz + wx;
127 axis[2][2] = 1.0f - ( xx + yy );
129 newFrame = previousFrame * axis;
132 newFrame[2].Normalize();
133 newFrame[1].Cross( newFrame[ 2 ], newFrame[ 0 ] );
134 newFrame[1].Normalize();
135 newFrame[0].Cross( newFrame[ 1 ], newFrame[ 2 ] );
136 newFrame[0].Normalize();
147 int i,
j,
offset, baseOffset, splineDiv, sweptSplineDiv;
150 idVec4 splinePos, splineD1;
158 verts.
SetNum( splineSubdivisions * sweptSplineSubdivisions,
false );
163 baseOffset = (splineSubdivisions-1) * sweptSplineSubdivisions;
164 for ( i = 0; i < sweptSplineSubdivisions; i++ ) {
165 t = totalTime * i / sweptSplineDiv;
169 verts[baseOffset+
i].st[0] = splinePos.
w;
177 for ( i = 0; i < splineSubdivisions; i++ ) {
178 t = totalTime * i / splineDiv;
185 offset = i * sweptSplineSubdivisions;
186 for ( j = 0; j < sweptSplineSubdivisions; j++ ) {
189 v->
st[0] =
verts[baseOffset+
j].st[0];
190 v->
st[1] = splinePos.
w;
202 for ( offset = i = 0; i < splineDiv; i++ ) {
204 i0 = (i+0) * sweptSplineSubdivisions;
205 i1 = (i+1) % splineSubdivisions * sweptSplineSubdivisions;
207 for ( j = 0; j < sweptSplineDiv; j++ ) {
210 j1 = (j+1) % sweptSplineSubdivisions;
void SetSweptSpline(idCurve_Spline< idVec4 > *sweptSpline)
idCurve_Spline< idVec4 > * sweptSpline
virtual boundary_t GetBoundaryType(void) const
idList< idDrawVert > verts
idCurve_Spline< idVec4 > * spline
void SetNum(int newnum, bool resize=true)
virtual void SetBoundaryType(const boundary_t bt)
static float Sqrt(float x)
virtual float GetCloseTime(void)
idVec3 Cross(const idVec3 &a) const
virtual void SetCloseTime(const float t)
void SetSweptCircle(const float radius)
virtual type GetCurrentValue(const float time) const
virtual type GetCurrentFirstDerivative(const float time) const
GLubyte GLubyte GLubyte a
GLdouble GLdouble GLdouble y2
float GetTime(const int index) const
void Tessellate(const int splineSubdivisions, const int sweptSplineSubdivisions)
void GenerateEdgeIndexes(void)
virtual int AddValue(const float time, const type &value)
void GetFrame(const idMat3 &previousFrame, const idVec3 dir, idMat3 &newFrame)
const idVec3 & ToVec3(void) const
int GetNumValues(void) const
static float ACos(float a)
void SetSpline(idCurve_Spline< idVec4 > *spline)
static float Cos(float a)