A 4*4 Homogeneous Matrix. More...
#include <matrix.h>
Public Types | |
| enum | TRotOrder { XYZ, XZY, YXZ, YZX, ZXY, ZYX } |
Rotation Order. More... | |
Public Member Functions | |
| void | setArbitraryRotI (const CVector &idir) |
| Choose an arbitrary rotation matrix for the given direction. | |
| void | setArbitraryRotJ (const CVector &jdir) |
| Choose an arbitrary rotation matrix for the given direction. | |
| void | setArbitraryRotK (const CVector &kdir) |
| Choose an arbitrary rotation matrix for the given direction. | |
Object | |
| CMatrix () | |
| Constructor which init to identity(). | |
| CMatrix (const CMatrix &) | |
| Copy Constructor. | |
| CMatrix & | operator= (const CMatrix &) |
| operator=. | |
Sets | |
| void | identity () |
| Reset the matrix to identity. | |
| void | setRot (const CVector &i, const CVector &j, const CVector &k, bool hintNoScale=false) |
| Explicit setup the Rotation/Scale matrix (base). | |
| void | setRot (const float m33[9], bool hintNoScale=false) |
| Explicit setup the Rotation/Scale matrix (base). | |
| void | setRot (const CVector &v, TRotOrder ro) |
| Explicit setup the Rotation matrix (base) as a Euler rotation matrix. | |
| void | setRot (const CQuat &quat) |
| Explicit setup the Rotation matrix (base) as a Quaternion rotation matrix. | |
| void | setRot (const CMatrix &matrix) |
| Explicit setup the Rotation/Scale matrix (base) with the rotation part of an other matrix. | |
| void | setScale (float scale) |
| Explicit setup the Rotation/Scale matrix (base) with a scale (=> matrix has no Rotation). | |
| void | setScale (const CVector &v) |
| Explicit setup the Rotation/Scale matrix (base) with a scale (=> matrix has no Rotation). | |
| void | setPos (const CVector &v) |
| Explicit setup the Translation component. | |
| void | movePos (const CVector &v) |
| Explicit move the Translation component. | |
| void | setProj (const float proj[4]) |
| Explicit setup the Projection component. | |
| void | resetProj () |
| Reset the Projection component to 0 0 0 1. | |
| void | set (const float m44[16]) |
| Explicit setup the 4*4 matrix. | |
| void | setCoefficient (float coeff, sint i, sint j) |
| Setup the (i, j) matrix coefficient. | |
Gets. | |
| void | getRot (CVector &i, CVector &j, CVector &k) const |
| Get the Rotation/Scale matrix (base). | |
| void | getRot (float m33[9]) const |
| Get the Rotation/Scale matrix (base). | |
| void | getRot (CQuat &quat) const |
| Get the Rotation matrix (base). | |
| CQuat | getRot () const |
| Get the Rotation matrix (base). | |
| void | getPos (CVector &v) const |
| Get the Translation component. | |
| const CVector & | getPos () const |
| Get the Translation component. | |
| void | getProj (float proj[4]) const |
| Get the Projection component. | |
| CVector | getI () const |
| Get the I vector of the Rotation/Scale matrix (base). | |
| CVector | getJ () const |
| Get the J vector of the Rotation/Scale matrix (base). | |
| CVector | getK () const |
| Get the K vector of the Rotation/Scale matrix (base). | |
| void | get (float m44[16]) const |
| Get 4*4 matrix. | |
| const float * | get () const |
| Get 4*4 matrix. | |
3D Operations. | |
| void | translate (const CVector &v) |
| Apply a translation to the matrix. same as M=M*T. | |
| void | rotateX (float a) |
| Apply a rotation on axis X to the matrix. | |
| void | rotateY (float a) |
| Apply a rotation on axis Y to the matrix. | |
| void | rotateZ (float a) |
| Apply a rotation on axis Z to the matrix. | |
| void | rotate (const CVector &v, TRotOrder ro) |
| Apply a Euler rotation. | |
| void | rotate (const CQuat &quat) |
| Apply a quaternion rotation. | |
| void | scale (float f) |
| Apply a uniform scale to the matrix. | |
| void | scale (const CVector &scale) |
| Apply a non-uniform scale to the matrix. | |
Matrix Operations. | |
| void | setMulMatrix (const CMatrix &m1, const CMatrix &m2) |
| Matrix multiplication. | |
| CMatrix | operator* (const CMatrix &in) const |
| Matrix multiplication. | |
| CMatrix & | operator*= (const CMatrix &in) |
| equivalent to M=M*in | |
| void | setMulMatrixNoProj (const CMatrix &m1, const CMatrix &m2) |
| Matrix multiplication assuming no projection at all in m1/m2 and Hence this. | |
| void | transpose3x3 () |
| transpose the rotation part only of the matrix (swap columns/lines). | |
| void | transpose () |
| transpose the matrix (swap columns/lines). | |
| void | invert () |
| Invert the matrix. | |
| CMatrix | inverted () const |
| Return the matrix inverted. | |
| bool | normalize (TRotOrder pref) |
| Normalize the matrix so that the rotation part is now an orthonormal basis, ie a rotation with no scale. | |
| CVector | mulVector (const CVector &v) const |
| \ Vector Operations. | |
| CVector | mulPoint (const CVector &v) const |
| Multiply a point. ie v.w=1 so the Translation component do affect result. Projection doesn't affect result. | |
| CVector | operator* (const CVector &v) const |
| Multiply a point. | |
| CVectorH | operator* (const CVectorH &v) const |
| Multiply with an homogeneous vector. | |
Misc | |
| void | serial (IStream &f) |
| bool | hasScalePart () const |
| return true if the matrix has a scale part (by scale(), by multiplication etc...) | |
| bool | hasScaleUniform () const |
| return true if hasScalePart() and if if this scale is uniform. | |
| float | getScaleUniform () const |
| return true the uniform scale. valid only if hasScaleUniform() is true, else 1 is returned. | |
| bool | hasProjectionPart () const |
| return true if the matrix has a projection part (by setProj(), by multiplication etc...) | |
Static Public Attributes | |
| static const CMatrix | Identity |
| The identity matrix. Same as CMatrix(). | |
Private Member Functions | |
| bool | fastInvert33 (CMatrix &ret) const |
| bool | slowInvert33 (CMatrix &ret) const |
| bool | slowInvert44 (CMatrix &ret) const |
| float & | mat (sint i, sint j) |
| const float & | mat (sint i, sint j) const |
| void | getCofactIndex (sint i, sint &l1, sint &l2, sint &l3) const |
| bool | hasTrans () const |
| bool | hasRot () const |
| bool | hasProj () const |
| bool | hasAll () const |
| void | testExpandRot () const |
| void | testExpandProj () const |
| void | setScaleUni (float scale) |
Private Attributes | |
| float | M [16] |
| float | Scale33 |
| uint32 | StateBit |
Friends | |
| CPlane | operator* (const CPlane &p, const CMatrix &m) |
| Plane (line vector) multiplication. | |
A 4*4 Homogeneous Matrix.
This is a column matrix, so operations like: v1=A*B*C*v0; applies C first , then B, then A to vector v0.
Since it is a column matrix, the first column is the I vector of the base, 2nd is J, 3th is K.
4th column vector is T, the translation vector.
Angle orientation are: Xaxis: YtoZ. Yaxis: ZtoX. Zaxis: XtoY.
This matrix keep a matrix state to improve Matrix, vector and plane computing (matrix inversion, vector multiplication...). The internal matrix know if:
An example of improvement is that CMatrix::operator*(const CVector &v) return v if the matrix is identity.
By default, a matrix is identity. But for a performance view, this is just a StateBit=0...
Definition at line 63 of file matrix.h.
| NLMISC::CMatrix::CMatrix | ( | ) | [inline] |
Constructor which init to identity().
| NLMISC::CMatrix::CMatrix | ( | const CMatrix & | m | ) |
Copy Constructor.
Definition at line 161 of file matrix.cpp.
Definition at line 966 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, MAT_SCALEUNI, Scale33, and StateBit.
Referenced by inverted().
| const float * NLMISC::CMatrix::get | ( | ) | const |
Get 4*4 matrix.
Definition at line 448 of file matrix.cpp.
References M, testExpandProj(), and testExpandRot().
| void NLMISC::CMatrix::get | ( | float | m44[16] | ) | const |
Get 4*4 matrix.
| m44 | the matrix's 4*4 column matrix (4x4 matrix stored in column-major order as 16 consecutive values) |
Definition at line 441 of file matrix.cpp.
References M, testExpandProj(), and testExpandRot().
Referenced by NL3D::CLodCharacterManager::addRenderCharacterKey(), NL3D::CDriverGL::cleanLightSetup(), NL3D::CDriverGL::doRefreshRenderSetup(), NL3D::CLodCharacterManager::fastIntersect(), NL3D::CDriverGL::setConstantFog(), NL3D::CDriverGL::setConstantMatrix(), NL3D::CDriverGL::setFrustumMatrix(), NL3D::CDriverD3D::setFrustumMatrix(), NL3D::CDriverGL::setupSpecularBegin(), and NL3D::CDriverGL::setupUserTextureMatrix().
| void NLMISC::CMatrix::getCofactIndex | ( | sint | i, | |
| sint & | l1, | |||
| sint & | l2, | |||
| sint & | l3 | |||
| ) | const [inline, private] |
Definition at line 388 of file matrix.h.
Referenced by slowInvert44().
| CVector NLMISC::CMatrix::getI | ( | ) | const |
Get the I vector of the Rotation/Scale matrix (base).
Definition at line 417 of file matrix.cpp.
References a11, a21, a31, and hasRot().
Referenced by NLMISC::CBSphere::applyTransform(), NL3D::CShadowMap::buildCasterCameraMatrix(), NL3D::CShadowMap::buildClipInfoFromMatrix(), NL3D::CShadowMap::buildProjectionInfos(), NL3D::CPSLocated::computeI(), NL3D::CPSLocated::computeIWithZAxisAligned(), NL3D::CPlaneBasis::CPlaneBasis(), NL3D::CMaterial::decompUserTexMat(), NL3D::CPSUtil::displayBasis(), NL3D::CPSUtil::displayCylinder(), NL3D::CPSUtil::displayDisc(), NL3D::CWaterModel::fillVBHard(), NL3D::CWaterModel::fillVBSoft(), NL3D::CBone::interpolateBoneSkinMatrix(), NL3D::CZoneLighter::light(), normalize(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CQuadTree< T >::selectSegment(), NL3D::CCameraCol::setApplyMatrix(), NL3D::CPSZoneRectangle::setMatrix(), NL3D::CPSZoneCylinder::setMatrix(), NL3D::CPSEmitterRectangle::setMatrix(), NL3D::CPSZonePlane::show(), slowInvert33(), NL3D::CFlareModel::traverseRender(), NL3D::CWaterModel::updateDiffuseMapMatrix(), and NL3D::CSpinnerFunctor::updateSamples().
| CVector NLMISC::CMatrix::getJ | ( | ) | const |
Get the J vector of the Rotation/Scale matrix (base).
Definition at line 425 of file matrix.cpp.
References a12, a22, a32, and hasRot().
Referenced by NLMISC::CBSphere::applyTransform(), NL3D::CShadowMap::buildCasterCameraMatrix(), NL3D::CShadowMap::buildClipInfoFromMatrix(), NL3D::CShadowMap::buildProjectionInfos(), NL3D::CPSLocated::computeJ(), NL3D::CPlaneBasis::CPlaneBasis(), NL3D::CVegetableQuadrant::CVegetableQuadrant(), NL3D::CMaterial::decompUserTexMat(), NL3D::CPSUtil::displayBasis(), NL3D::CPSUtil::displayCylinder(), NL3D::CPSUtil::displayDisc(), NL3D::CWaterModel::fillVBHard(), NL3D::CWaterModel::fillVBSoft(), NL3D::CParticleSystem::getLOD(), NL3D::CParticleSystem::getLODVect(), NL3D::CTessFacePriorityList::init(), NL3D::CBone::interpolateBoneSkinMatrix(), NL3D::CZoneLighter::light(), normalize(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CVisualCollisionManager::receiveShadowMap(), NL3D::CQuadTree< T >::selectRay(), NL3D::CQuadTree< T >::selectSegment(), NL3D::CCameraCol::setApplyMatrix(), NL3D::CPSZoneRectangle::setMatrix(), NL3D::CPSZoneCylinder::setMatrix(), NL3D::CPSEmitterRectangle::setMatrix(), NL3D::CPSZonePlane::show(), slowInvert33(), NL3D::CPointLightModel::traverseLight(), NL3D::CFlareModel::traverseRender(), NL3D::CWaterModel::updateDiffuseMapMatrix(), and NL3D::CSpinnerFunctor::updateSamples().
| CVector NLMISC::CMatrix::getK | ( | void | ) | const |
Get the K vector of the Rotation/Scale matrix (base).
Definition at line 433 of file matrix.cpp.
References a13, a23, a33, and hasRot().
Referenced by NLMISC::CBSphere::applyTransform(), NL3D::CShadowMap::buildCasterCameraMatrix(), NL3D::CShadowMap::buildClipInfoFromMatrix(), NL3D::CShadowMap::buildProjectionInfos(), NL3D::CPSLocated::computeK(), NL3D::CMaterial::decompUserTexMat(), NL3D::CPSUtil::displayBasis(), NL3D::CPSUtil::displayCylinder(), NL3D::CWaterModel::fillVBHard(), NL3D::CWaterModel::fillVBSoft(), NL3D::CBone::interpolateBoneSkinMatrix(), normalize(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CQuadTree< T >::selectRay(), NL3D::CQuadTree< T >::selectSegment(), NL3D::CCameraCol::setApplyMatrix(), NL3D::CPSZoneDisc::setMatrix(), NL3D::CPSZonePlane::setMatrix(), NL3D::CPSCylindricVortex::setMatrix(), slowInvert33(), NL3D::CFlareModel::traverseRender(), and NL3D::CWaterModel::updateDiffuseMapMatrix().
| const CVector& NLMISC::CMatrix::getPos | ( | void | ) | const [inline] |
| void NLMISC::CMatrix::getPos | ( | CVector & | v | ) | const [inline] |
Get the Translation component.
| v | the matrix's translation vector. |
Definition at line 219 of file matrix.h.
References M, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Referenced by NL3D::CLightingManager::addDynamicLight(), NL3D::CVegetableManager::addInstance(), NL3D::CLodCharacterManager::addRenderCharacterKey(), NL3D::CShadowMap::buildClipInfoFromMatrix(), NL3D::CShadowMap::buildProjectionInfos(), NL3D::CWaveMakerShape::clip(), NL3D::CTransformShape::clip(), NL3D::CFlareShape::clip(), NL3D::CClipTrav::clipShadowCasters(), NL3D::CBone::compute(), NL3D::CSkeletonModel::computeDisplayLodCharacterPriority(), NL3D::CShadowMapManager::computeShadowDirection(), NL3D::CMaterial::decompUserTexMat(), NL3D::CPSUtil::displayBasis(), NL3D::CLodCharacterManager::fastIntersect(), NL3D::CWaterModel::fillVBHard(), NL3D::CWaterModel::fillVBSoft(), NL3D::CVegetable::generateInstance(), NL3D::CSkeletonModel::generateShadowMap(), NL3D::CWaterModel::getAttenuatedHeight(), NL3D::CParticleSystem::getDistFromViewer(), NL3D::CTransformShape::getLightHotSpotInWorld(), NL3D::CSkeletonModel::getLightHotSpotInWorld(), NL3D::CParticleSystem::getLOD(), NL3D::CParticleSystem::getLODVect(), NL3D::CWaterModel::getNumWantedVertices(), NLPACS::UMoveContainer::getPACSCoordsFromMatrix(), NL3D::CViewport::getRayWithPoint(), NL3D::CEvent3dMouseListener::getViewMatrix(), NL3D::CLightingManager::insertStaticLightedModel(), NL3D::CBone::interpolateBoneSkinMatrix(), NL3D::CParticleSystem::interpolateFXPosDelta(), NL3D::CParticleSystem::interpolateUserPosDelta(), NL3D::ITransformable::lookAt(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CParticleSystemModel::refreshRscDeletion(), NL3D::CComputedString::render2D(), NL3D::CSkeletonModel::renderCLod(), NL3D::CSkeletonModel::renderIntoSkeletonShadowMap(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), NL3D::CShadowMapManager::renderProject(), NL3D::CShadowMapManager::selectShadowMapsToGenerate(), NL3D::CPSZoneRectangle::setMatrix(), NL3D::CPSZoneCylinder::setMatrix(), NL3D::CPSZoneDisc::setMatrix(), NL3D::CPSZoneSphere::setMatrix(), NL3D::CPSZonePlane::setMatrix(), NL3D::CPSCylindricVortex::setMatrix(), NL3D::CPSSphericalEmitter::setMatrix(), NL3D::CPSEmitterRectangle::setMatrix(), NL3D::CParticleSystem::setNumTris(), NL3D::CParticleSystem::setSysMat(), NL3D::CDriverGL::setupModelMatrix(), NL3D::CParticleSystem::setUserMatrix(), NL3D::CParticleSystem::step(), NL3D::CRenderTrav::traverse(), NL3D::CWaveMakerModel::traverseAnimDetail(), NL3D::CSkeletonModel::traverseAnimDetail(), NL3D::CParticleSystemModel::traverseClip(), NL3D::CTransformShape::traverseLoadBalancingPass0(), NL3D::CWaterModel::traverseRender(), NL3D::CFlareModel::traverseRender(), NL3D::CTravCameraScene::update(), NL3D::CWaterModel::updateDiffuseMapMatrix(), and NL3D::CFlareModel::updateOcclusionQuery().
| void NLMISC::CMatrix::getProj | ( | float | proj[4] | ) | const |
| CQuat NLMISC::CMatrix::getRot | ( | ) | const [inline] |
| void NLMISC::CMatrix::getRot | ( | CQuat & | quat | ) | const |
Get the Rotation matrix (base).
| quat | the return quaternion. |
Definition at line 1385 of file matrix.cpp.
References NLMISC::CQuat::Identity, mat(), MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, normalize(), StateBit, NLMISC::CQuatT< T >::w, NLMISC::CQuatT< T >::x, NLMISC::CQuatT< T >::y, NLMISC::CQuatT< T >::z, and ZYX.
| void NLMISC::CMatrix::getRot | ( | float | m33[9] | ) | const |
Get the Rotation/Scale matrix (base).
| i | The matrix's I vector of the Cartesian base. | |
| j | The matrix's J vector of the Cartesian base. | |
| k | The matrix's K vector of the Cartesian base. |
Definition at line 351 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, hasRot(), and NLMISC::CVector::set().
Referenced by NL3D::CTargetAnimCtrl::execute(), NL3D::CTargetAnimCtrl::getCurrentLSRotationFromBone(), NL3D::ITransformable::lookAt(), setRot(), and NL3D::UTransformable::setRotQuat().
| float NLMISC::CMatrix::getScaleUniform | ( | ) | const |
return true the uniform scale. valid only if hasScaleUniform() is true, else 1 is returned.
Definition at line 104 of file matrix.cpp.
References hasScaleUniform(), and Scale33.
Referenced by NLMISC::CBSphere::applyTransform(), and NL3D::CCameraCol::setApplyMatrix().
| bool NLMISC::CMatrix::hasAll | ( | ) | const [inline, private] |
Definition at line 127 of file matrix.cpp.
References hasProj(), hasRot(), and hasTrans().
Referenced by operator=().
| bool NLMISC::CMatrix::hasProj | ( | ) | const [inline, private] |
Definition at line 123 of file matrix.cpp.
References MAT_PROJ, and StateBit.
Referenced by getProj(), hasAll(), operator=(), rotateX(), rotateY(), rotateZ(), scale(), serial(), setMulMatrix(), testExpandProj(), translate(), and transpose().
| bool NLMISC::CMatrix::hasProjectionPart | ( | ) | const |
return true if the matrix has a projection part (by setProj(), by multiplication etc...)
Definition at line 94 of file matrix.cpp.
| bool NLMISC::CMatrix::hasRot | ( | ) | const [inline, private] |
Definition at line 115 of file matrix.cpp.
References MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, and StateBit.
Referenced by getI(), getJ(), getK(), getRot(), hasAll(), mulPoint(), mulVector(), operator=(), rotateX(), rotateY(), serial(), setMulMatrix(), setRot(), testExpandRot(), translate(), and transpose3x3().
| bool NLMISC::CMatrix::hasScalePart | ( | ) | const |
return true if the matrix has a scale part (by scale(), by multiplication etc...)
Definition at line 90 of file matrix.cpp.
References MAT_SCALEANY, MAT_SCALEUNI, and StateBit.
Referenced by NLMISC::CBSphere::applyTransform(), NL3D::CDriverGL::doRefreshRenderSetup(), NL3D::CCameraCol::setApplyMatrix(), and NL3D::CDriverD3D::updateMatrices().
| bool NLMISC::CMatrix::hasScaleUniform | ( | ) | const |
return true if hasScalePart() and if if this scale is uniform.
Definition at line 100 of file matrix.cpp.
References MAT_SCALEANY, MAT_SCALEUNI, and StateBit.
Referenced by NLMISC::CBSphere::applyTransform(), getScaleUniform(), serial(), NL3D::CCameraCol::setApplyMatrix(), setMulMatrixNoProj(), and setRot().
| bool NLMISC::CMatrix::hasTrans | ( | ) | const [inline, private] |
Definition at line 119 of file matrix.cpp.
References MAT_TRANS, and StateBit.
Referenced by hasAll(), mulPoint(), serial(), setMulMatrix(), and transpose().
| void NLMISC::CMatrix::identity | ( | ) |
Reset the matrix to identity.
Definition at line 198 of file matrix.cpp.
References a14, a24, a34, MAT_IDENTITY, and StateBit.
Referenced by NLLIGO::CZoneTemplate::build(), NLLIGO::CZoneEdge::buildMatrix(), NL3D::CCloud::calcBill(), NL3D::CCubeGrid< TCell >::CCubeGrid(), NL3D::CDriverD3D::CDriverD3D(), NL3D::CEvent3dMouseListener::CEvent3dMouseListener(), NL3D::CStaticQuadGrid< T >::clear(), NL3D::CLandscapeModel::clipAndRenderLandscape(), NLPACS::CQuadGrid< T >::CQuadGrid(), NL3D::CQuadTree< T >::CQuadTree(), NL3D::CStaticQuadGrid< T >::CStaticQuadGrid(), NL3D::CTransform::CTransform(), NL3D::CTravCameraScene::CTravCameraScene(), NL3D::CCloud::disp(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CCloud::genBill(), NL3D::CInstanceGroup::getInstanceMatrix(), NL3D::CWaterShape::getShapeInWorldSpace(), NL3D::CQuadGrid< T >::initCons(), InitZBuffer(), inverted(), NL3D::ITransformable::lookAt(), NL3D::CPSConstraintMesh::makePrerotatedVb(), NEL3DCalcBase(), NL3D::NEL3DCalcBase(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CVegetableManager::render(), NL3D::CComputedString::render2D(), rotate(), NL3D::CQuadTree< T >::selectRay(), NL3D::CQuadTree< T >::selectSegment(), serial(), NL3D::CDriverUser::setMatrixMode2D(), NL3D::CCloud::setMode2D(), setMulMatrix(), setRot(), NL3D::CDriverGL::setupViewMatrix(), NL3D::CDriverGL::setupViewMatrixEx(), NL3D::CPSGravity::show(), NLSOUND::CListenerFMod::updateFModPos(), NL3D::ITransformable::updateMatrix(), and NL3D::CPSMesh::updatePos().
| void NLMISC::CMatrix::invert | ( | ) |
Invert the matrix.
if the matrix can't be inverted, it is set to identity.
Definition at line 911 of file matrix.cpp.
References inverted().
Referenced by NL3D::CVegetableManager::addInstance(), NL3D::CCluster::applyMatrix(), NLLIGO::CZoneTemplate::build(), NL3D::CCamera::buildCameraPyramid(), NL3D::CCloud::calcBill(), NL3D::CLodCharacterManager::CLodCharacterManager(), CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::compile(), NL3D::CMaterial::decompUserTexMat(), NL3D::CSkeletonModel::fastIntersect(), NL3D::CRayMesh::fastIntersect(), NL3D::CCloud::genBill(), InitZBuffer(), NL3D::CZoneLighter::light(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CCloudScape::render(), NL3D::CShadowMapManager::renderProject(), NL3D::CDriverGL::setConstantMatrix(), NL3D::CDriverUser::setMatrixMode3D(), NL3D::CLodCharacterManager::setupNormalCorrectionMatrix(), NL3D::CMeshVPWindTree::setupPerInstanceConstants(), NL3D::CDriverGL::setupViewMatrix(), NL3D::CDriverD3D::setupViewMatrix(), NL3D::CDriverGL::setupViewMatrixEx(), NL3D::CCluster::setWorldMatrix(), and NLMISC::CPolygon::toConvexPolygonsLocalAndBSP().
| CMatrix NLMISC::CMatrix::inverted | ( | ) | const |
Return the matrix inverted.
if the matrix can't be inverted, identity is returned.
Definition at line 1088 of file matrix.cpp.
References a14, a24, a34, fastInvert33(), identity(), MAT_PROJ, MAT_ROT, MAT_SCALEANY, MAT_TRANS, slowInvert33(), slowInvert44(), StateBit, testExpandProj(), and testExpandRot().
Referenced by NL3D::CMeshGeom::activeInstance(), NL3D::CStaticQuadGrid< T >::build(), NL3D::CShadowMap::buildCasterCameraMatrix(), NL3D::CInstanceLighter::computeSunContribution(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CSkeletonModel::generateShadowMap(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CVisualCollisionMesh::getCameraCollision(), invert(), NL3D::CZoneLighter::lightWater(), NL3D::CHeatHaze::performHeatHaze(), NL3D::CVisualCollisionMesh::receiveShadowMap(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshGeom::render(), NL3D::CMeshMRMGeom::renderSkin(), NL3D::CMeshGeom::renderSkin(), NL3D::CParticleSystem::setSysMat(), NL3D::CParticleSystem::setUserMatrix(), NL3D::CParticleSystem::setViewMat(), NL3D::CTravCameraScene::update(), and NL3D::CWaterModel::updateDiffuseMapMatrix().
| void NLMISC::CMatrix::movePos | ( | const CVector & | v | ) |
Explicit move the Translation component.
| v | a vector to move the translation vector. |
Definition at line 277 of file matrix.cpp.
References a14, a24, a34, MAT_TRANS, StateBit, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Multiply a point. ie v.w=1 so the Translation component do affect result. Projection doesn't affect result.
Definition at line 1263 of file matrix.cpp.
References a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, hasRot(), hasTrans(), NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Referenced by NL3D::CCloud::calcBill(), operator*(), NL3D::CMeshMultiLodInstance::setPosCoarseMesh(), and NL3D::CPortal::setWorldMatrix().
\ Vector Operations.
Multiply a normal. ie v.w=0 so the Translation component doesn't affect result. Projection doesn't affect result.
Definition at line 1246 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, hasRot(), NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Referenced by NL3D::CVegetableManager::addInstance(), NL3D::CLodCharacterManager::addRenderCharacterKey(), NL3D::CMeshVPPerPixelLight::begin(), NL3D::CRenderTrav::beginVPLightSetup(), NL3D::CPSConstraintMesh::CGlobalTexAnim::buildMatrix(), NL3D::CPSZoneRectangle::computeCollisions(), NL3D::CPSZoneCylinder::computeCollisions(), NL3D::CPSZoneDisc::computeCollisions(), NL3D::CPSZonePlane::computeCollisions(), NL3D::CPSMagneticForce::computeForces(), NL3D::CPSCylindricVortex::computeForces(), NL3D::CPSGravity::computeForces(), NL3D::CPSDirectionnalForce::computeForces(), NL3D::CPSLocated::computeI(), NL3D::CPSLocated::computeIWithZAxisAligned(), NL3D::CPSLocated::computeJ(), NL3D::CPSLocated::computeK(), NL3D::CPSLocated::computeKWithZAxisAligned(), NL3D::CParticleSystem::getLODVect(), NLPACS::UMoveContainer::getPACSCoordsFromMatrix(), NL3D::CEvent3dMouseListener::getViewMatrix(), NL3D::CPSConstraintMesh::makePrerotatedVb(), NL3D::CPSLocated::newElement(), NL3D::CMeshVPWindTree::setupPerInstanceConstants(), NL3D::CPSSound::step(), NL3D::CAnimatedMaterial::update(), NL3D::CTravCameraScene::update(), and NL3D::CVegetableManager::updateInstanceLighting().
Normalize the matrix so that the rotation part is now an orthonormal basis, ie a rotation with no scale.
NB: projection part and translation part are not modified.
| pref | the preference axis order to normalize. ZYX means that K direction will be kept, and the plane JK will be used to lead the I vector. |
Definition at line 1173 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, getI(), getJ(), getK(), NLMISC::CVector::isNull(), MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, NLMISC::CVector::normalize(), Scale33, StateBit, testExpandRot(), NLMISC::CVector::x, XYZ, XZY, NLMISC::CVector::y, YXZ, YZX, NLMISC::CVector::z, ZXY, and ZYX.
Referenced by NL3D::CCameraCol::build(), CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::compile(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CSkeletonSpawnScript::evaluate(), NL3D::CTargetAnimCtrl::execute(), NL3D::CPatch::generateTileVegetable(), getRot(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CQuadTree< T >::selectRay(), NL3D::CQuadTree< T >::selectSegment(), setArbitraryRotI(), setArbitraryRotJ(), setArbitraryRotK(), NL3D::UTransformable::setRotQuat(), NLSOUND::CListenerFMod::updateFModPos(), and NL3D::CTransform::updateWorldMatrixFromFather().
Multiply with an homogeneous vector.
Definition at line 1292 of file matrix.cpp.
References a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44, testExpandProj(), testExpandRot(), NLMISC::CVectorH::w, NLMISC::CVectorH::x, NLMISC::CVectorH::y, and NLMISC::CVectorH::z.
| void NLMISC::CMatrix::resetProj | ( | ) |
Reset the Projection component to 0 0 0 1.
Definition at line 307 of file matrix.cpp.
References a41, a42, a43, a44, MAT_PROJ, MAT_VALIDPROJ, and StateBit.
| void NLMISC::CMatrix::rotate | ( | const CQuat & | quat | ) |
Apply a Euler rotation.
| v | a vector of 3 angle (in radian), giving rotation around each axis (x,y,z) | |
| ro | the order of transformation applied. if ro==XYZ, then the transform is M=M*Rx*Ry*Rz |
Definition at line 615 of file matrix.cpp.
References identity(), rotateX(), rotateY(), rotateZ(), NLMISC::CVector::x, XYZ, XZY, NLMISC::CVector::y, YXZ, YZX, NLMISC::CVector::z, ZXY, and ZYX.
Referenced by NL3D::CInstanceGroup::getInstanceMatrix(), NL3D::CWaterShape::getShapeInWorldSpace(), NL3D::CPSConstraintMesh::makePrerotatedVb(), NL3D::CEvent3dMouseListener::operator()(), setRot(), NL3D::CPSFace::step(), and NL3D::ITransformable::updateMatrix().
| void NLMISC::CMatrix::rotateX | ( | float | a | ) |
Apply a rotation on axis X to the matrix.
same as M=M*Rx
| a | angle (in radian). |
Definition at line 495 of file matrix.cpp.
References a12, a13, a22, a23, a32, a33, a42, a43, hasProj(), hasRot(), MAT_ROT, StateBit, and testExpandRot().
Referenced by NL3D::CEvent3dMouseListener::operator()(), and rotate().
| void NLMISC::CMatrix::rotateY | ( | float | a | ) |
Apply a rotation on axis Y to the matrix.
same as M=M*Ry
| a | angle (in radian). |
Definition at line 535 of file matrix.cpp.
References a11, a13, a21, a23, a31, a33, a41, a43, hasProj(), hasRot(), MAT_ROT, StateBit, and testExpandRot().
Referenced by NL3D::ITransformable::lookAt(), NL3D::CComputedString::render2D(), and rotate().
| void NLMISC::CMatrix::rotateZ | ( | float | a | ) |
Apply a rotation on axis Z to the matrix.
same as M=M*Rz
| a | angle (in radian). |
Definition at line 575 of file matrix.cpp.
References a11, a12, a21, a22, a31, a32, a41, a42, hasProj(), MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, StateBit, and testExpandRot().
Referenced by NLLIGO::CZoneTemplate::build(), NLLIGO::CZoneEdge::buildMatrix(), NL3D::CLodCharacterManager::CLodCharacterManager(), NL3D::CVegetableQuadrant::CVegetableQuadrant(), NL3D::CTessFacePriorityList::init(), NL3D::CEvent3dMouseListener::operator()(), and rotate().
| void NLMISC::CMatrix::scale | ( | const CVector & | scale | ) |
Apply a non-uniform scale to the matrix.
Definition at line 666 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43, hasProj(), MAT_SCALEANY, scale(), StateBit, testExpandRot(), NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
| void NLMISC::CMatrix::scale | ( | float | f | ) |
Apply a uniform scale to the matrix.
Definition at line 641 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43, hasProj(), MAT_SCALEANY, MAT_SCALEUNI, Scale33, StateBit, and testExpandRot().
Referenced by NL3D::ComputeTexturedRibbonMesh(), NL3D::ComputeUntexturedRibbonMesh(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CVegetable::generateInstance(), NL3D::CInstanceGroup::getInstanceMatrix(), NL3D::CWaterShape::getShapeInWorldSpace(), NL3D::CInstanceLighter::light(), NL3D::CInstanceLighter::lightIgSimple(), NL3D::CPSUtil::print(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), scale(), NL3D::CWaterModel::setupSimpleRender(), NL3D::ITransformable::updateMatrix(), and NL3D::CPSMesh::updatePos().
| void NLMISC::CMatrix::serial | ( | IStream & | f | ) |
Definition at line 1499 of file matrix.cpp.
References a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44, hasProj(), hasRot(), hasScaleUniform(), hasTrans(), identity(), NLMISC::IStream::isReading(), Scale33, NLMISC::IStream::serial(), NLMISC::IStream::serialVersion(), StateBit, and void().
| void NLMISC::CMatrix::set | ( | const float | m44[16] | ) |
Explicit setup the 4*4 matrix.
Avoid it. It implies low compute since no check is done on rotation matrix to see what type of matrix it is (identity, rotation, scale, uniform scale). BUT check are made to see if it has translation or projection components.
| m44 | the 4*4 column matrix (4x4 matrix stored in column-major order as 16 consecutive values) |
Definition at line 318 of file matrix.cpp.
References a14, a24, a34, a41, a42, a43, a44, M, MAT_IDENTITY, MAT_PROJ, MAT_ROT, MAT_SCALEANY, MAT_TRANS, MAT_VALIDPROJ, Scale33, and StateBit.
Referenced by NL3D::computeBoneMatrixes3x4(), NL3D::CDriverGL::getFrustumMatrix(), NL3D::CDriverD3D::getFrustumMatrix(), NL3D::CDriverGL::refreshProjMatrixFromGL(), and NL3D::CWaterModel::setupSimpleRender().
| void NLMISC::CMatrix::setArbitraryRotI | ( | const CVector & | idir | ) |
Choose an arbitrary rotation matrix for the given direction.
The matrix will have I==idir
| idir,: | vector direction. MUST be normalized. |
Definition at line 1538 of file matrix.cpp.
References NLMISC::CVector::I, NLMISC::CVector::J, NLMISC::CVector::K, normalize(), setRot(), XZY, and NLMISC::CVector::z.
| void NLMISC::CMatrix::setArbitraryRotJ | ( | const CVector & | jdir | ) |
Choose an arbitrary rotation matrix for the given direction.
The matrix will have J==jdir
| jdir,: | vector direction. MUST be normalized. |
Definition at line 1548 of file matrix.cpp.
References NLMISC::CVector::I, NLMISC::CVector::J, NLMISC::CVector::K, normalize(), setRot(), YZX, and NLMISC::CVector::z.
Referenced by NL3D::CShadowMap::buildCasterCameraMatrix().
| void NLMISC::CMatrix::setArbitraryRotK | ( | const CVector & | kdir | ) |
Choose an arbitrary rotation matrix for the given direction.
The matrix will have K==kdir
| kdir,: | vector direction. MUST be normalized. |
Definition at line 1558 of file matrix.cpp.
References NLMISC::CVector::I, NLMISC::CVector::J, NLMISC::CVector::K, normalize(), setRot(), NLMISC::CVector::y, and ZYX.
Referenced by NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CSkeletonModel::fastIntersect(), and NL3D::CRayMesh::fastIntersect().
Matrix multiplication.
Because of copy avoidance, this is the fastest method Equivalent to *this= m1 * m2
Definition at line 741 of file matrix.cpp.
References a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44, hasProj(), hasRot(), hasTrans(), identity(), MAT_PROJ, MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, MAT_TRANS, MAT_VALIDALL, MAT_VALIDPROJ, MAT_VALIDROT, nlassert, Scale33, StateBit, testExpandProj(), and testExpandRot().
Referenced by NL3D::CShadowMapProjector::applyToMaterial(), operator*(), and operator*=().
Matrix multiplication assuming no projection at all in m1/m2 and Hence this.
Even Faster than setMulMatrix() Equivalent to *this= m1 * m2 NB: Also always suppose m1 has a translation, for optimization consideration
Definition at line 699 of file matrix.cpp.
References a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, hasScaleUniform(), MAT_PROJ, MAT_VALIDPROJ, MAT_VALIDROT, Scale33, StateBit, and testExpandRot().
Referenced by NL3D::CBone::compute(), and NL3D::computeBoneMatrixes3x4PreMul().
| void NLMISC::CMatrix::setPos | ( | const CVector & | v | ) |
Explicit setup the Translation component.
v==Null is tested to see if the matrix now have a translation component.
| v | the translation vector. |
Definition at line 265 of file matrix.cpp.
References a14, a24, a34, MAT_TRANS, StateBit, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Referenced by NLLIGO::CZoneTemplate::build(), NL3D::CCameraCol::build(), NLMISC::CPolygon::buildBasis(), NL3D::CPSZonePlane::buildBasis(), NLLIGO::CZoneEdge::buildMatrix(), NL3D::CPSConstraintMesh::CGlobalTexAnim::buildMatrix(), NL3D::CShadowMap::buildProjectionInfos(), NL3D::CCloud::calcBill(), NL3D::CLandscapeModel::clipAndRenderLandscape(), NL3D::CBone::compute(), NL3D::CShadowPolyReceiver::computeClippedTrisWithPolyClip(), NL3D::ComputeRibbonSliceFollowPath(), NL3D::ComputeRibbonSliceFollowPathXY(), NL3D::CMaterial::decompUserTexMat(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CWaterEnvMapRenderFromUScene::doRender(), NL3D::CLodCharacterManager::endRender(), NL3D::CSkeletonSpawnScript::evaluate(), NL3D::CSkeletonModel::fastIntersect(), NL3D::CRayMesh::fastIntersect(), NL3D::CCloud::genBill(), NL3D::CSkeletonModel::generateShadowMap(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CPatch::generateTileVegetable(), NL3D::CPSZoneRectangle::getMatrix(), NL3D::CPSZoneCylinder::getMatrix(), NL3D::CPSCylindricVortex::getMatrix(), NL3D::CPSEmitterRectangle::getMatrix(), NL3D::CWaterModel::getNumWantedVertices(), NL3D::CViewport::getRayWithPoint(), NL3D::CEvent3dMouseListener::getViewMatrix(), InitZBuffer(), NL3D::CBone::interpolateBoneSkinMatrix(), NL3D::CInstanceLighter::light(), NL3D::CInstanceLighter::lightIgSimple(), NL3D::CZoneLighter::lightWater(), NL3D::ITransformable::lookAt(), NL3D::CEvent3dMouseListener::operator()(), NL3D::CPSUtil::print(), NL3D::CVisualCollisionMesh::receiveShadowMap(), NL3D::CVegetableManager::render(), NL3D::CSegRemanence::render(), NL3D::CCloudScape::render(), NL3D::CComputedString::render2D(), NL3D::CSkeletonModel::renderIntoSkeletonShadowMap(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), NL3D::CShadowMapManager::renderProject(), NL3D::CShadowPolyReceiver::renderSelection(), NL3D::CDriverGL::setupModelMatrix(), NL3D::CLodCharacterManager::setupNormalCorrectionMatrix(), NL3D::CFlareModel::setupOcclusionMeshMatrix(), NL3D::CWaterModel::setupSimpleRender(), NL3D::CDriverGL::setupViewMatrix(), NL3D::CDriverD3D::setupViewMatrix(), NL3D::CDriverGL::setupViewMatrixEx(), NL3D::CVegetableBlendLayerModel::setWorldPos(), NL3D::CPSZoneRectangle::show(), NL3D::CPSZoneCylinder::show(), NL3D::CPSZoneDisc::show(), NL3D::CPSEmitterRectangle::showTool(), NL3D::CWaterModel::traverseRender(), NL3D::CAnimatedMaterial::update(), NLSOUND::CListenerFMod::updateFModPos(), and NL3D::CTransform::updateWorldMatrixFromFather().
| void NLMISC::CMatrix::setProj | ( | const float | proj[4] | ) |
Explicit setup the Projection component.
Proj is tested to see if the matrix now have a projection component.
| proj | the 4th line of the matrix. Set it to 0 0 0 1 to reset it to default. |
Definition at line 289 of file matrix.cpp.
References a41, a42, a43, a44, MAT_PROJ, MAT_VALIDPROJ, and StateBit.
| void NLMISC::CMatrix::setRot | ( | const CMatrix & | matrix | ) |
Explicit setup the Rotation/Scale matrix (base) with the rotation part of an other matrix.
| matrix | the matrix to copy rot part. |
Definition at line 241 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, hasRot(), hasScaleUniform(), MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, MAT_VALIDROT, Scale33, and StateBit.
| void NLMISC::CMatrix::setRot | ( | const CQuat & | quat | ) |
Explicit setup the Rotation matrix (base) as a Quaternion rotation matrix.
| quat | a UNIT quaternion |
Definition at line 1346 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, NLMISC::CQuatT< T >::isIdentity(), MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, Scale33, StateBit, NLMISC::CQuatT< T >::w, NLMISC::CQuatT< T >::x, NLMISC::CQuatT< T >::y, and NLMISC::CQuatT< T >::z.
Explicit setup the Rotation matrix (base) as a Euler rotation matrix.
| v | a vector of 3 angle (in radian), giving rotation around each axis (x,y,z) | |
| ro | the order of transformation applied. if ro==XYZ, then the transform is M=M*Rx*Ry*Rz |
Definition at line 229 of file matrix.cpp.
References getRot(), identity(), rotate(), and setRot().
Explicit setup the Rotation/Scale matrix (base).
Avoid it. It implies low compute since no check is done on m33 to see what type of matrix it is (identity, rotation, scale, uniform scale)
| m33 | the 3*3 column rotation matrix. (3x3 matrix stored in column-major order as 9 consecutive values) | |
| hintNoScale | set it to true if you are sure that your rot matrix is a pure rot matrix with no scale. If set to true and your rotation is not an orthonormal basis, unpredictable result are excepted. |
Definition at line 218 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, Scale33, and StateBit.
| void NLMISC::CMatrix::setRot | ( | const CVector & | i, | |
| const CVector & | j, | |||
| const CVector & | k, | |||
| bool | hintNoScale = false | |||
| ) |
Explicit setup the Rotation/Scale matrix (base).
Avoid it. It implies low compute since no check is done on base to see what type of matrix it is (identity, rotation, scale, uniform scale...)
| i | The I vector of the Cartesian base. | |
| j | The J vector of the Cartesian base. | |
| k | The K vector of the Cartesian base. | |
| hintNoScale | set it to true if you are sure that your rot matrix is a pure rot matrix with no scale. If set to true and your rotation is not an orthonormal basis, unpredictable result are excepted. |
Definition at line 207 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, Scale33, StateBit, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Referenced by NL3D::CVegetableManager::addInstance(), NL3D::CCameraCol::build(), NLMISC::CPolygon::buildBasis(), NL3D::CShadowMap::buildCasterCameraMatrix(), NL3D::CPSConstraintMesh::CGlobalTexAnim::buildMatrix(), NL3D::CShadowMap::buildProjectionInfos(), NL3D::CPSUtil::buildSchmidtBasis(), NL3D::CCloud::calcBill(), NL3D::CCubeGrid< TCell >::CCubeGrid(), CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::compile(), NL3D::ComputeRibbonSliceFollowPathXY(), NL3D::CShadowMapProjector::CShadowMapProjector(), NL3D::CMaterial::decompUserTexMat(), NL3D::CCloud::disp(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CSkeletonSpawnScript::evaluate(), NL3D::CTargetAnimCtrl::execute(), NL3D::CCloud::genBill(), NL3D::CVegetable::generateInstance(), NL3D::CPatch::generateTileVegetable(), NL3D::CPSZoneRectangle::getMatrix(), NL3D::CPSZoneCylinder::getMatrix(), NL3D::CPSEmitterRectangle::getMatrix(), NL3D::CBone::interpolateBoneSkinMatrix(), NL3D::CInstanceLighter::light(), NL3D::CInstanceLighter::lightIgSimple(), NL3D::CZoneLighter::lightWater(), NL3D::ITransformable::lookAt(), NL3D::CPSConstraintMesh::makePrerotatedVb(), NEL3DCalcBase(), NL3D::NEL3DCalcBase(), NL3D::CWaterEnvMapRenderHelper::render(), NL3D::CSkeletonModel::renderIntoSkeletonShadowMap(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), rotate(), NL3D::CQuadTree< T >::selectRay(), NL3D::CQuadTree< T >::selectSegment(), setArbitraryRotI(), setArbitraryRotJ(), setArbitraryRotK(), NL3D::CDriverUser::setMatrixMode2D(), NL3D::CCloud::setMode2D(), setRot(), NL3D::UTransformable::setRotQuat(), NL3D::CMeshVPWindTree::setupPerInstanceConstants(), NL3D::CPSRibbon::setupTextureMatrix(), NL3D::CPSShockWave::setupUFactor(), NL3D::CDriverGL::setupViewMatrix(), NL3D::CDriverGL::setupViewMatrixEx(), NL3D::CPSZoneRectangle::show(), NL3D::CPSZoneCylinder::show(), NL3D::CPSLight::show(), NL3D::CPSEmitterRectangle::showTool(), NL3D::CAnimatedMaterial::update(), NL3D::CWaterModel::updateDiffuseMapMatrix(), NLSOUND::CListenerFMod::updateFModPos(), NL3D::CPSMesh::updatePos(), and NL3D::CTransform::updateWorldMatrixFromFather().
| void NLMISC::CMatrix::setScale | ( | const CVector & | v | ) |
Explicit setup the Rotation/Scale matrix (base) with a scale (=> matrix has no Rotation).
case where v.x==v.y==v.z is tested to set a uniform scale
| scale | the scale to set |
Definition at line 1477 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, MAT_VALIDROT, setScaleUni(), StateBit, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
| void NLMISC::CMatrix::setScale | ( | float | scale | ) |
Explicit setup the Rotation/Scale matrix (base) with a scale (=> matrix has no Rotation).
1 is tested to update bits accordingly
| scale | the scale to set |
Definition at line 1470 of file matrix.cpp.
References setScaleUni().
Referenced by NL3D::CBone::compute().
| void NLMISC::CMatrix::setScaleUni | ( | float | scale | ) | [inline, private] |
Definition at line 1458 of file matrix.cpp.
References a11, a12, a13, a21, a22, a23, a31, a32, a33, MAT_ROT, MAT_SCALEANY, MAT_SCALEUNI, MAT_VALIDROT, Scale33, and StateBit.
Referenced by setScale().
Definition at line 997 of file matrix.cpp.
References getI(), getJ(), getK(), NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Referenced by inverted().
Definition at line 1030 of file matrix.cpp.
References getCofactIndex(), and mat().
Referenced by inverted().
| void NLMISC::CMatrix::testExpandProj | ( | ) | const [inline, private] |
Definition at line 147 of file matrix.cpp.
References hasProj(), MAT_VALIDPROJ, and StateBit.
Referenced by get(), inverted(), NLMISC::operator*(), operator*(), setMulMatrix(), and transpose().
| void NLMISC::CMatrix::testExpandRot | ( | ) | const [inline, private] |
Definition at line 133 of file matrix.cpp.
References hasRot(), MAT_VALIDROT, and StateBit.
Referenced by get(), inverted(), normalize(), NLMISC::operator*(), operator*(), rotateX(), rotateY(), rotateZ(), scale(), setMulMatrix(), and setMulMatrixNoProj().
| void NLMISC::CMatrix::translate | ( | const CVector & | v | ) |
Apply a translation to the matrix. same as M=M*T.
Definition at line 467 of file matrix.cpp.
References a11, a12, a13, a14, a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43, a44, hasProj(), hasRot(), MAT_TRANS, StateBit, NLMISC::CVector::x, NLMISC::CVector::y, and NLMISC::CVector::z.
Referenced by NL3D::CShadowMap::buildCasterCameraMatrix(), NL3D::CInstanceGroup::getInstanceMatrix(), NL3D::CPSZoneDisc::getMatrix(), NL3D::CWaterShape::getShapeInWorldSpace(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), NL3D::CPSGravity::show(), NL3D::ITransformable::updateMatrix(), and NL3D::CPSMesh::updatePos().
| void NLMISC::CMatrix::transpose | ( | ) |
transpose the matrix (swap columns/lines).
NB: this transpose the 4*4 matrix entirely (even proj/translate part).
Definition at line 932 of file matrix.cpp.
References a14, a24, a34, a41, a42, a43, hasProj(), hasTrans(), MAT_PROJ, MAT_TRANS, MAT_VALIDPROJ, StateBit, testExpandProj(), and transpose3x3().
Referenced by NL3D::CVegetableManager::addInstance(), NL3D::CDriverD3D::getFrustumMatrix(), NL3D::CPSUtil::print(), NL3D::CDriverGL::setConstantMatrix(), and NL3D::CDriverD3D::setFrustumMatrix().
| void NLMISC::CMatrix::transpose3x3 | ( | ) |
transpose the rotation part only of the matrix (swap columns/lines).
Definition at line 919 of file matrix.cpp.
References a12, a13, a21, a23, a31, a32, and hasRot().
Referenced by transpose().
Plane (line vector) multiplication.
const CMatrix NLMISC::CMatrix::Identity [static] |
The identity matrix. Same as CMatrix().
Definition at line 78 of file matrix.h.
Referenced by NL3D::CLodCharacterBuilder::addAnim(), NL3D::CSkeletonModel::computeCurrentBBox(), NL3D::CCloud::disp(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CDeform2d::doDeform(), NL3D::CRenderStringBuffer::flush(), NL3D::CCoarseMeshManager::flushRender(), NL3D::CSkeletonModel::forceComputeBone(), NL3D::CCloud::genBill(), NL3D::CPSLocated::getConversionMatrix(), NL3D::CParticleSystem::getFXToUserMatrix(), NL3D::CPSLocated::getLocalToWorldMatrix(), NL3D::CParticleSystem::getSysMat(), NL3D::UInstanceMaterial::getUserTexMat(), NL3D::CParticleSystem::getUserToFXMatrix(), NL3D::CPSLocated::getWorldToLocalMatrix(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CSegRemanence::render(), NL3D::CCloudScape::render(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CDriverUser::setMatrixMode3D(), NL3D::CCloud::setMode2D(), NL3D::CPSLight::show(), NL3D::CFlareModel::traverseRender(), NL3D::CWaterEnvMap::update(), NL3D::CFlareModel::updateOcclusionQueryBegin(), and NL3D::CTransform::updateWorld().
float NLMISC::CMatrix::M[16] [private] |
Definition at line 369 of file matrix.h.
Referenced by CMatrix(), get(), getPos(), mat(), operator=(), set(), and setCoefficient().
float NLMISC::CMatrix::Scale33 [private] |
Definition at line 370 of file matrix.h.
Referenced by fastInvert33(), getScaleUniform(), normalize(), operator=(), scale(), serial(), set(), setMulMatrix(), setMulMatrixNoProj(), setRot(), and setScaleUni().
uint32 NLMISC::CMatrix::StateBit [private] |
Definition at line 371 of file matrix.h.
Referenced by CMatrix(), fastInvert33(), getRot(), hasProj(), hasProjectionPart(), hasRot(), hasScalePart(), hasScaleUniform(), hasTrans(), identity(), inverted(), movePos(), normalize(), NLMISC::operator*(), operator=(), resetProj(), rotateX(), rotateY(), rotateZ(), scale(), serial(), set(), setMulMatrix(), setMulMatrixNoProj(), setPos(), setProj(), setRot(), setScale(), setScaleUni(), testExpandProj(), testExpandRot(), translate(), and transpose().
1.6.1