User Tools

Site Tools


prpl:ishull

<- PRPL reference <- Particles

IsHull

ArgumentsResultNotation
pid bool [ int - bool ]

Description

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

One way to get the virtual hull 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 hull particle.

Emergent is also implemented as a virtual particle (see IsEmergent).

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 hull particles created this frame:" <-hullParticles Trace2
endif
prpl/ishull.txt · Last modified: 2018/06/17 14:25 by kajacx