forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstTransform.h
More file actions
74 lines (60 loc) · 2.03 KB
/
stTransform.h
File metadata and controls
74 lines (60 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file stTransform.h
* @author drose
* @date 2010-10-06
*/
#ifndef STTRANSFORM_H
#define STTRANSFORM_H
#include "pandabase.h"
#include "transformState.h"
#include "speedtree_api.h"
#include "deg_2_rad.h"
/**
* Represents a transform that may be applied to a particular instance of a
* tree when added to the SpeedTreeNode.
*/
class EXPCL_PANDASPEEDTREE STTransform {
PUBLISHED:
INLINE STTransform();
STTransform(const TransformState *trans);
INLINE STTransform(const LPoint3 &pos, PN_stdfloat rotate = 0.0f, PN_stdfloat scale = 1.0f);
INLINE STTransform(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z, PN_stdfloat rotate, PN_stdfloat scale);
INLINE STTransform(const STTransform ©);
INLINE void operator = (const STTransform ©);
public:
INLINE STTransform(const SpeedTree::CInstance &instance);
INLINE operator SpeedTree::CInstance () const;
INLINE operator CPT(TransformState) () const;
PUBLISHED:
INLINE static const STTransform &ident_mat();
INLINE void set_pos(const LPoint3 &pos);
INLINE const LPoint3 &get_pos() const;
INLINE void set_rotate(PN_stdfloat rotate);
INLINE PN_stdfloat get_rotate() const;
INLINE void set_scale(PN_stdfloat scale);
INLINE PN_stdfloat get_scale() const;
INLINE void operator *= (const STTransform &other);
INLINE STTransform operator * (const STTransform &other) const;
void output(std::ostream &out) const;
public:
void write_datagram(BamWriter *manager, Datagram &dg);
void fillin(DatagramIterator &scan, BamReader *manager);
public:
LPoint3 _pos;
PN_stdfloat _rotate;
PN_stdfloat _scale;
static STTransform _ident_mat;
};
INLINE std::ostream &operator << (std::ostream &out, const STTransform &transform) {
transform.output(out);
return out;
}
#include "stTransform.I"
#endif