mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
*** empty log message ***
This commit is contained in:
parent
bcd675aa89
commit
c7952d866c
@ -12,7 +12,7 @@ INLINE void BaseParticle::set_lifespan(float lifespan) {
|
||||
}
|
||||
|
||||
INLINE void BaseParticle::set_alive(bool alive) {
|
||||
_alive = alive;
|
||||
_alive = alive;
|
||||
}
|
||||
|
||||
INLINE float BaseParticle::get_age(void) const {
|
||||
|
@ -1,32 +1,32 @@
|
||||
// Filename: particleCommonFuncs.h
|
||||
// Created by: darren (02Oct00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PARTICLECOMMONFUNCS_H
|
||||
#define PARTICLECOMMONFUNCS_H
|
||||
|
||||
// evaluates to a float in the range [0,1]
|
||||
#define NORMALIZED_RAND() ((float)rand() / (float)RAND_MAX)
|
||||
|
||||
// linear interpolation
|
||||
// t is in [0,1]
|
||||
// result is in [X0,X1]
|
||||
#define LERP(t,X0,X1) ((X0) + ((t) * ((X1) - (X0))))
|
||||
|
||||
// linear t -> cubic t
|
||||
// t is in [0,1]
|
||||
// result is in [0,1]
|
||||
#define CUBIC_T(t) ((t)*(t)*(3-(2*(t))))
|
||||
|
||||
// cubic interpolation
|
||||
// t is in [0,1]
|
||||
// result is in [X0,X1]
|
||||
#define CLERP(t,X0,X1) LERP(CUBIC_T(t), (X0), (X1))
|
||||
|
||||
// spread calculator
|
||||
// spread is non-negative spread magnitude
|
||||
// result is in [-spread,spread]
|
||||
#define SPREAD(magnitude) ((magnitude) - (NORMALIZED_RAND() * 2.0f * (magnitude)))
|
||||
|
||||
#endif // PARTICLECOMMONFUNCS_H
|
||||
// Filename: particleCommonFuncs.h
|
||||
// Created by: darren (02Oct00)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PARTICLECOMMONFUNCS_H
|
||||
#define PARTICLECOMMONFUNCS_H
|
||||
|
||||
// evaluates to a float in the range [0,1]
|
||||
#define NORMALIZED_RAND() ((float)rand() / (float)RAND_MAX)
|
||||
|
||||
// linear interpolation
|
||||
// t is in [0,1]
|
||||
// result is in [X0,X1]
|
||||
#define LERP(t,X0,X1) ((X0) + ((t) * ((X1) - (X0))))
|
||||
|
||||
// linear t -> cubic t
|
||||
// t is in [0,1]
|
||||
// result is in [0,1]
|
||||
#define CUBIC_T(t) ((t)*(t)*(3-(2*(t))))
|
||||
|
||||
// cubic interpolation
|
||||
// t is in [0,1]
|
||||
// result is in [X0,X1]
|
||||
#define CLERP(t,X0,X1) LERP(CUBIC_T(t), (X0), (X1))
|
||||
|
||||
// spread calculator
|
||||
// spread is non-negative spread magnitude
|
||||
// result is in [-spread,spread]
|
||||
#define SPREAD(magnitude) ((magnitude) - (NORMALIZED_RAND() * 2.0f * (magnitude)))
|
||||
|
||||
#endif // PARTICLECOMMONFUNCS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user