Panda3D
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
panda
src
particlesystem
pointEmitter.cxx
1
// Filename: pointEmitter.cxx
2
// Created by: charles (22Jun00)
3
//
4
////////////////////////////////////////////////////////////////////
5
//
6
// PANDA 3D SOFTWARE
7
// Copyright (c) Carnegie Mellon University. All rights reserved.
8
//
9
// All use of this software is subject to the terms of the revised BSD
10
// license. You should have received a copy of this license along
11
// with this source code in a file named "LICENSE."
12
//
13
////////////////////////////////////////////////////////////////////
14
15
#include "pointEmitter.h"
16
17
////////////////////////////////////////////////////////////////////
18
// Function : PointEmitter
19
// Access : Public
20
// Description : constructor
21
////////////////////////////////////////////////////////////////////
22
PointEmitter::
23
PointEmitter
() :
24
BaseParticleEmitter
() {
25
_location.set(0.0f, 0.0f, 0.0f);
26
}
27
28
////////////////////////////////////////////////////////////////////
29
// Function : PointEmitter
30
// Access : Public
31
// Description : copy constructor
32
////////////////////////////////////////////////////////////////////
33
PointEmitter::
34
PointEmitter
(
const
PointEmitter
©) :
35
BaseParticleEmitter
(copy) {
36
_location = copy._location;
37
}
38
39
////////////////////////////////////////////////////////////////////
40
// Function : ~PointEmitter
41
// Access : Public
42
// Description : destructor
43
////////////////////////////////////////////////////////////////////
44
PointEmitter::
45
~PointEmitter
() {
46
}
47
48
////////////////////////////////////////////////////////////////////
49
// Function : make_copy
50
// Access : Public
51
// Description : copier
52
////////////////////////////////////////////////////////////////////
53
BaseParticleEmitter
*
PointEmitter::
54
make_copy
() {
55
return
new
PointEmitter
(*
this
);
56
}
57
58
////////////////////////////////////////////////////////////////////
59
// Function : PointEmitter::assign_initial_position
60
// Access : Public
61
// Description : Generates a location for a new particle
62
////////////////////////////////////////////////////////////////////
63
void
PointEmitter::
64
assign_initial_position(
LPoint3
& pos) {
65
pos = _location;
66
}
67
68
////////////////////////////////////////////////////////////////////
69
// Function : PointEmitter::assign_initial_velocity
70
// Access : Public
71
// Description : Generates a velocity for a new particle
72
////////////////////////////////////////////////////////////////////
73
void
PointEmitter::
74
assign_initial_velocity(
LVector3
& vel) {
75
vel.set(0,0,0);
76
}
77
78
////////////////////////////////////////////////////////////////////
79
// Function : output
80
// Access : Public
81
// Description : Write a string representation of this instance to
82
// <out>.
83
////////////////////////////////////////////////////////////////////
84
void
PointEmitter::
85
output
(ostream &out)
const
{
86
#ifndef NDEBUG //[
87
out<<
"PointEmitter"
;
88
#endif //] NDEBUG
89
}
90
91
////////////////////////////////////////////////////////////////////
92
// Function : write
93
// Access : Public
94
// Description : Write a string representation of this instance to
95
// <out>.
96
////////////////////////////////////////////////////////////////////
97
void
PointEmitter::
98
write
(ostream &out,
int
indent)
const
{
99
#ifndef NDEBUG //[
100
out.width(indent); out<<
""
; out<<
"PointEmitter:\n"
;
101
out.width(indent+2); out<<
""
; out<<
"_location "
<<_location<<
"\n"
;
102
BaseParticleEmitter::write
(out, indent+2);
103
#endif //] NDEBUG
104
}
PointEmitter::output
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
Definition:
pointEmitter.cxx:85
PointEmitter::PointEmitter
PointEmitter()
constructor
Definition:
pointEmitter.cxx:23
LVector3f
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition:
lvector3.h:100
LPoint3f
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition:
lpoint3.h:99
PointEmitter::~PointEmitter
virtual ~PointEmitter()
destructor
Definition:
pointEmitter.cxx:45
PointEmitter
Describes a planar ring region in which particles are generated.
Definition:
pointEmitter.h:25
PointEmitter::write
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Definition:
pointEmitter.cxx:98
BaseParticleEmitter::write
virtual void write(ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
Definition:
baseParticleEmitter.cxx:107
PointEmitter::make_copy
virtual BaseParticleEmitter * make_copy()
copier
Definition:
pointEmitter.cxx:54
BaseParticleEmitter
Describes a physical region in space in which particles are randomly generated.
Definition:
baseParticleEmitter.h:31
Generated on Mon Feb 1 2016 13:44:31 for Panda3D by
1.8.5