Jump to content
j00ey

Inline Code - Implicit cast from float to int

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;
 

 

Share this post


Link to post
Share on other sites

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 by mrWolf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×