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
|
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../common/tutorial/tutorial_device.isph"
#define NUM_SPHERES 20
#define NUM_PHI 120
#define NUM_THETA 240
struct TutorialData
{
int numSpheres;
int numPhi;
int numTheta;
/* scene data */
RTCScene g_scene;
uniform Vec3fa* uniform position;
uniform Vec3fa* uniform colors;
uniform float* uniform radius;
// int disabledID = -1;
};
void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->numSpheres = NUM_SPHERES;
This->numPhi = NUM_PHI;
This->numTheta = NUM_THETA;
This->g_scene = NULL;
This->position = uniform new uniform Vec3fa[NUM_SPHERES];
This->colors = uniform new uniform Vec3fa[NUM_SPHERES+1];
This->radius = uniform new uniform float[NUM_SPHERES];
}
void TutorialData_Destructor(uniform TutorialData* uniform This)
{
rtcReleaseScene (This->g_scene); This->g_scene = NULL;
delete[] This->position; This->position = NULL;
delete[] This->colors; This->colors = NULL;
delete[] This->radius; This->radius = NULL;
}
|