NL3D::CVector3s Class Reference

#include <patch.h>


Public Member Functions

void pack (const CVector &v, const CVector &bias, float scale)
void serial (NLMISC::IStream &f)
void unpack (CVector &v, const CVector &bias, float scale) const

Data Fields

sint16 x
sint16 y
sint16 z


Member Function Documentation

void NL3D::CVector3s::pack const CVector v,
const CVector bias,
float  scale
[inline]
 

Definition at line 108 of file patch.h.

References NLMISC::clamp(), sint16, v, x, NLMISC::CVector::x, y, NLMISC::CVector::y, z, and NLMISC::CVector::z.

Referenced by NL3D::CZone::applyHeightField(), and NL3D::CZone::build().

00109         {
00110                 float   xr,yr,zr;
00111                 xr= (v.x - bias.x)/scale;
00112                 yr= (v.y - bias.y)/scale;
00113                 zr= (v.z - bias.z)/scale;
00114                 NLMISC::clamp(xr, -32768, 32767);
00115                 NLMISC::clamp(yr, -32768, 32767);
00116                 NLMISC::clamp(zr, -32768, 32767);
00117                 x= (sint16)xr;
00118                 y= (sint16)yr;
00119                 z= (sint16)zr;
00120         }

void NL3D::CVector3s::serial NLMISC::IStream f  )  [inline]
 

Definition at line 127 of file patch.h.

References NLMISC::IStream::serial(), x, y, and z.

00128         {
00129                 f.serial(x,y,z);
00130         }

void NL3D::CVector3s::unpack CVector v,
const CVector bias,
float  scale
const [inline]
 

Definition at line 121 of file patch.h.

References v, NLMISC::CVector::x, x, NLMISC::CVector::y, y, NLMISC::CVector::z, and z.

Referenced by NL3D::CZone::applyHeightField(), NL3D::CZone::retrieve(), and NL3D::CPatch::unpack().

00122         {
00123                 v.x= x*scale + bias.x;
00124                 v.y= y*scale + bias.y;
00125                 v.z= z*scale + bias.z;
00126         }


Field Documentation

sint16 NL3D::CVector3s::x
 

Definition at line 105 of file patch.h.

sint16 NL3D::CVector3s::y
 

Definition at line 105 of file patch.h.

sint16 NL3D::CVector3s::z
 

Definition at line 105 of file patch.h.


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 08:19:06 2004 for NeL by doxygen 1.3.6