Some others questions

alphamax

24-12-2006 16:55:18

Halp me >< I am a kind of noob in NewtOgre ...

I have two problems, first, on the delete, i have an exceptions raised on

void Debugger::deInit()
{
if (m_debugnode)
{
m_debugnode->detachAllObjects();<----- HERE
if (m_debuglines) { delete m_debuglines; m_debuglines = NULL; }
m_debugnode->getParentSceneNode()->removeAndDestroyChild( m_debugnode->getName() );
m_debugnode = NULL;
}
}


And my second question, here is my intersection code :

//Ray from the mouse
CEGUI::Point tMousePos = CEGUI::MouseCursor::getSingleton().getPosition();
tMousePos.d_x /= data->mWindow->getWidth();
tMousePos.d_y /= data->mWindow->getHeight();
Ray cameraRay = data->mCamera->getCameraToViewportRay(tMousePos.d_x, tMousePos.d_y );
Vector3 origine = cameraRay.getOrigin();
Vector3 fin = cameraRay.getPoint(200);
//End Ray of the mouse
data->Newt_Ray = new OgreNewt::BasicRaycast(data->Newt_World, origine,fin);
BasicRaycast::BasicRaycastInfo info = data->Newt_Ray->getFirstHit();
if(data->Newt_Ray->getHitCount()>0)
{
Logs::AddLog(3,"Collisions, valeur du point de départ ",
origine.x,origine.y,origine.z,
fin.x,fin.y,fin.z);
}
delete data->Newt_Ray;


But data->Newt_Ray->getHitCount() already equals to zero. do you have an idea ? Should i use something else than "BasicRaycast" ?
(PS : data->Newt_World has been initialised with a node).

Thanks !