Jump to content

renderLine3D throws access violation exception


photo

Recommended Posts

When attempting to run the code in C++:

Visualizer::get()->renderLine3D( transform * m_vertices[0], transform * m_vertices[1], m_color );

where transform is a 4x4 matrix, m_vertices is an array of vec3's and m_color is a vec4, I get the following exception:

 

Exception thrown: read access violation.


val was 0xFFFFFFFFFFFFFFFF.

The call stack is:

Unigine:VisualizerInterface::renderLine2D

Visualizer::renderLine2D

Unigine::Math::bvec4::set

 

This is a little bit strange since I'm calling the renderLine3D.  Any ideas what's going on?

 

Thank you,

Andrew

Link to comment

Hi Andrew,
 
Are you using float or double engine builds?

Also, is it possible to check the full code for reproduction  - especially values of the following variables:

  • transform
  • m_vertices
  • m_color

I've tried following values, but can't get any crashes with the latest 2.2.1 SDK:

Unigine::Math::Mat4 transform = Unigine::Math::Mat4_identity;
Unigine::Math::Vec3 m_vertices[3] = { Unigine::Math::Vec3_one, Unigine::Math::Vec3_zero, Unigine::Math::Vec3_one };
Unigine::Math::vec4 m_color = Unigine::Math::vec4_one;

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

So I tried rebuilding the engine, updating visual studio, tried running your example code in place of my code and it still throws the same access violation.

 

Any other ideas?

Link to comment

Hi Andrew,

 

I'm afraid, we will need to check the minimal sample to get the idea what is going on. Have you already switched to the new logic system? I've placed renderLine3D in AppWorldLogic::update() and it worked fine for me. Maybe the problem here not in the renderLine3D at all :)

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

We are building using double precision.

 

I implemented the logic system as you suggested and it still throws an access violation exception when attempting to execute

Unigine::Math::Vec3 v1 = { 0, 0, 0 };
Unigine::Math::Vec3 v2 = { 1, 1, 1 };
Unigine::Math::vec4 color = { 255, 255, 255, 255 };
Unigine::Visualizer::get()->renderLine3D(v1, v2, color);

I tried executing this code in both render() and update() in both the system logic and world logic classes.

Link to comment

Hi Andrew,

 

Just created Double x64 project via SDK Browser (using the latest 2.2.1 Sim SDK for Windows) and everything working as expected.

 

Could you please try to create new project called visualizer_test with the latest 2.2.1 SDK and replace AppWorldLogic.cpp inside source dir of the project with the attached file? After that you can build and run x64 Debug configuration.

 

Please, check that includes and libraries are used from the same SDK version.

 

Thanks!

AppWorldLogic.cpp

viz_test.png

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...