c++ - Assertion failed: !XMVector3Equal(UpDirection, XMVectorZero()) -


so m basicly writting camera class linked 3d object (that have loaded programm .obj file).

the camera acts third person.

i error when write :

    world *= xmmatrixtranslation(xmvectorgetx(position), m_y, xmvectorgetz(position)); //last modification before break 

the original code :

    world = xmmatrixscaling(m_xscale, m_yscale, m_zscale);     world *= xmmatrixrotationx(xmconverttoradians(m_xangle));     world *= xmmatrixrotationy(xmconverttoradians(m_yangle));     world *= xmmatrixrotationz(xmconverttoradians(m_zangle));     world *= xmmatrixtranslation(m_x, m_y, m_z); //line gets modified 

also :

xmvector position = xmvector3transformcoord(cam->getcharpos(), world); 

where cam->getcharpos() xmvector(0.0f, 0.0f, 0.0f, 0.0f) , world xmmatrix has positon (that changes each time move) of, let's say, (1.0f, 0.0f, 0.0f) // x, y , z position

so in theory, position vector gets xm vector of (1.0f, 0.0f, 0.0f, 0.0f)//and debugged it.

also wondering causes type of error in general? apart cause break code here.because know @ least 4 version of error :

assert(!xmvector3equal(eyedirection, xmvectorzero())); assert(!xmvector3isinfinite(eyedirection)); assert(!xmvector3equal(updirection, xmvectorzero())); assert(!xmvector3isinfinite(updirection)); 

the problem lies in line of code :

xmvector position = xmvector3transformcoord(cam->getcharpos(), world); 

with way xmvector , xmmatrix work, won't let store value of xmvector3transformcoord(cam->getcharpos(), world) directly xmvector position.

to fix wrote:

cam->getcharpos() = xmvector3transformcoord(cam->getcharpos(), world); 

since m updating default xmvector ( remember, cam->getcharpos() set (0.0f, 0.0f, 0.0f, 0.0f) ) xmmatrix, copied it's content position xmvector. enables me manipulate without breaking xnalibrary


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -