Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix camera transform not being mat4 in definitions #61

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code_gen/api/khr_camera_omnidirectional.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"description" : "camera up direction"
}, {
"name" : "transform",
"types" : ["ANARI_FLOAT32_MAT3x4"],
"types" : ["ANARI_FLOAT32_MAT4"],
"tags" : [],
"default" : [
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
0.0, 0.0, 0.0
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
],
"description" : "camera transform"
}, {
Expand Down
10 changes: 5 additions & 5 deletions code_gen/api/khr_camera_orthographic.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"description" : "camera up direction"
}, {
"name" : "transform",
"types" : ["ANARI_FLOAT32_MAT3x4"],
"types" : ["ANARI_FLOAT32_MAT4"],
"tags" : [],
"default" : [
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
0.0, 0.0, 0.0
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
],
"description" : "camera transform"
}, {
Expand Down
10 changes: 5 additions & 5 deletions code_gen/api/khr_camera_perspective.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"description" : "camera up direction"
}, {
"name" : "transform",
"types" : ["ANARI_FLOAT32_MAT3x4"],
"types" : ["ANARI_FLOAT32_MAT4"],
"tags" : [],
"default" : [
1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
0.0, 0.0, 0.0
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
],
"description" : "camera transform"
}, {
Expand Down
6 changes: 3 additions & 3 deletions examples/example_device/ExampleDeviceDebugFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ class camera_omnidirectional : public DebugObject<ANARI_CAMERA> {
return;
}
case 4: { //transform
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT3x4, ANARI_UNKNOWN};
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT4, ANARI_UNKNOWN};
check_type(ANARI_CAMERA, "omnidirectional", paramname, paramtype, transform_types);
return;
}
Expand Down Expand Up @@ -1088,7 +1088,7 @@ class camera_orthographic : public DebugObject<ANARI_CAMERA> {
return;
}
case 4: { //transform
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT3x4, ANARI_UNKNOWN};
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT4, ANARI_UNKNOWN};
check_type(ANARI_CAMERA, "orthographic", paramname, paramtype, transform_types);
return;
}
Expand Down Expand Up @@ -1184,7 +1184,7 @@ class camera_perspective : public DebugObject<ANARI_CAMERA> {
return;
}
case 4: { //transform
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT3x4, ANARI_UNKNOWN};
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT4, ANARI_UNKNOWN};
check_type(ANARI_CAMERA, "perspective", paramname, paramtype, transform_types);
return;
}
Expand Down
18 changes: 9 additions & 9 deletions examples/example_device/ExampleDeviceQueries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,8 +1927,8 @@ static const void * ANARI_CAMERA_omnidirectional_transform_info(ANARIDataType pa
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32_MAT3x4 && infoType == ANARI_FLOAT32_MAT3x4) {
static const float default_value[12] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) {
static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
return default_value;
} else {
return nullptr;
Expand Down Expand Up @@ -2314,8 +2314,8 @@ static const void * ANARI_CAMERA_orthographic_transform_info(ANARIDataType param
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32_MAT3x4 && infoType == ANARI_FLOAT32_MAT3x4) {
static const float default_value[12] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) {
static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
return default_value;
} else {
return nullptr;
Expand Down Expand Up @@ -2694,8 +2694,8 @@ static const void * ANARI_CAMERA_perspective_transform_info(ANARIDataType paramT
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32_MAT3x4 && infoType == ANARI_FLOAT32_MAT3x4) {
static const float default_value[12] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) {
static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
return default_value;
} else {
return nullptr;
Expand Down Expand Up @@ -9533,7 +9533,7 @@ static const void * ANARI_CAMERA_omnidirectional_info(int infoName, ANARIDataTyp
{"position", ANARI_FLOAT32_VEC3},
{"direction", ANARI_FLOAT32_VEC3},
{"up", ANARI_FLOAT32_VEC3},
{"transform", ANARI_FLOAT32_MAT3x4},
{"transform", ANARI_FLOAT32_MAT4},
{"imageRegion", ANARI_FLOAT32_BOX2},
{"apertureRadius", ANARI_FLOAT32},
{"focusDistance", ANARI_FLOAT32},
Expand Down Expand Up @@ -9573,7 +9573,7 @@ static const void * ANARI_CAMERA_orthographic_info(int infoName, ANARIDataType i
{"position", ANARI_FLOAT32_VEC3},
{"direction", ANARI_FLOAT32_VEC3},
{"up", ANARI_FLOAT32_VEC3},
{"transform", ANARI_FLOAT32_MAT3x4},
{"transform", ANARI_FLOAT32_MAT4},
{"imageRegion", ANARI_FLOAT32_BOX2},
{"apertureRadius", ANARI_FLOAT32},
{"focusDistance", ANARI_FLOAT32},
Expand Down Expand Up @@ -9613,7 +9613,7 @@ static const void * ANARI_CAMERA_perspective_info(int infoName, ANARIDataType in
{"position", ANARI_FLOAT32_VEC3},
{"direction", ANARI_FLOAT32_VEC3},
{"up", ANARI_FLOAT32_VEC3},
{"transform", ANARI_FLOAT32_MAT3x4},
{"transform", ANARI_FLOAT32_MAT4},
{"imageRegion", ANARI_FLOAT32_BOX2},
{"apertureRadius", ANARI_FLOAT32},
{"focusDistance", ANARI_FLOAT32},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ class camera_omnidirectional : public DebugObject<ANARI_CAMERA> {
return;
}
case 4: { //transform
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT3x4, ANARI_UNKNOWN};
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT4, ANARI_UNKNOWN};
check_type(ANARI_CAMERA, "omnidirectional", paramname, paramtype, transform_types);
return;
}
Expand Down Expand Up @@ -822,7 +822,7 @@ class camera_orthographic : public DebugObject<ANARI_CAMERA> {
return;
}
case 4: { //transform
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT3x4, ANARI_UNKNOWN};
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT4, ANARI_UNKNOWN};
check_type(ANARI_CAMERA, "orthographic", paramname, paramtype, transform_types);
return;
}
Expand Down Expand Up @@ -948,7 +948,7 @@ class camera_perspective : public DebugObject<ANARI_CAMERA> {
return;
}
case 4: { //transform
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT3x4, ANARI_UNKNOWN};
ANARIDataType transform_types[] = {ANARI_FLOAT32_MAT4, ANARI_UNKNOWN};
check_type(ANARI_CAMERA, "perspective", paramname, paramtype, transform_types);
return;
}
Expand Down
24 changes: 12 additions & 12 deletions examples/generated_device_frontend/device/generated/TreeObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,8 @@ CameraOmnidirectional::CameraOmnidirectional(ANARIDevice device, ANARIObject o)
up.set(device, object, ANARI_FLOAT32_VEC3, value);
}
{
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT3x4, value);
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT4, value);
}
{
float value[] = {0.000000f, 0.000000f, 1.000000f, 1.000000f};
Expand Down Expand Up @@ -914,8 +914,8 @@ void CameraOmnidirectional::unset(const char *paramname) {
return;
case 75: //transform
{
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT3x4, value);
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT4, value);
}
return;
case 27: //imageRegion
Expand Down Expand Up @@ -1071,8 +1071,8 @@ CameraOrthographic::CameraOrthographic(ANARIDevice device, ANARIObject o) : devi
up.set(device, object, ANARI_FLOAT32_VEC3, value);
}
{
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT3x4, value);
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT4, value);
}
{
float value[] = {0.000000f, 0.000000f, 1.000000f, 1.000000f};
Expand Down Expand Up @@ -1175,8 +1175,8 @@ void CameraOrthographic::unset(const char *paramname) {
return;
case 75: //transform
{
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT3x4, value);
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT4, value);
}
return;
case 27: //imageRegion
Expand Down Expand Up @@ -1332,8 +1332,8 @@ CameraPerspective::CameraPerspective(ANARIDevice device, ANARIObject o) : device
up.set(device, object, ANARI_FLOAT32_VEC3, value);
}
{
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT3x4, value);
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT4, value);
}
{
float value[] = {0.000000f, 0.000000f, 1.000000f, 1.000000f};
Expand Down Expand Up @@ -1442,8 +1442,8 @@ void CameraPerspective::unset(const char *paramname) {
return;
case 75: //transform
{
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT3x4, value);
float value[] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
transform.set(device, object, ANARI_FLOAT32_MAT4, value);
}
return;
case 27: //imageRegion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class CameraOmnidirectional : public ParameterPack {
Parameter<ANARI_FLOAT32_VEC3> position;
Parameter<ANARI_FLOAT32_VEC3> direction;
Parameter<ANARI_FLOAT32_VEC3> up;
Parameter<ANARI_FLOAT32_MAT3x4> transform;
Parameter<ANARI_FLOAT32_MAT4> transform;
Parameter<ANARI_FLOAT32_BOX2> imageRegion;
Parameter<ANARI_FLOAT32> apertureRadius;
Parameter<ANARI_FLOAT32> focusDistance;
Expand Down Expand Up @@ -262,7 +262,7 @@ class CameraOrthographic : public ParameterPack {
Parameter<ANARI_FLOAT32_VEC3> position;
Parameter<ANARI_FLOAT32_VEC3> direction;
Parameter<ANARI_FLOAT32_VEC3> up;
Parameter<ANARI_FLOAT32_MAT3x4> transform;
Parameter<ANARI_FLOAT32_MAT4> transform;
Parameter<ANARI_FLOAT32_BOX2> imageRegion;
Parameter<ANARI_FLOAT32> apertureRadius;
Parameter<ANARI_FLOAT32> focusDistance;
Expand Down Expand Up @@ -295,7 +295,7 @@ class CameraPerspective : public ParameterPack {
Parameter<ANARI_FLOAT32_VEC3> position;
Parameter<ANARI_FLOAT32_VEC3> direction;
Parameter<ANARI_FLOAT32_VEC3> up;
Parameter<ANARI_FLOAT32_MAT3x4> transform;
Parameter<ANARI_FLOAT32_MAT4> transform;
Parameter<ANARI_FLOAT32_BOX2> imageRegion;
Parameter<ANARI_FLOAT32> apertureRadius;
Parameter<ANARI_FLOAT32> focusDistance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1594,8 +1594,8 @@ static const void * ANARI_CAMERA_omnidirectional_transform_info(ANARIDataType pa
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32_MAT3x4 && infoType == ANARI_FLOAT32_MAT3x4) {
static const float default_value[12] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) {
static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
return default_value;
} else {
return nullptr;
Expand Down Expand Up @@ -2185,8 +2185,8 @@ static const void * ANARI_CAMERA_orthographic_transform_info(ANARIDataType param
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32_MAT3x4 && infoType == ANARI_FLOAT32_MAT3x4) {
static const float default_value[12] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) {
static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
return default_value;
} else {
return nullptr;
Expand Down Expand Up @@ -2769,8 +2769,8 @@ static const void * ANARI_CAMERA_perspective_transform_info(ANARIDataType paramT
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32_MAT3x4 && infoType == ANARI_FLOAT32_MAT3x4) {
static const float default_value[12] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f};
if(paramType == ANARI_FLOAT32_MAT4 && infoType == ANARI_FLOAT32_MAT4) {
static const float default_value[16] = {1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f, 0.000000f, 0.000000f, 0.000000f, 0.000000f, 1.000000f};
return default_value;
} else {
return nullptr;
Expand Down Expand Up @@ -10808,7 +10808,7 @@ static const void * ANARI_CAMERA_omnidirectional_info(int infoName, ANARIDataTyp
{"position", ANARI_FLOAT32_VEC3},
{"direction", ANARI_FLOAT32_VEC3},
{"up", ANARI_FLOAT32_VEC3},
{"transform", ANARI_FLOAT32_MAT3x4},
{"transform", ANARI_FLOAT32_MAT4},
{"imageRegion", ANARI_FLOAT32_BOX2},
{"apertureRadius", ANARI_FLOAT32},
{"focusDistance", ANARI_FLOAT32},
Expand Down Expand Up @@ -10854,7 +10854,7 @@ static const void * ANARI_CAMERA_orthographic_info(int infoName, ANARIDataType i
{"position", ANARI_FLOAT32_VEC3},
{"direction", ANARI_FLOAT32_VEC3},
{"up", ANARI_FLOAT32_VEC3},
{"transform", ANARI_FLOAT32_MAT3x4},
{"transform", ANARI_FLOAT32_MAT4},
{"imageRegion", ANARI_FLOAT32_BOX2},
{"apertureRadius", ANARI_FLOAT32},
{"focusDistance", ANARI_FLOAT32},
Expand Down Expand Up @@ -10900,7 +10900,7 @@ static const void * ANARI_CAMERA_perspective_info(int infoName, ANARIDataType in
{"position", ANARI_FLOAT32_VEC3},
{"direction", ANARI_FLOAT32_VEC3},
{"up", ANARI_FLOAT32_VEC3},
{"transform", ANARI_FLOAT32_MAT3x4},
{"transform", ANARI_FLOAT32_MAT4},
{"imageRegion", ANARI_FLOAT32_BOX2},
{"apertureRadius", ANARI_FLOAT32},
{"focusDistance", ANARI_FLOAT32},
Expand Down