Ogre Version: :1.11.1:
Operating System: :Windows 10:
Render System: :DirectX:
Hi,
I want to use the particle system plugin of ogre. With predefined cameras all works fine. But when I set a custom matrix for the camera then my parictles are vanished. So I want to ask if anyone knows how to fix this.
Best regards
Pellaeon
Particle System with custom view matrix
-
- Goblin
- Posts: 230
- Joined: Thu Apr 28, 2011 12:23 pm
- x 28
Particle System with custom view matrix
Last edited by Pellaeon on Wed Aug 22, 2018 2:56 pm, edited 1 time in total.
-
- Goblin
- Posts: 230
- Joined: Thu Apr 28, 2011 12:23 pm
- x 28
-
- OGRE Team Member
- Posts: 1994
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1074
- Contact:
Re: Particle System with custom view matrix
probably some transform does not get updated correctly. Check the transforms generated in BillboardParticleRenderer::_updateRenderQueue
-
- Goblin
- Posts: 230
- Joined: Thu Apr 28, 2011 12:23 pm
- x 28
Re: Particle System with custom view matrix
I looked into the method but I don't know which code in special could cause the problem.
This is how I create the camera:
In my render loop I do the following:
I get the custom view matrix, set it to the camera. Then I decompose the matrix to get position and orientation and then I set these values to the parent scene node of the camera and this information is used in "BillboardSet::_notifyCurrentCamera".
But I still see no billboards when using the camera with custom matrix.
Regards
Pellaeon
This is how I create the camera:
Code: Select all
auto pCamera = pSceneManager->createCamera(cameraName);
auto pCamNode = pSceneManager->createSceneNode();
pCamNode->attachObject(pCamera);
pSceneManager->getRootSceneNode()->addChild(pCamNode);
Code: Select all
m_ogreManager.getDefaultCamera()->setCustomViewMatrix(true, ogreMatrix);
Ogre::Quaternion quat;
Ogre::Vector3 pos, scale;
ogreMatrix.decomposition(pos, scale, quat);
m_ogreManager.getDefaultCamera()->getParentNode()->setPosition(pos);
m_ogreManager.getDefaultCamera()->getParentNode()->setOrientation(quat);
But I still see no billboards when using the camera with custom matrix.
Regards
Pellaeon