Jump to content

Inline Code - Implicit cast from float to int


j00ey

Recommended Posts

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;
 

 

Link to comment
Share on other sites

  • 1 year later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...