Panda3D
Loading...
Searching...
No Matches
baseForce.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 baseForce.cxx
10 * @author charles
11 * @date 2000-08-08
12 */
13
14#include "baseForce.h"
15#include "indent.h"
16
17TypeHandle BaseForce::_type_handle;
18
19/**
20 * constructor
21 */
22BaseForce::
23BaseForce(bool active) :
24 _force_node(nullptr),
25 _active(active)
26{
27}
28
29/**
30 * copy constructor
31 */
32BaseForce::
33BaseForce(const BaseForce &copy) :
35{
36 _active = copy._active;
37 _force_node = nullptr;
38}
39
40/**
41 * destructor
42 */
46
47/**
48 * Write a string representation of this instance to <out>.
49 */
51output(std::ostream &out) const {
52 out << "BaseForce (id " << this << ")";
53}
54
55/**
56 * Write a string representation of this instance to <out>.
57 */
59write(std::ostream &out, int indent_level) const {
60 indent(out, indent_level)
61 << "BaseForce (id " << this << "):\n";
62
63 indent(out, indent_level + 2)
64 << "_force_node ";
65 if (_force_node) {
66 out << _force_node_path << "\n";
67 } else {
68 out << "null\n";
69 }
70
71 indent(out, indent_level + 2)
72 << "_active " << _active << "\n";
73}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pure virtual base class for all forces that could POSSIBLY exist.
Definition baseForce.h:29
virtual void write(std::ostream &out, int indent_level=0) const
Write a string representation of this instance to <out>.
Definition baseForce.cxx:59
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
Definition baseForce.cxx:51
virtual ~BaseForce()
destructor
Definition baseForce.cxx:44
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
Definition indent.cxx:20
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.