File: multiscene_geometry_device.h

package info (click to toggle)
embree 4.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 100,656 kB
  • sloc: cpp: 228,918; xml: 40,944; ansic: 2,685; python: 812; sh: 635; makefile: 228; csh: 42
file content (62 lines) | stat: -rw-r--r-- 1,773 bytes parent folder | download
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "../common/tutorial/tutorial_device.h"

namespace embree {

#define NUM_SPHERES 20
#define NUM_PHI 120
#define NUM_THETA 240


struct TutorialData
{
  int numSpheres = NUM_SPHERES;
  int numPhi = NUM_PHI;
  int numTheta = NUM_THETA;

  
  /* scene data */
  RTCScene  g_scene_0;
  RTCScene  g_scene_1;
  RTCScene  g_scene_2;
  RTCScene  g_curr_scene;
  Vec3fa* position;
  Vec3fa* colors0;
  Vec3fa* colors1;
  Vec3fa* colors2;
  Vec3fa* colors;
  float* radius;
  int disabledID = -1;
  int g_scene_id = 0;
};

inline void TutorialData_Constructor(TutorialData* This)
{
  This->g_scene_0 = nullptr;
  This->g_scene_1 = nullptr;
  This->g_scene_2 = nullptr;
  This->g_curr_scene = nullptr;
  This->position = (Vec3fa*) alignedUSMMalloc(NUM_SPHERES*sizeof(Vec3fa),16);
  This->colors = nullptr;
  This->colors0 = (Vec3fa*) alignedUSMMalloc((NUM_SPHERES+1)*sizeof(Vec3fa),16);
  This->colors1 = (Vec3fa*) alignedUSMMalloc((NUM_SPHERES/2+1)*sizeof(Vec3fa),16);
  This->colors2 = (Vec3fa*) alignedUSMMalloc((NUM_SPHERES/2+1)*sizeof(Vec3fa),16);
  This->radius = (float*) alignedUSMMalloc((NUM_SPHERES)*sizeof(float),16);
}

inline void TutorialData_Destructor(TutorialData* This)
{
  rtcReleaseScene (This->g_scene_0); This->g_scene_0 = nullptr;
  rtcReleaseScene (This->g_scene_1); This->g_scene_1 = nullptr;
  rtcReleaseScene (This->g_scene_2); This->g_scene_2 = nullptr;
  alignedUSMFree(This->position); This->position = nullptr;
  alignedUSMFree(This->colors0); This->colors = nullptr;
  alignedUSMFree(This->colors1); This->colors = nullptr;
  alignedUSMFree(This->colors2); This->colors = nullptr;
  alignedUSMFree(This->radius); This->radius = nullptr;

}

} // namespace embree