CUGL 3.0
Cornell University Game Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cugl::graphics::ParticleInstance Class Reference

#include <CUParticleSystem.h>

Public Member Functions

 ParticleInstance ()
 

Public Attributes

Vec4 position
 
Color4 color
 
Vec2 texOffset
 
float distance
 

Detailed Description

This class is a struct representing the data for a particle instance

A particle system takes the template and multiplies using instancing. This struct represents the data unique to each instance.

Sprite animation is handled via the attribute texOffset. This value is added to the texture coordinates of the template to produce the new texture coordinates. This requires each texture component to have the same size. Set this value to (0,0) to disable animation.

Particle Instances are used by InstanceBuffer to render the particle instances. So we do not refer to them with shared pointers, or have fancy constructor for them.

Constructor & Destructor Documentation

◆ ParticleInstance()

cugl::graphics::ParticleInstance::ParticleInstance ( )
inline

Creates an empty particle instance

Member Data Documentation

◆ color

Color4 cugl::graphics::ParticleInstance::color

The color of the particle

◆ distance

float cugl::graphics::ParticleInstance::distance

The squared distance to the camera. If dead, this value is -1.0f

◆ position

Vec4 cugl::graphics::ParticleInstance::position

The position of the particle in 3d space; w is the radius

◆ texOffset

Vec2 cugl::graphics::ParticleInstance::texOffset

The texture offset of this particle (for animation)


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