Particle Playground - Script Reference  3.0.1
Framework for controlling particles in the Unity Engine.
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
ParticlePlayground.CollisionCache Class Reference

The collision cache contains information of all particle collisions. More...

Public Member Functions

 CollisionCache (int amount)
 
void Set (int index, Vector3 position, Vector3 normal, Transform transform)
 Sets the specified collision position, normal and transform at index. More...
 
void SetSticky (int index, Vector3 position, Vector3 normal, float offset, Transform transform)
 
void UpdateStickyPosition (int index)
 UpdateStickyPosition sets the sticky position based on the collision transform for a particle. The sticky position will update automatically when using "sticky" particles. More...
 
void Reset (int index)
 Resets the specified index. More...
 
void ClearCollisions ()
 Clears out all the collisions. Use this if you want to toggle between having sticky and non-sticky behaviors. More...
 
CollisionCache Clone ()
 Copies this CollisionCache. More...
 

Public Attributes

bool[] hasCollided
 Determines if a particle has collided with any colliders during its lifetime. More...
 
Vector3[] collisionPosition
 The position in world space a particle collided last. This will not update further during a particle's lifetime if using "sticky" particles. More...
 
Vector3[] collisionNormal
 The collision normal of the surface the particle collided last. This will not update further during a particle's lifetime if using "sticky" particles. More...
 
Transform[] collisionTransform
 The transform of the object a particle collided with last. This will not update further during a particle's lifetime if using "sticky" particles. More...
 
GameObject[] collisionGameObject
 
Vector3[] collisionTransformPosition
 The position seen by the collision object's transform based on InverseTransformPoint. More...
 
Vector3[] stickyPosition
 The sticky position of a particle. This contains the position for particles that stick to their collided surface. More...
 

Detailed Description

The collision cache contains information of all particle collisions.

Member Function Documentation

void ParticlePlayground.CollisionCache.ClearCollisions ( )

Clears out all the collisions. Use this if you want to toggle between having sticky and non-sticky behaviors.

CollisionCache ParticlePlayground.CollisionCache.Clone ( )

Copies this CollisionCache.

void ParticlePlayground.CollisionCache.Reset ( int  index)

Resets the specified index.

Parameters
indexIndex.
void ParticlePlayground.CollisionCache.Set ( int  index,
Vector3  position,
Vector3  normal,
Transform  transform 
)

Sets the specified collision position, normal and transform at index.

Parameters
indexIndex.
positionPosition.
normalNormal.
transformTransform.
void ParticlePlayground.CollisionCache.UpdateStickyPosition ( int  index)

UpdateStickyPosition sets the sticky position based on the collision transform for a particle. The sticky position will update automatically when using "sticky" particles.

Parameters
indexIndex to update.

Member Data Documentation

Vector3 [] ParticlePlayground.CollisionCache.collisionNormal

The collision normal of the surface the particle collided last. This will not update further during a particle's lifetime if using "sticky" particles.

Vector3 [] ParticlePlayground.CollisionCache.collisionPosition

The position in world space a particle collided last. This will not update further during a particle's lifetime if using "sticky" particles.

Transform [] ParticlePlayground.CollisionCache.collisionTransform

The transform of the object a particle collided with last. This will not update further during a particle's lifetime if using "sticky" particles.

Vector3 [] ParticlePlayground.CollisionCache.collisionTransformPosition

The position seen by the collision object's transform based on InverseTransformPoint.

bool [] ParticlePlayground.CollisionCache.hasCollided

Determines if a particle has collided with any colliders during its lifetime.

Vector3 [] ParticlePlayground.CollisionCache.stickyPosition

The sticky position of a particle. This contains the position for particles that stick to their collided surface.


The documentation for this class was generated from the following file: