Panda3D
orientedParticle.cxx
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 orientedParticle.cxx
10  * @author charles
11  * @date 2000-06-19
12  */
13 
14 #include "orientedParticle.h"
15 
16 /**
17  * simple constructor
18  */
20 OrientedParticle(int lifespan, bool alive) :
21  BaseParticle(lifespan, alive) {
22  set_oriented(true);
23 }
24 
25 /**
26  * copy constructor
27  */
30  BaseParticle(copy) {
31 }
32 
33 /**
34  * simple destructor
35  */
38 }
39 
40 /**
41  * simple destructor
42  */
44 make_copy() const {
45  return new OrientedParticle(*this);
46 }
47 
48 /**
49  * particle init routine
50  */
52 init() {
53 }
54 
55 /**
56  * particle death routine
57  */
59 die() {
60 }
61 
62 /**
63  * particle update routine. This NEEDS to be filled in with quaternion slerp
64  * stuff, or oriented particles will not rotate.
65  */
67 update() {
68 }
69 
70 /**
71  * Write a string representation of this instance to <out>.
72  */
74 output(std::ostream &out) const {
75  #ifndef NDEBUG //[
76  out<<"OrientedParticle";
77  #endif //] NDEBUG
78 }
79 
80 /**
81  * Write a string representation of this instance to <out>.
82  */
84 write(std::ostream &out, int indent) const {
85  #ifndef NDEBUG //[
86  out.width(indent); out<<""; out<<"OrientedParticle:\n";
88  #endif //] NDEBUG
89 }
A body on which physics will be applied.
Definition: physicsObject.h:27
virtual void init()
particle init routine
virtual PhysicsObject * make_copy() const
simple destructor
Describes a particle that has angular characteristics (velocity, orientation).
virtual ~OrientedParticle()
simple destructor
virtual void update()
particle update routine.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition: indent.cxx:20
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
OrientedParticle(int lifespan=0, bool alive=false)
simple constructor
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual void die()
particle death routine
An individual, physically-modelable particle abstract base class.
Definition: baseParticle.h:23
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_oriented(bool flag)
Set flag to determine whether this object should do any rotation or orientation calculations.