2018-04-22 15:55:55 +00:00
|
|
|
// papi.h
|
|
|
|
//
|
|
|
|
// Copyright 1997-1998 by David K. McAllister
|
|
|
|
// http://www.cs.unc.edu/~davemc/Particle
|
|
|
|
//
|
|
|
|
// Include this file in all applications that use the Particle System API.
|
|
|
|
|
|
|
|
#ifndef _particle_api_h
|
|
|
|
#define _particle_api_h
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
// This is the major and minor version number of this release of the API.
|
|
|
|
#define P_VERSION 120
|
|
|
|
|
|
|
|
// added <<< cgc >>>
|
2020-07-05 16:11:06 +00:00
|
|
|
#include "p_vector.h"
|
|
|
|
#include "general.h"
|
|
|
|
#include "particledefs.h"
|
2018-04-22 15:55:55 +00:00
|
|
|
|
|
|
|
// State setting calls
|
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
extern "C" {
|
|
|
|
void pColor(float red, float green, float blue, float alpha = 1.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pColorD(float alpha, PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pSize(float size_x, float size_y = 1.0f, float size_z = 1.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pSizeD(PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pStartingAge(float age, float sigma = 1.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pTimeStep(float new_dt);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pVelocity(float x, float y, float z);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pVelocityD(PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pVertexB(float x, float y, float z);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pVertexBD(PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pVertexBTracks(bool track_vertex = true);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
// Action List Calls
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pCallActionList(int action_list_num);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pDeleteActionLists(int action_list_num, int action_list_count = 1);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pEndActionList();
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
int pGenActionLists(int action_list_count = 1);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pNewActionList(int action_list_num);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
// Particle Group Calls
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
ParticleGroup* pGetParticleGroupRef(int p_group_num);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pCopyGroup(int p_src_group_num, int index = 0, int copy_count = P_MAXINT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pCurrentGroup(int p_group_num);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
ParticleGroup* pGetCurrentGroup(void);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pDeleteParticleGroups(int p_group_num, int p_group_count = 1);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pDrawGroupl(int dlist, bool const_size = false,
|
|
|
|
bool const_color = false, bool const_rotation = false);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pDrawGroupp(int primitive, bool const_size = false,
|
|
|
|
bool const_color = false);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
// Added <<< cgc >>>
|
|
|
|
void DrawGroupTriSplat(const pVector& view, const pVector& up, float size_scale = 1.0f, bool draw_tex = false, bool const_size = false, bool const_color = false);
|
|
|
|
// end
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
int pGenParticleGroups(int p_group_count = 1, int max_particles = 0);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
int pGetGroupCount();
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
int pGetParticles(int index, int count, float* position = NULL, float* color = NULL,
|
|
|
|
float* vel = NULL, float* size = NULL, float* age = NULL);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
int pSetMaxParticles(int max_count);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
// Actions
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pAvoid(float magnitude, float epsilon, float look_ahead,
|
|
|
|
PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pBounce(float friction, float resilience, float cutoff,
|
|
|
|
PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pCopyVertexB(bool copy_pos = true, bool copy_vel = false);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pDamping(float damping_x, float damping_y, float damping_z,
|
|
|
|
float vlow = 0.0f, float vhigh = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pExplosion(float center_x, float center_y, float center_z, float velocity,
|
|
|
|
float magnitude, float stdev, float epsilon = P_EPS, float age = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pFollow(float magnitude = 1.0f, float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pGravitate(float magnitude = 1.0f, float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pGravity(float dir_x, float dir_y, float dir_z);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pJet(float center_x, float center_y, float center_z, float magnitude = 1.0f,
|
|
|
|
float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pKillOld(float age_limit, bool kill_less_than = false);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pMatchVelocity(float magnitude = 1.0f, float epsilon = P_EPS,
|
|
|
|
float max_radius = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pMove();
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pOrbitLine(float p_x, float p_y, float p_z,
|
|
|
|
float axis_x, float axis_y, float axis_z, float magnitude = 1.0f,
|
|
|
|
float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pOrbitPoint(float center_x, float center_y, float center_z,
|
|
|
|
float magnitude = 1.0f, float epsilon = P_EPS,
|
|
|
|
float max_radius = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pRandomAccel(PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pRandomDisplace(PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pRandomVelocity(PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pRestore(float time);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pShade(float color_x, float color_y, float color_z,
|
|
|
|
float alpha, float scale);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pSink(bool kill_inside, PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pSinkVelocity(bool kill_inside, PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pSource(float particle_rate, PDomainEnum dtype,
|
|
|
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
|
|
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
|
|
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pSpeedLimit(float min_speed, float max_speed = P_MAXFLOAT);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pTargetColor(float color_x, float color_y, float color_z,
|
|
|
|
float alpha, float scale);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pTargetSize(float size_x, float size_y, float size_z,
|
|
|
|
float scale_x = 0.0f, float scale_y = 0.0f, float scale_z = 0.0f);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pTargetVelocity(float vel_x, float vel_y, float vel_z, float scale);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pVertex(float x, float y, float z);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
2020-07-05 16:11:06 +00:00
|
|
|
void pVortex(float center_x, float center_y, float center_z,
|
|
|
|
float axis_x, float axis_y, float axis_z,
|
|
|
|
float magnitude = 1.0f, float epsilon = P_EPS,
|
|
|
|
float max_radius = P_MAXFLOAT);
|
|
|
|
}
|
2018-04-22 15:55:55 +00:00
|
|
|
#endif
|