Panda3D
Loading...
Searching...
No Matches
baseParticle.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file baseParticle.I
10 * @author charles
11 * @date 2000-06-16
12 */
13
14INLINE void BaseParticle::set_age(PN_stdfloat age) {
15 _age = age;
16}
17
18INLINE void BaseParticle::set_lifespan(PN_stdfloat lifespan) {
19 _lifespan = lifespan;
20}
21
22INLINE void BaseParticle::set_alive(bool alive) {
23 _alive = alive;
24}
25
26INLINE void BaseParticle::set_index(int index) {
27 _index = index;
28}
29
30INLINE PN_stdfloat BaseParticle::get_age() const {
31 return _age;
32}
33
34INLINE PN_stdfloat BaseParticle::get_lifespan() const {
35 return _lifespan;
36}
37
38INLINE bool BaseParticle::get_alive() const {
39 return _alive;
40}
41
42INLINE int BaseParticle::get_index() const {
43 return _index;
44}
45
46INLINE PN_stdfloat BaseParticle::get_parameterized_age() const {
47 if (_lifespan <= 0) return 1.0;
48 return _age / _lifespan;
49}
50
51INLINE PN_stdfloat BaseParticle::get_parameterized_vel() const {
52 if (IS_NEARLY_ZERO(get_terminal_velocity())) return 0.0;
53 return (get_velocity().length()) / get_terminal_velocity();
54}
get_velocity
Velocity Query per second.
get_terminal_velocity
tv query