source: NonGTP/FCollada/FMath/FMVector4.h @ 964

Revision 964, 1.9 KB checked in by igarcia, 18 years ago (diff)
RevLine 
[964]1/*
2        Copyright (C) 2005-2006 Feeling Software Inc.
3        MIT License: http://www.opensource.org/licenses/mit-license.php
4*/
5
6/**
7        @file FMVector4.h
8        This file contains the class for 4 dimensional vectors.
9*/
10
11#ifndef _FM_VECTOR4_H_
12#define _FM_VECTOR4_H_
13
14/**
15        A 4 dimensional vector.
16        Not used within FCollada.
17       
18        @ingroup FMath
19*/
20class FCOLLADA_EXPORT FMVector4
21{
22public:
23        float x;        /**< The first coordinate. */
24        float y;        /**< The second coordinate. */
25        float z;        /**< The third coordinate. */
26        float w;        /**< The forth coordinate. */
27
28        /**
29         * Creates an empty FMVector4.
30         */
31        #ifndef _DEBUG
32        FMVector4() {}
33        #else
34        FMVector4() { x = 123456789.0f; y = 123456789.0f; z = 123456789.0f; w = 123456789.0f; }
35        #endif
36
37        /**
38         * Creates the FMVector4 with the coordinates given.
39         *
40         * The first three coordinates are taken from the FMVector3, where the
41         * first one is the x value, the second is that y, and the third is the z.
42         * The forth value is the \c float specified.
43         *
44         *
45         * @param v The FMVector3 representing the first three coordinates.
46         * @param _w The final coordinate.
47         */
48        FMVector4(FMVector3 v, float _w) { x = v.x; y = v.y; z = v.z; w = _w; }
49
50        /**
51         * Creates the FMVector4 with the coordinates given.
52         *
53         * @param _x The first coordinate.
54         * @param _y The second coordinate.
55         * @param _z The third coordinate.
56         * @param _w The forth coordinate.
57         */
58        FMVector4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
59
60public:
61        /**
62         * Get this FMVector4 as an array of \c floats.
63         *
64         * @return The \c float array.
65         */
66        inline operator float*() { return &x; }
67
68        /**
69         * Get this FMVector4 as an array of \c floats.
70         *
71         * @return The \c float array.
72         */
73        inline operator const float*() const { return &x; }
74
75public:
76        static const FMVector4 Zero;    /**< The FMVector4 representing zero */
77};
78
79#endif // _FM_VECTOR4_H_
Note: See TracBrowser for help on using the repository browser.