j00ey Posted January 22, 2015 Share Posted January 22, 2015 Can someone tell me what I'm doing wrong here? I'm opening a point cloud in my shader, and I'm pretty sure it usually works like this [and in fact I'm getting the right result] but I'm getting an error saying implicit cast from float to int, even though I am casting $hnd as an int... This is my code : -------------- float $scalevalue; float $getconvex; $convex=0; float $pdist; int $hnd = pcopen($pc,"P",$worldpos,$r,$mp); <<--- Error is referring to this line int $numfound=pcnumfound($hnd); while(pciterate($hnd)){ pcimport($hnd,"point.distance",$pdist); $scalevalue = (1-($pdist/$r)); pcimport($hnd,"convex",$getconvex); $convex+=($getconvex*$scalevalue); } $convex/=$numfound; Quote Link to comment Share on other sites More sharing options...
mrWolf Posted November 28, 2016 Share Posted November 28, 2016 (edited) hey j00ey, is it possible that you defined $mp as a float ? If so, that might be the issue. Try to define $mp as an int. p.s. did I just reply a 2 yo post ? lol Edited November 28, 2016 by mrWolf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.