X and Y coordinates, particle count.

  • dnerd
    21st Mar 2011 Member 0 Permalink
    Is there a way to find the X and Y coordinates of a particle? Like a command or line while coding?

    Also, is there a way to find the particle count of a certain particle? again a command or line while coding.
  • Pilihp64
    21st Mar 2011 Developer 0 Permalink
    parts[i].x
    parts[i].y
    these are floats

    the number i itself is the particle number
  • dnerd
    21st Mar 2011 Member 0 Permalink
    what do you mean by "floats"? sorry im a bit new to this.
  • Cr15py
    21st Mar 2011 Member 0 Permalink
    dnerd
    Floats, or floating points are numerical values capable of holding non-integral real number. In non-mathematical/programming terms, it can hold numbers which aren't whole(an int can't hold 2.1, but a float can).
  • dnerd
    21st Mar 2011 Member 0 Permalink
    @cracker64
    @Cr15py
    ok i see, thanks!
  • devast8a
    21st Mar 2011 Former Staff 0 Permalink
    Why is position a float?
  • dnerd
    21st Mar 2011 Member 0 Permalink
    @devast8a
    wait, yeah good question.. arent positions in integers?

    @cracker64
    if i were to type

    parts[1].y

    would that like store the y coordinates of all particles of dust in RAM or something?
  • HeyJD
    21st Mar 2011 Member 0 Permalink
    @dnerd
    No, parts is an array.
    An array is like a variable holding many variables.
    So parts[i] means all the variables in the array(index of i).
    So parts[1] would mean the first variable in the array(index of 1).
  • dnerd
    21st Mar 2011 Member 0 Permalink
    @HeyJD
    so i take it there is no way of finding out the X,Y coordinates of a specific type of particle using the parts[i]?
  • boxmein
    21st Mar 2011 Former Staff 0 Permalink
    @HeyJD parts[0] is the first element in an array -.-