GlistEngine
Loading...
Searching...
No Matches
gCircle.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Nitra Games Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * gCircle.h
19 *
20 * Created on: 9 Tem 2021
21 * Author: YavuzBilginoglu
22 */
23
24#ifndef GRAPHICS_PRIMITIVES_GCIRCLE_H_
25#define GRAPHICS_PRIMITIVES_GCIRCLE_H_
26
27#include "gMesh.h"
28
29/*
30 * Creates objects with the shape of a circle.
31 */
32class gCircle: public gMesh {
33public:
34
35 /*
36 * Creates objects with the shape of a circle.
37 * Calculating coordinate information.
38 * @param xCenter x-coordinate of the circle's center
39 * @param yCenter y-coordinate of the circle's center
40 * @param radius radius of the circle
41 * @param isFilled signifies whether the circle is full or empty
42 * @param numberOfsides indicates the detail value of the circle.
43 */
45 gCircle(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides = 64.0f);
46 virtual ~gCircle();
47
48 /*
49 * Provides draw using mesh class.
50 */
51 void draw();
52
53 void setPoints(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides = 64.0f);
54
55 /*
56 * Determines whether the projection is two-dimensional.
57 * The coordinates of the circle vertices created are taken.
58 * Provides draw using mesh class.
59 *
60 * @param xCenter x-coordinate of the circle's center
61 * @param yCenter y-coordinate of the circle's center
62 * @param radius radius of the circle
63 * @param isFilled signifies whether the circle is full or empty
64 * @param numberOfsides indicates the detail value of the circle.
65 */
66 void draw(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides = 64.0f);
67
68private:
69
70 /*
71 * The circle is formed by triangles.
72 * These triangles vertices form circle.
73 * Calculating coordinate information.
74 * The more side are given, the sharper the circle will be, as the number of triangles will increase.
75 * But it does not provide any visible change after 64 sides given as default.
76 *
77 * @param xCenter x-coordinate of the circle's center
78 * @param yCenter y-coordinate of the circle's center
79 * @param radius radius of the circle
80 * @param isFilled signifies whether the circle is full or empty
81 * @param numberOfsides indicates the detail value of the circle.
82 */
83 void setCirclePoints(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides = 64.0f);
84};
85
86#endif /* GRAPHICS_PRIMITIVES_GCIRCLE_H_ */
Definition gCircle.h:32
void setPoints(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides=64.0f)
virtual ~gCircle()
void draw()
void draw(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides=64.0f)
gCircle(float xCenter, float yCenter, float radius, bool isFilled, float numberOfSides=64.0f)
Definition gMesh.h:27