Panda3D
Loading...
Searching...
No Matches
linearUserDefinedForce.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 linearUserDefinedForce.cxx
10 * @author charles
11 * @date 2000-07-31
12 */
13
15
16TypeHandle LinearUserDefinedForce::_type_handle;
17
18/**
19 * constructor
20 */
22LinearUserDefinedForce(LVector3 (*proc)(const PhysicsObject *),
23 PN_stdfloat a, bool md) :
24 LinearForce(a, md),
25 _proc(proc)
26{
27}
28
29/**
30 * copy constructor
31 */
34 LinearForce(copy) {
35 _proc = copy._proc;
36}
37
38/**
39 * destructor
40 */
44
45/**
46 * child copier
47 */
48LinearForce *LinearUserDefinedForce::
49make_copy() {
50 return new LinearUserDefinedForce(*this);
51}
52
53/**
54 * force builder
55 */
56LVector3 LinearUserDefinedForce::
57get_child_vector(const PhysicsObject *po) {
58 return _proc(po);
59}
60
61/**
62 * Write a string representation of this instance to <out>.
63 */
65output(std::ostream &out) const {
66 #ifndef NDEBUG //[
67 out<<"LinearUserDefinedForce";
68 #endif //] NDEBUG
69}
70
71/**
72 * Write a string representation of this instance to <out>.
73 */
75write(std::ostream &out, int indent) const {
76 #ifndef NDEBUG //[
77 out.width(indent); out<<""; out<<"LinearUserDefinedForce:\n";
79 #endif //] NDEBUG
80}
A force that acts on a PhysicsObject by way of an Integrator.
Definition linearForce.h:23
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
A programmable force that takes an evaluator function.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
LinearUserDefinedForce(LVector3(*proc)(const PhysicsObject *)=nullptr, PN_stdfloat a=1.0f, bool md=false)
constructor
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
virtual ~LinearUserDefinedForce()
destructor
A body on which physics will be applied.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
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.