User Tools

Site Tools


prpl:ishull

This is an old revision of the document!


<- PRPL reference <- Particles

IsHull

ArgumentsResultNotation
pid bool [ int - bool ]

Description

Checks if the given particle is a virtual (hull) particle. Virtual particles are under each hull piece and are used for hit detection, however they are not dicoverable by functions like GetParticlesInRange.

The only way to get a virtual particle ID is to watch the current PID counter (by creating a particle on each frame) and calling this function (IsHull) to check if that particle is a virtual particle.

Examples

#init
once
    0 ->lastPID
endonce
 
#get the current pid
0 0 0 0 0 0 CreateParticle ->pid
<-pid 1 DestroyParticle
 
 
#count hull particles
CreateList ->hullParticles
<-pid <-lastPid do
    I IsHull if
        <-hullParticles I AppendToList
    endif
loop
 
#update last Pid for the next frame
<-pid ->lastPid
 
#print the list of not empty
<-hullParticles GetListCount neq0 if
    "Virtual particles created this frame:" <-hullParticles Trace2
endif
prpl/ishull.1529257890.txt.gz · Last modified: 2018/06/17 13:51 by kajacx