Functions for generating super ellipsoid shapes.
More...
#include <SuperEllipsoidModel.h>
|
static void | create (int samples, float n1, float n2, float scale, float **roundedCubeCoordinates, float **roundedCubeNormalVectors, int *numberOfVertices, int *numberOfCoordinates, int *numberOfNormals) |
| Function that generates vertices and normal vectors of rounded cube. More...
|
|
static void | create (int samples, float n1, float n2, float scale, float **roundedCubeCoordinates, float **roundedCubeNormalVectors, int *numberOfVertices, int *numberOfCoordinates, int *numberOfNormals) |
| Function that generates vertices and normal vectors of rounded cube. More...
|
|
|
static Vec3f | calculateNormal (float xyAngle, float xzAngle, float n1, float n2, float scale) |
| Compute normal vector of a super ellipsoid. More...
|
|
static Vec3f | sample (float xyAngle, float xzAngle, float n1, float n2, float scale) |
| Compute vertex of a super ellipsoid. More...
|
|
static void | storeVertexAndNormalVectorInArray (const Vec3f &vertex, const Vec3f &normalVector, int &vertexIndex, int &normalVectorIndex, float *roundedCubeCoordinates, float *roundedCubeNormalVectors) |
| Put vertex and normal vector values into vertex array and normal vector array. More...
|
|
static Vec3f | calculateNormal (float xyAngle, float xzAngle, float n1, float n2, float scale) |
| Compute normal vector of a super ellipsoid. More...
|
|
static Vec3f | sample (float xyAngle, float xzAngle, float n1, float n2, float scale) |
| Compute vertex of a super ellipsoid. More...
|
|
static void | storeVertexAndNormalVectorInArray (const Vec3f &vertex, const Vec3f &normalVector, int &vertexIndex, int &normalVectorIndex, float *roundedCubeCoordinates, float *roundedCubeNormalVectors) |
| Put vertex and normal vector values into vertex array and normal vector array. More...
|
|
Functions for generating super ellipsoid shapes.
Definition at line 31 of file SuperEllipsoidModel.h.
Compute normal vector of a super ellipsoid.
Whole shape lies at the centre of a box of dimension (-1, 1) on every axis.
- Parameters
-
[in] | xyAngle | XY angle for which we compute a vertex. |
[in] | xzAngle | XZ angle for which we compute a vertex. |
[in] | n1 | The "squareness" of our figure - property that tells how rounded the geometry will be in XZ space. |
[in] | n2 | The "squareness" of our figure - property that tells how rounded the geometry will be in XY space. |
[in] | scale | Scale factor applied to the object. |
- Returns
- The normal vector of the super ellipsoid.
Definition at line 149 of file SuperEllipsoidModel.cpp.
Compute normal vector of a super ellipsoid.
Whole shape lies at the centre of a box of dimension (-1, 1) on every axis.
- Parameters
-
[in] | xyAngle | XY angle for which we compute a vertex. |
[in] | xzAngle | XZ angle for which we compute a vertex. |
[in] | n1 | The "squareness" of our figure - property that tells how rounded the geometry will be in XZ space. |
[in] | n2 | The "squareness" of our figure - property that tells how rounded the geometry will be in XY space. |
[in] | scale | Scale factor applied to the object. |
- Returns
- The normal vector of the super ellipsoid.
void MaliSDK::SuperEllipsoidModel::create |
( |
int |
samples, |
|
|
float |
n1, |
|
|
float |
n2, |
|
|
float |
scale, |
|
|
float ** |
roundedCubeCoordinates, |
|
|
float ** |
roundedCubeNormalVectors, |
|
|
int * |
numberOfVertices, |
|
|
int * |
numberOfCoordinates, |
|
|
int * |
numberOfNormals |
|
) |
| |
|
static |
Function that generates vertices and normal vectors of rounded cube.
It creates an "unit"-size ellipsoid (-1 to 1) at the origin. This function generates vertices of superellipsoid, a versatile primitive that is controlled by two parameters - n1 and n2. It can represent a sphere, square box, and closed cylindrical can. The parameter samples determine the accuracy of this primitive (if it has sharp or smooth edges). It should be noted that there are some numerical issues with both very small or very large values of n1 and n2 parameters. Typically, for safety, they should be in the range of 0.1 to 5.0. After using this function user should deallocate memory reserved for roundedCubeCoordinates and roundedCubeNormalVectors.
- Parameters
-
[in] | samples | The number of triangles that will create super ellipsoid. |
[in] | n1 | The "squareness" of our figure - property that tells how rounded the geometry will be in XZ space. |
[in] | n2 | The "squareness" of our figure - property that tells how rounded the geometry will be in XY space. |
[in] | scale | Scale factor applied to the object. |
[out] | roundedCubeCoordinates | Pointer to an array that holds rounded cube's coordinates. |
[out] | roundedCubeNormalVectors | Pointer to an array that holds rounded cube's normal vectors. |
[out] | numberOfVertices | Number of generated vertices. |
[out] | numberOfCoordinates | Number of generated coordinates. |
[out] | numberOfNormals | Number of generated normal vectors. |
Definition at line 30 of file SuperEllipsoidModel.cpp.
static void MaliSDK::SuperEllipsoidModel::create |
( |
int |
samples, |
|
|
float |
n1, |
|
|
float |
n2, |
|
|
float |
scale, |
|
|
float ** |
roundedCubeCoordinates, |
|
|
float ** |
roundedCubeNormalVectors, |
|
|
int * |
numberOfVertices, |
|
|
int * |
numberOfCoordinates, |
|
|
int * |
numberOfNormals |
|
) |
| |
|
static |
Function that generates vertices and normal vectors of rounded cube.
It creates an "unit"-size ellipsoid (-1 to 1) at the origin. This function generates vertices of superellipsoid, a versatile primitive that is controlled by two parameters - n1 and n2. It can represent a sphere, square box, and closed cylindrical can. The parameter samples determine the accuracy of this primitive (if it has sharp or smooth edges). It should be noted that there are some numerical issues with both very small or very large values of n1 and n2 parameters. Typically, for safety, they should be in the range of 0.1 to 5.0. After using this function user should deallocate memory reserved for roundedCubeCoordinates and roundedCubeNormalVectors.
- Parameters
-
[in] | samples | The number of triangles that will create super ellipsoid. |
[in] | n1 | The "squareness" of our figure - property that tells how rounded the geometry will be in XZ space. |
[in] | n2 | The "squareness" of our figure - property that tells how rounded the geometry will be in XY space. |
[in] | scale | Scale factor applied to the object. |
[out] | roundedCubeCoordinates | Pointer to an array that holds rounded cube's coordinates. |
[out] | roundedCubeNormalVectors | Pointer to an array that holds rounded cube's normal vectors. |
[out] | numberOfVertices | Number of generated vertices. |
[out] | numberOfCoordinates | Number of generated coordinates. |
[out] | numberOfNormals | Number of generated normal vectors. |
Compute vertex of a super ellipsoid.
Whole shape lies at the centre of a box of dimension (-1, 1) on every axis.
- Parameters
-
[in] | xyAngle | XY angle for which we compute a vertex. |
[in] | xzAngle | XZ angle for which we compute a vertex. |
[in] | n1 | The "squareness" of our figure - property that tells how rounded the geometry will be in XZ space. |
[in] | n2 | The "squareness" of our figure - property that tells how rounded the geometry will be in XY space. |
[in] | scale | Scale factor applied to the object. |
- Returns
- point of the super ellipsoid.
Definition at line 184 of file SuperEllipsoidModel.cpp.
Compute vertex of a super ellipsoid.
Whole shape lies at the centre of a box of dimension (-1, 1) on every axis.
- Parameters
-
[in] | xyAngle | XY angle for which we compute a vertex. |
[in] | xzAngle | XZ angle for which we compute a vertex. |
[in] | n1 | The "squareness" of our figure - property that tells how rounded the geometry will be in XZ space. |
[in] | n2 | The "squareness" of our figure - property that tells how rounded the geometry will be in XY space. |
[in] | scale | Scale factor applied to the object. |
- Returns
- point of the super ellipsoid.
void MaliSDK::SuperEllipsoidModel::storeVertexAndNormalVectorInArray |
( |
const Vec3f & |
vertex, |
|
|
const Vec3f & |
normalVector, |
|
|
int & |
vertexIndex, |
|
|
int & |
normalVectorIndex, |
|
|
float * |
roundedCubeCoordinates, |
|
|
float * |
roundedCubeNormalVectors |
|
) |
| |
|
inlinestaticprivate |
Put vertex and normal vector values into vertex array and normal vector array.
We modify vertexIndex and normalVectorIndex inside this function in order to simplify algorithm in the createSuperEllipsoid function.
- Parameters
-
[in] | vertex | Vertex that will be saved in vertex array. |
[in] | normalVector | Normal vector that will be saved in normal vector array. |
[in] | vertexIndex | Vertex array index where new coordinate should be saved. |
[out] | normalVectorIndex | Normal vector array index where new coordinate should be saved. |
[out] | roundedCubeCoordinates | Pointer to an array that holds rounded cube's coordinates. |
[out] | roundedCubeNormalVectors | Pointer to an array that holds rounded cube's normal vectors. |
Definition at line 218 of file SuperEllipsoidModel.cpp.
static void MaliSDK::SuperEllipsoidModel::storeVertexAndNormalVectorInArray |
( |
const Vec3f & |
vertex, |
|
|
const Vec3f & |
normalVector, |
|
|
int & |
vertexIndex, |
|
|
int & |
normalVectorIndex, |
|
|
float * |
roundedCubeCoordinates, |
|
|
float * |
roundedCubeNormalVectors |
|
) |
| |
|
inlinestaticprivate |
Put vertex and normal vector values into vertex array and normal vector array.
We modify vertexIndex and normalVectorIndex inside this function in order to simplify algorithm in the createSuperEllipsoid function.
- Parameters
-
[in] | vertex | Vertex that will be saved in vertex array. |
[in] | normalVector | Normal vector that will be saved in normal vector array. |
[in] | vertexIndex | Vertex array index where new coordinate should be saved. |
[out] | normalVectorIndex | Normal vector array index where new coordinate should be saved. |
[out] | roundedCubeCoordinates | Pointer to an array that holds rounded cube's coordinates. |
[out] | roundedCubeNormalVectors | Pointer to an array that holds rounded cube's normal vectors. |
const int MaliSDK::SuperEllipsoidModel::numberOfPointCoordinates = 4 |
|
staticprivate |
The documentation for this class was generated from the following files:
- /mnt/d/working/gitlab/opengles-sdk-android/samples/advanced_samples/common_native/inc/models/SuperEllipsoidModel.h
- /mnt/d/working/gitlab/opengles-sdk-android/samples/advanced_samples/common_native/src/models/SuperEllipsoidModel.cpp