Panda3D
 All Classes Functions Variables Enumerations
linearSourceForce.h
1 // Filename: linearSourceForce.h
2 // Created by: charles (21Jun00)
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 #ifndef LINEARSOURCEFORCE_H
16 #define LINEARSOURCEFORCE_H
17 
18 #include "linearDistanceForce.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : LinearSourceForce
22 // Description : Repellant force.
23 ////////////////////////////////////////////////////////////////////
24 class EXPCL_PANDAPHYSICS LinearSourceForce : public LinearDistanceForce {
25 PUBLISHED:
26  LinearSourceForce(const LPoint3& p, FalloffType f, PN_stdfloat r, PN_stdfloat a = 1.0f,
27  bool mass = true);
30  virtual ~LinearSourceForce();
31 
32  virtual void output(ostream &out) const;
33  virtual void write(ostream &out, unsigned int indent=0) const;
34 
35 private:
36  virtual LVector3 get_child_vector(const PhysicsObject *po);
37  virtual LinearForce *make_copy();
38 
39 public:
40  static TypeHandle get_class_type() {
41  return _type_handle;
42  }
43  static void init_type() {
44  LinearDistanceForce::init_type();
45  register_type(_type_handle, "LinearSourceForce",
46  LinearDistanceForce::get_class_type());
47  }
48  virtual TypeHandle get_type() const {
49  return get_class_type();
50  }
51  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
52 
53 private:
54  static TypeHandle _type_handle;
55 };
56 
57 #endif // LINEARSOURCEFORCE_H
A body on which physics will be applied.
Definition: physicsObject.h:29
Pure virtual class for sinks and sources.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
Definition: lvector3.h:100
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
A force that acts on a PhysicsObject by way of an Integrator.
Definition: linearForce.h:25
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.
virtual void write(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
Repellant force.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85