I have plane with dualside material. I use this function for raycasting:
bool CanvasLogic::RaycastToCanvas(Vector3& hitPos)
{
auto mousePos = INPUT->GetMousePosition();
auto camera = GetScene()->GetChild("Camera")->GetComponent<Camera>();
float x = (float)mousePos.x_ / GRAPHICS->GetWidth();
float y = (float)mousePos.y_ / GRAPHICS->GetHeight();
auto cameraRay = camera->GetScreenRay(x, y);
PODVector<RayQueryResult> results;
RayOctreeQuery query(results, cameraRay, RAY_TRIANGLE, 1000.0f, DRAWABLE_GEOMETRY);
GetScene()->GetComponent<Octree>()->Raycast(query);
foreach(auto result, results)
{
if (result.node_ == node_)
{
hitPos = result.position_;
return true;
}
}
return false;
}
But it works only for forward side. How to fix it?