GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
Pieces.hh
Go to the documentation of this file.
1//
2// Copyright (C) 2009 Tero Pulkkinen
3// Released under LGPL License.
4//
5// This file is part of Polygon.
6//
7// Polygon is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// Polygon is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU Library General Public License
18// along with Polygon. If not, see <http://www.gnu.org/licenses/>.
19//
20
21
22#ifndef PIECES_HH
23#define PIECES_HH
24
25#include "VectorTools.hh"
26
27struct Heights
28{
29 float tl;
30 float tr;
31 float bl;
32 float br;
33};
34struct Color2
35{
36 float r,g,b,t;
37};
39{
40 float time;
41 const Color2 *c;
42};
43struct Dir
44{
46};
47struct Size2
48{
49 float x,y,z;
50};
51
52static const Heights zero = { 0.0, 0.0, 0.0, 0.0 };
53static const Color2 red = { 1.0, 0.0, 0.0, 1.0 };
54static const Color2 green = { 0.0, 1.0, 0.0, 1.0 };
55static const Color2 blue = { 0.0, 0.0, 1.0, 1.0 };
56static const Color2 white = { 1.0, 1.0, 1.0, 1.0 };
57
58//static const Color *colors[] = { &red, &green, &blue, &white };
59
60static const TimedColor red_green[] =
61 {
62 { 0.0, &red },
63 { 100.0, &green },
64 { 200.0, &red }
65 };
66static const int red_green_size = sizeof(red_green) / sizeof(TimedColor);
67//static const Dir unit_dir =
68// {
69// Vector(1.0, 0.0, 0.0),
70// Vector(0.0, 1.0, 0.0),
71// Vector(0.0, 0.0, 1.0)
72// };
73static const Size2 size100 =
74 {
75 100.0, 100.0, 100.0
76 };
77void PlainPiece(const Heights &h, const Color2 &c);
78Color2 TransformColor(const Color2 &c1, const Color2 &c2,
79 float starttime, float endtime, float time);
80Color2 AnimColor(const TimedColor *color, int count, float time);
81void Cube(const Point &center, const Dir &d, const Color2 &c, const Size2 &s);
82Point TransformPoint(const Point &p1, const Point &p2,
83 float starttime, float endtime, float time);
84
85Vector TransformVector(const Vector &p1, const Vector &p2,
86 float starttime, float endtime, float time);
87
88float TransformFloat(const float &f1, const float &f2,
89 float starttime, float endtime, float time);
90
91
92#endif
void PlainPiece(const Heights &h, const Color2 &c)
Definition Pieces.cc:29
void Cube(const Point &center, const Dir &d, const Color2 &c, const Size2 &s)
Definition Pieces.cc:55
Color2 TransformColor(const Color2 &c1, const Color2 &c2, float starttime, float endtime, float time)
Definition Pieces.cc:131
Point TransformPoint(const Point &p1, const Point &p2, float starttime, float endtime, float time)
Definition Pieces.cc:145
float TransformFloat(const float &f1, const float &f2, float starttime, float endtime, float time)
Definition Pieces.cc:120
Color2 AnimColor(const TimedColor *color, int count, float time)
Definition Pieces.cc:172
Vector TransformVector(const Vector &p1, const Vector &p2, float starttime, float endtime, float time)
Definition Pieces.cc:158
Definition VectorTools.hh:125
background color
Definition gameapi_example.php:46
d
Definition meshpage.php:3895
int f2(char c)
Definition test.cpp:51
Definition Pieces.hh:35
float t
Definition Pieces.hh:36
float b
Definition Pieces.hh:36
float r
Definition Pieces.hh:36
float g
Definition Pieces.hh:36
Definition Pieces.hh:44
Vector u_z
Definition Pieces.hh:45
Vector u_y
Definition Pieces.hh:45
Vector u_x
Definition Pieces.hh:45
Definition Pieces.hh:28
float tr
Definition Pieces.hh:30
float bl
Definition Pieces.hh:31
float tl
Definition Pieces.hh:29
float br
Definition Pieces.hh:32
Definition Parser.cc:60
Definition Pieces.hh:48
float y
Definition Pieces.hh:49
float z
Definition Pieces.hh:49
float x
Definition Pieces.hh:49
Definition Pieces.hh:39
float time
Definition Pieces.hh:40
const Color2 * c
Definition Pieces.hh:41