| 83 | } |
| 84 | |
| 85 | void* Points::getBufferData(RTCBufferType type, unsigned int slot, BufferDataPointerType pointerType) |
| 86 | { |
| 87 | if (type == RTC_BUFFER_TYPE_VERTEX) { |
| 88 | if (slot >= vertices.size()) |
| 89 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 90 | return vertices[slot].getPtr(pointerType); |
| 91 | } else if (type == RTC_BUFFER_TYPE_NORMAL) { |
| 92 | if (slot >= normals.size()) |
| 93 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 94 | return normals[slot].getPtr(pointerType); |
| 95 | } else if (type == RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE) { |
| 96 | if (slot >= vertexAttribs.size()) |
| 97 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 98 | return vertexAttribs[slot].getPtr(pointerType); |
| 99 | } else { |
| 100 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "unknown buffer type"); |
| 101 | return nullptr; |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | void Points::updateBuffer(RTCBufferType type, unsigned int slot) |
| 106 | { |
no test coverage detected