forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlvec2_ops_src.h
More file actions
51 lines (39 loc) · 1.5 KB
/
lvec2_ops_src.h
File metadata and controls
51 lines (39 loc) · 1.5 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
/**
* 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 lvec2_ops_src.h
* @author drose
* @date 2000-03-08
*/
// When possible, operators have been defined within the classes. This file
// defines operator functions outside of classes where necessary. It also
// defines some convenient out-of-class wrappers around in-class functions
// (like dot, length, normalize).
// scalar * vec (vec * scalar is defined in class)
INLINE_LINMATH FLOATNAME(LVecBase2)
operator * (FLOATTYPE scalar, const FLOATNAME(LVecBase2) &a);
INLINE_LINMATH FLOATNAME(LPoint2)
operator * (FLOATTYPE scalar, const FLOATNAME(LPoint2) &a);
INLINE_LINMATH FLOATNAME(LVector2)
operator * (FLOATTYPE scalar, const FLOATNAME(LVector2) &a);
// dot product
INLINE_LINMATH FLOATTYPE
dot(const FLOATNAME(LVecBase2) &a, const FLOATNAME(LVecBase2) &b);
#ifndef FLOATTYPE_IS_INT
// Length of a vector.
INLINE_LINMATH FLOATTYPE
length(const FLOATNAME(LVector2) &a);
// A normalized vector.
INLINE_LINMATH FLOATNAME(LVector2)
normalize(const FLOATNAME(LVector2) &v);
#endif // FLOATTYPE_IS_INT
INLINE_LINMATH void
generic_write_datagram(Datagram &dest, const FLOATNAME(LVecBase2) &value);
INLINE_LINMATH void
generic_read_datagram(FLOATNAME(LVecBase2) &result, DatagramIterator &source);
#include "lvec2_ops_src.I"