NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex Struct Reference

#include <mesh_mrm_skinned.h>


Detailed Description

The Final VBuffer.

Definition at line 427 of file mesh_mrm_skinned.h.

Public Member Functions

void getNormal (CVector &dest) const
void getPos (CVector &dest, float factor) const
void getU (float &_u) const
void getV (float &_v) const
void getWeight (float &dest, uint index) const
void serial (NLMISC::IStream &f)
void setNormal (const CVector &pos)
void setPos (const CVector &pos, float scaleFactor)
void setUV (float _u, float _v)
void setWeight (uint weightId, float weight)

Data Fields

uint8 Matrices [4]
sint16 Nx
sint16 Ny
sint16 Nz
sint16 U
sint16 V
uint8 Weights [4]
sint16 X
sint16 Y
sint16 Z


Member Function Documentation

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::getNormal CVector dest  )  const [inline]
 

Definition at line 442 of file mesh_mrm_skinned.h.

References NL3D_MESH_MRM_SKINNED_NORMAL_FACTOR, Nx, Ny, Nz, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

Referenced by NL3D::CMeshMRMSkinnedGeom::getVertexBuffer(), and NL3D::CMeshMRMSkinnedGeom::updateRawSkinNormal().

00443                         {
00444                                 dest.x = (float)Nx * (1.f/NL3D_MESH_MRM_SKINNED_NORMAL_FACTOR);
00445                                 dest.y = (float)Ny * (1.f/NL3D_MESH_MRM_SKINNED_NORMAL_FACTOR);
00446                                 dest.z = (float)Nz * (1.f/NL3D_MESH_MRM_SKINNED_NORMAL_FACTOR);
00447                         }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::getPos CVector dest,
float  factor
const [inline]
 

Definition at line 436 of file mesh_mrm_skinned.h.

References X, NLMISC::CVector::x, Y, NLMISC::CVector::y, Z, and NLMISC::CVector::z.

00437                         {
00438                                 dest.x = (float)X * factor;
00439                                 dest.y = (float)Y * factor;
00440                                 dest.z = (float)Z * factor;
00441                         }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::getU float &  _u  )  const [inline]
 

Definition at line 448 of file mesh_mrm_skinned.h.

References NL3D_MESH_MRM_SKINNED_UV_FACTOR.

Referenced by NL3D::CMeshMRMSkinnedGeom::getVertexBuffer(), and NL3D::CMeshMRMSkinnedGeom::updateRawSkinNormal().

00449                         {
00450                                 _u = (float)U * (1.f/NL3D_MESH_MRM_SKINNED_UV_FACTOR);
00451                         }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::getV float &  _v  )  const [inline]
 

Definition at line 452 of file mesh_mrm_skinned.h.

References NL3D_MESH_MRM_SKINNED_UV_FACTOR.

Referenced by NL3D::CMeshMRMSkinnedGeom::getVertexBuffer(), and NL3D::CMeshMRMSkinnedGeom::updateRawSkinNormal().

00453                         {
00454                                 _v = (float)V * (1.f/NL3D_MESH_MRM_SKINNED_UV_FACTOR);
00455                         }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::getWeight float &  dest,
uint  index
const [inline]
 

Definition at line 456 of file mesh_mrm_skinned.h.

References index, NL3D_MESH_MRM_SKINNED_WEIGHT_FACTOR, and uint.

Referenced by NL3D::CMeshMRMSkinnedGeom::getSkinWeights(), and NL3D::CMeshMRMSkinnedGeom::updateRawSkinNormal().

00457                         {
00458                                 dest = (float)Weights[index] * (1.f/NL3D_MESH_MRM_SKINNED_WEIGHT_FACTOR);
00459                         }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::serial NLMISC::IStream f  ) 
 

Definition at line 1937 of file mesh_mrm_skinned.cpp.

References Matrices, NL3D_MESH_MRM_SKINNED_MAX_MATRIX, Nx, Ny, Nz, NLMISC::IStream::serial(), NLMISC::IStream::serialVersion(), sint, uint, X, Y, and Z.

01938 {
01939         // Version
01940         sint ver = f.serialVersion(0);
01941 
01942         f.serial (X);
01943         f.serial (Y);
01944         f.serial (Z);
01945         f.serial (Nx);
01946         f.serial (Ny);
01947         f.serial (Nz);
01948         f.serial (U);
01949         f.serial (V);
01950         uint i;
01951         for (i=0; i<NL3D_MESH_MRM_SKINNED_MAX_MATRIX; i++)
01952         {
01953                 f.serial (Matrices[i]);
01954                 f.serial (Weights[i]);
01955         }
01956 }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::setNormal const CVector pos  ) 
 

Definition at line 1960 of file mesh_mrm_skinned.cpp.

References NLMISC::clamp(), NL3D_MESH_MRM_SKINNED_NORMAL_FACTOR, Nx, Ny, Nz, sint16, src, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.

