RayCastIntersect doesn't work on objects inside a DummyCube CamInvarianceMode <> cimNone
Original Reporter info from Mantis: Kjow
-
Reporter name:
Original Reporter info from Mantis: Kjow
- Reporter name:
Description:
If I have an object (GLCube or FreeForm for sure, but I think all other objects) I can't use RayCastIntersect if the object is inside a GLDummyCube with CamInvarianceMode <> cimNone.
Additional information:
I tried with a GLFreeForm and with a GLCube both inside different GLDummyCube, both with CamInvarianceMode:=cimOrientation
e.g.
GLCube1 as child of GLDummyCube with CamInvarianceMode:=cimOrientation
procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var
rayStart, rayVector, iPoint, iNormal : TVector;
begin
SetVector(rayStart, GLCamera1.AbsolutePosition);
SetVector(rayVector, GLSceneViewer1.Buffer.ScreenToVector(AffineVectorMake(x, GLSceneViewer1.Height-y, 0)));
NormalizeVector(rayVector);
if GLCube1.RayCastIntersect(rayStart, rayVector, @iPoint, @iNormal) then
begin
GLCube1.Material.FrontProperties.Emission.Color:=clrRed;
end
else
begin
GLCube1.Material.FrontProperties.Emission.Color:=clrBlack;
end;
end;
Same code, but with GLCube1 as child of GLDummyCube with CamInvarianceMode:=cimNone works very well.
Mantis conversion info:
- Mantis ID: 16053
- Monitored by: » Kjow (Kjow), » crossbuilder (Burkhard Carstens)