Panda3D

Loading...
Searching...
No Matches
cConstrainHprInterval.h
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 cConstrainHprInterval.h
10 * @author pratt
11 * @date 2008-03-10
12 */
13
14#ifndef CCONSTRAINHPRINTERVAL_H
15#define CCONSTRAINHPRINTERVAL_H
16
17#include "directbase.h"
18#include "cConstraintInterval.h"
19#include "nodePath.h"
20#include "lvecBase3.h"
21#include "lquaternion.h"
22
23/**
24 * A constraint interval that will constrain the orientation of one node to
25 * the orientation of another.
26 */
27 class EXPCL_DIRECT_INTERVAL CConstrainHprInterval : public CConstraintInterval {
28PUBLISHED:
29 explicit CConstrainHprInterval(const std::string &name, double duration,
30 const NodePath &node, const NodePath &target,
31 bool wrt, const LVecBase3 hprOffset=LVector3::zero());
32
33 INLINE const NodePath &get_node() const;
34 INLINE const NodePath &get_target() const;
35
36 virtual void priv_step(double t);
37 virtual void output(std::ostream &out) const;
38
39 private:
40 NodePath _node;
41 NodePath _target;
42 bool _wrt;
43 LQuaternion _quatOffset;
44
45 public:
46 static TypeHandle get_class_type() {
47 return _type_handle;
48 }
49 static void init_type() {
50 CConstraintInterval::init_type();
51 register_type(_type_handle, "CConstrainHprInterval",
52 CConstraintInterval::get_class_type());
53 }
54 virtual TypeHandle get_type() const {
55 return get_class_type();
56 }
57 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
58
59 private:
60 static TypeHandle _type_handle;
61};
62
63#include "cConstrainHprInterval.I"
64
65#endif
cConstrainHprInterval.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
cConstraintInterval.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
CConstrainHprInterval::get_target
const NodePath & get_target() const
Returns the "target" node.
Definition cConstrainHprInterval.I:26
CConstrainHprInterval::get_node
const NodePath & get_node() const
Returns the "source" node.
Definition cConstrainHprInterval.I:18
CConstrainHprInterval::CConstrainHprInterval
CConstrainHprInterval(const std::string &name, double duration, const NodePath &node, const NodePath &target, bool wrt, const LVecBase3 hprOffset=LVector3::zero())
Constructs a constraint interval that will constrain the orientation of one node to the orientation o...
Definition cConstrainHprInterval.cxx:29
CInterval::priv_step
virtual void priv_step(double t)
Advances the time on the interval.
Definition cInterval.cxx:357
NodePath
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition nodePath.h:159
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
directbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lquaternion.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
lvecBase3.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
nodePath.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition register_type.I:22