Referenced by NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build().

01961 {
01962         CVector pos = src;
01963         pos *= NL3D_MESH_MRM_SKINNED_NORMAL_FACTOR;
01964         pos.x = (float)floor(pos.x+0.5f);
01965         pos.y = (float)floor(pos.y+0.5f);
01966         pos.z = (float)floor(pos.z+0.5f);
01967         clamp (pos.x, -32768.f, 32767.f);
01968         clamp (pos.y, -32768.f, 32767.f);
01969         clamp (pos.z, -32768.f, 32767.f);
01970         Nx = (sint16)pos.x;
01971         Ny = (sint16)pos.y;
01972         Nz = (sint16)pos.z;
01973 }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::setPos const CVector pos,
float  scaleFactor
 

Definition at line 1977 of file mesh_mrm_skinned.cpp.

References NLMISC::clamp(), sint16, X, NLMISC::CVector::x, Y, NLMISC::CVector::y, Z, and NLMISC::CVector::z.

Referenced by NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build().

01978 {
01979         CVector _pos = pos;
01980         _pos /= scaleFactor;
01981         _pos.x = (float)floor(_pos.x+0.5f);
01982         _pos.y = (float)floor(_pos.y+0.5f);
01983         _pos.z = (float)floor(_pos.z+0.5f);
01984         clamp (_pos.x, -32768.f, 32767.f);
01985         clamp (_pos.y, -32768.f, 32767.f);
01986         clamp (_pos.z, -32768.f, 32767.f);
01987         X = (sint16)_pos.x;
01988         Y = (sint16)_pos.y;
01989         Z = (sint16)_pos.z;
01990 }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::setUV float  _u,
float  _v
 

Definition at line 1994 of file mesh_mrm_skinned.cpp.

References NLMISC::clamp(), NL3D_MESH_MRM_SKINNED_UV_FACTOR, sint16, and v.

Referenced by NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build().

01995 {
01996         float u = _u * NL3D_MESH_MRM_SKINNED_UV_FACTOR;
01997         float v = _v * NL3D_MESH_MRM_SKINNED_UV_FACTOR;
01998         u = (float)floor(u+0.5f);
01999         v = (float)floor(v+0.5f);
02000         clamp (u, -32768.f, 32767.f);
02001         clamp (v, -32768.f, 32767.f);
02002         U = (sint16)u;
02003         V = (sint16)v;
02004 }

void NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::setWeight uint  weightId,
float  weight
 

Definition at line 2008 of file mesh_mrm_skinned.cpp.

References NLMISC::clamp(), NL3D_MESH_MRM_SKINNED_WEIGHT_FACTOR, uint, and uint8.

Referenced by NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build().

02009 {
02010         weight = weight * NL3D_MESH_MRM_SKINNED_WEIGHT_FACTOR;
02011         weight = (float)floor(weight+0.5f);
02012         clamp (weight, 0.f, 255.f);
02013         Weights[weightId] = (uint8)weight;
02014 }


Field Documentation

uint8 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::Matrices[ 4 ]
 

Definition at line 432 of file mesh_mrm_skinned.h.

Referenced by NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build(), NL3D::CMeshMRMSkinnedGeom::build(), NL3D::CMeshMRMSkinnedGeom::computeBonesId(), NL3D::CMeshMRMSkinnedGeom::getSkinWeights(), serial(), and NL3D::CMeshMRMSkinnedGeom::updateRawSkinNormal().

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::Nx
 

Definition at line 430 of file mesh_mrm_skinned.h.

Referenced by getNormal(), serial(), and setNormal().

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::Ny
 

Definition at line 430 of file mesh_mrm_skinned.h.

Referenced by getNormal(), serial(), and setNormal().

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::Nz
 

Definition at line 430 of file mesh_mrm_skinned.h.

Referenced by getNormal(), serial(), and setNormal().

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::U
 

Definition at line 431 of file mesh_mrm_skinned.h.

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::V
 

Definition at line 431 of file mesh_mrm_skinned.h.

uint8 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::Weights[ 4 ]
 

Definition at line 433 of file mesh_mrm_skinned.h.

Referenced by NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::build(), NL3D::CMeshMRMSkinnedGeom::build(), and NL3D::CMeshMRMSkinnedGeom::computeBonesId().

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::X
 

Definition at line 429 of file mesh_mrm_skinned.h.

Referenced by getPos(), serial(), and setPos().

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::Y
 

Definition at line 429 of file mesh_mrm_skinned.h.

Referenced by getPos(), serial(), and setPos().

sint16 NL3D::CMeshMRMSkinnedGeom::CPackedVertexBuffer::CPackedVertex::Z
 

Definition at line 429 of file mesh_mrm_skinned.h.

Referenced by getPos(), serial(), and setPos().


The documentation for this struct was generated from the following files:
Generated on Tue Mar 16 06:54:31 2004 for NeL by doxygen 1.3.6