- function TKugel.IsIn(Ray: TRay):TRGBA;
- var
- Dist:TVector;
- B:Single;
- begin
- Result.r:=Color.r;
- Result.g:=Color.g;
- Result.b:=Color.b;
- Result.a:=1;
- dist.x:= Position.x - ray.Position.x*ray.Richtung.x;
- dist.y:= Position.y - ray.Position.y*ray.Richtung.y;
- dist.z:= Position.z - ray.Position.z*ray.Richtung.z;
- B:=dist.x*dist.x+dist.y*dist.y+dist.z*dist.z;
- If B<0 then B:=-B;
- B:=Sqrt(B);
- if (B < radius) then
- begin
- Result.a:=Color.a+B/radius;
- end;
- end;