Jump to content

Search the Community

Showing results for tags 'c++'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feeback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • Showcase
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Добрый день. Из документации понял, что для записи сгенерированных данных в картинку карты высот в классе Image есть методы: set2D () и перегруженный setPixels (). С первым, благодаря примеру, всё более менее понятно. Со вторым возникли трудности. Создаю файл: image->create2D(lmapTileResolutionX, lmapTileResolutionY, Image::FORMAT_RGBA8); Генерирую и заполняю массив чаров: heightSourceArray = new unsigned char [lmapTileResolutionX * lmapTileResolutionY]; heightSourceArray i = (rand())%255; Вызываю метод image->setPixels(heightSourceArray); В режиме дебага вылетает с необработанным исключением 0x00007FFCDCB3DB9E (ucrtbase.dll) . Так как других ошибок дебагер не выдаёт, идеи куда смотреть закончились. С Уважением, Константин.
  2. Thoughts on Testing

    Hello Folks, I would be interested in experiences with testing and Unigine, especially for larger projects. What kind of toolchain do you use for continuous integration and how do you unit test? Interacting with the Unigine API often needs Unigine to be initialized which makes tests tedious. Do you use some kind of mocking? Do you test your rendered output? How do you compare test results and expected outputs? I would guess pixelwise comparison can be achieved seldomly. I'm new to both testing in C++ and Unigine and would appreciate any input on this topic. Kind regards
  3. Добрый день. Не могли бы вы уточнить, что передаётся параметрами (creator, images, x, y) в функцию, особенно интересуют последние инты. И насколько понимаю, в примере опечатка и должен передаваться указатель LandscapeImagesPtr на картинку. // callback function implementing certain actions to be performed on creating a landscape layer map file void CreateFile(LandscapeMapFileCreatorPtr creator, LandscapeImages images, int x, int, y) Зы: Плюсы учу параллельно с движком, поэтому вопросы могут быть совсем дилетантскими, с моей колокольни это пока не видно. С Уважением Константин.
  4. Добрый день. Не могу найти в коде вызов системного меню по клавише Esc., чтобы выпилить из проекта или модифицировать под свои нужды.
  5. In my game I need something that moves through the world and can collide with static surfaces but does not simulate physics and is move manually through code. other game engines refer to this as a kinematic collider. This is normally done to create player controllers which need to have their physics implemented manually. C++ examples would be much appreciated.
  6. diffrence between C# and C++ on programming ?

    hey everybody , i`m an indie game developer and i been working with unity engine and c# for about 4 years. and i have good understanding of c# and it`s related API. but when i`m migrated to Unigine i find out that it`s support both C# and C++ and apart from they`re differences on syntax or structure or memory and thread management is there any differences on using each one on Unigine? i mean differences on performances does using C++ on unigine makes our game better and faster ? or something else ? any quote will be so appreciated .... thanks
  7. Hi Unigine Team, First : I must to say you , Thank you so much for public release unigine game engine , I used a bit unigine , this engine is amazing & awesome... Second : Big game dev team or small game dev team can make open world game or Big game with C# or C++ in unigine? Which Language With API Complete in Unigine? C# or C++? Three : Is it possible tell me, which games or simulate projects made with unigne website address? Sincerely Ahmad Karami A Teacher/Book author/Test engineer/Solo GameDev
  8. I want to move an object to fill the screen. Similar to Move to camera in the editor. How should I implement it? Please help me
  9. tracker api calls

    Hi are there functions to load and control track files from the c++ side (can't find anything in the docs)? Best
  10. [SOLVED] Load RAW DXT1 texture

    Hello, I try to load a RAW texture that I have in DTX1 format. I don't found a way to load a RAW texture. I try to load as image but log an error loading int format = ::Unigine::Image::FORMAT_DXT1; ::Unigine::ImagePtr image = ::Unigine::Image::create(); image->create2D(textureSize, textureSize, format); const ::Unigine::Ptr<::Unigine::Blob> stream = ::Unigine::Blob::create(); stream->write(textureData, textureLen); // textureData=RAW DTX1 Buffer, textureLen=size image->load(stream->getStream()); /roberto
  11. About a SSLSocket pluging

    Hello Unigine ... I have 3 problems using SSLSocket Using Unigine script creating a client it don't pass the Handshake with a RSS Feed server The plugin sample ssl_socket_01.cpp, is using tls 1.0 or 1.1 that are deprecable, I try to load my own private key and don't load. How I can use this plugin from C++ if I don't found the interface?. Expanding the questions.... Problem 1 I trying to create a single client and down some RSS feed sample. This client connect but fail on the handshacke. int init() { #ifdef HAS_SSL_SOCKET log.message("ssl socket\n"); socket = new SSLSocket(); // https://www.feedforall.com/sample.xml socket.open("www.feedforall.com", 443); if (socket.connect()) { log.message("Is Connected\n"); if(socket.getHandshake()) { log.message("Handshake OK\n"); stream = socket.getStream(); if (stream!=NULL) { log.message("Stream is OK\n"); // socket.block(); stream.printf("GET /sample.xml HTTP/1.1\r\nHost: www.feedforall.com\r\nUser-Agent: Unigine\r\n\r\n"); if (stream.isAvailable()) { log.message("isAvailable OK\n"); } else { log.message("isAvailable not data\n"); } log.message(stream.gets()); } else { log.message("Stream is NULL"); } } else { log.message("Handshake FALSE\n"); } } else { log.message("Not is Is Connected\n"); } #else log.message("SSLSocket plugin is not loaded"); #endif return 1; } Problem 2 For Other place I test your server application and this work. But I used your Private key and certificate. The browser says that is using TLS 1.0 or TLS 1.1 that are deprecable. Then I try to use my own web site private key and certificate. This load the certificate correctly but the Private key fail loading that. void create() { socket = new SSLSocket(); socket.open(4433); socket.bind(); socket.listen(10); socket.nonblock(); socket.load(SSL_SOCKET_RSA_KEY,fullPath("ssl/lynza/private_key.pem")); // Fail load this, this load fine with OpenSSL socket.load(SSL_SOCKET_X509_CERT,fullPath("ssl/lynza/certificate.pem")); // certificate load fine. //socket.load(SSL_SOCKET_RSA_KEY,fullPath("ssl/private_key.pem")); //socket.load(SSL_SOCKET_X509_CERT,fullPath("ssl/certificate.pem")); } Unigine~# config_readonly 1 && world_load "SSLServerTest" Script loading "core/unigine.usc" 9ms Loading "core/locale/unigine.locale" dictionary 1ms Script loading "SSLServerTest.cpp" 9ms World loading "SSLServerTest.world" 102ms SSLSocket::load(): can't load certificate from "ssl/lynza/private_key.pem" file -269 ----Load cache textures---- Cache textures loaded 94 (62ms) Problem 3 /Roberto
  12. I try to recreate a shader like the sample on https://learnopengl.com/Advanced-OpenGL/Geometry-Shader on the sample is use a vertex point as geometry in. Using UUSL the GEOM_TYPE_IN. How I can put a POINT or a Vertex?, for now my two valid options are GEOM_TYPE_IN(LINE_IN) or GEOM_TYPE_IN(TRIANGLE_IN) I try parameters like VERTEX_IN, POINT_IN etc but all of then give me "error X3000: unrecognized identifier" VERTEX_IN or POINT_IN In fact if you do a search on all your documentation for GEOM_TYPE_IN shader definition don't appear nothing. The only reference to the LINI_IN or TRIANGLE_IN appear on the https://developer.unigine.com/en/docs/2.9/code/uusl/semantics?rlang=cpp under the "Geometry Shader Semantics#" section. This is the shader sample from the web site, were for each vertex IN emit 5 vertex OUT as triangle strip #version 330 core layout (points) in; layout (triangle_strip, max_vertices = 5) out; void build_house(vec4 position) { gl_Position = position + vec4(-0.2, -0.2, 0.0, 0.0); // 1:bottom-left EmitVertex(); gl_Position = position + vec4( 0.2, -0.2, 0.0, 0.0); // 2:bottom-right EmitVertex(); gl_Position = position + vec4(-0.2, 0.2, 0.0, 0.0); // 3:top-left EmitVertex(); gl_Position = position + vec4( 0.2, 0.2, 0.0, 0.0); // 4:top-right EmitVertex(); gl_Position = position + vec4( 0.0, 0.4, 0.0, 0.0); // 5:top EmitVertex(); EndPrimitive(); } void main() { build_house(gl_in[0].gl_Position); } /roberto
  13. I try to do some shaders but I don't found includes or shaders using on the engine. for sample if you open "evaluation_sim_windows_2.9.0.2\data\core\materials\default\mesh\mesh_base.basemat" this include many shaders as.. vertex="core/shaders/mesh/transparent/ambient.shader" fragment="core/shaders/mesh/transparent/ambient.shader" vertex="core/shaders/mesh/transparent/lights.shader" fragment="core/shaders/mesh/transparent/lights.shader"/> vertex="core/shaders/mesh/opacity/deferred.shader" fragment="core/shaders/mesh/opacity/deferred.shader"/> .... But this don't appear on all the SDK, include in the generate project, the folder "core/shaders" don't appear too. Now if you do a search for *.shader you can found some samples, but they have a include that I don't found too. #include <core/shaders/mesh/common/common.h> #ifdef VERTEX #include <core/shaders/mesh/common/vertex.h> #elif FRAGMENT #include <core/shaders/mesh/common/fragment.h> #endif This are into the "core/shader/" folder too /roberto
  14. I create a plugin where I want to include a new 3d object. For my 3dObject I inherited from ObjectExternBase class My3dObject: public Unigine::ObjectExternBase { public: template <class> friend class Unigine::Ptr; static void release_ptr(My3dObject *p); { delete p; } static Unigine::Ptr<My3dObject> create(); { Unigine::Ptr<My3dObject> ptr = Unigine::Ptr<My3dObject>(new My3dObject()); return ptr; } virtual int getClassID() override; virtual int getNumSurfaces() override; virtual const char *getSurfaceName(int surface) override; virtual const ::Unigine::BoundBox &getBoundBox(int surface) override; virtual const ::Unigine::BoundSphere &getBoundSphere(int surface) override; virtual const ::Unigine::BoundBox& getBoundBox() override; virtual const ::Unigine::BoundSphere& getBoundSphere() override; ... int MyPlugin::init() { int id = Unigine::Interpreter::addGroup("MyGroup"); Unigine::ExternClass<My3dObject> *My3dObj = Unigine::MakeExternClass<My3dObject>(); Unigine::Interpreter::addExternClass("My3dObject", My3dObj, id); this->my3dObj = My3dObject::create(); this->my3dObj.get()->release(); Unigine::Editor::get()->addNode(this->my3dObj.get()->getNode(), true); ... After load the plugin in the "word tree" appear the node "ObjectExtern", but if I select this raise an exception Unhandled exception at 0x00007FF88046E91E (ucrtbase.dll) in Editor_x64d.exe: Fatal program exit requested. Exist some sample that show how I can add My3dObject to the editor from a plugin. /Roberto
  15. [SOLVED] The Socket is blocking

    Hi I play with Socket class and I been tried several scenarios. The class blocks even in unblocking mode. For sample: 1-The function Socket->gets() is blocking, return only when the remote server close the connection returned all receive as string. Include if you put it as nonblock() the socket. 2-If you use the function Socket->read(...) if the buffer is bigger that the receive Data it's pass right return the the data, but if buffer pass in Socket->read is smaller that the data receive then the second time that you try to read the rest of the data, this will blocking the thread too. Some of this scenarios I expose in the UnitTest attached Some snippet of the attach are here ----------------------------------------------------------------------------------------------------------------- TEST_METHOD(SocketClientTrial) { Ptr<Socket> socket = Socket::create(Socket::SOCKET_STREAM); if (socket->open("localhost", Port)) { if (socket->connect()) { // Pass Ok /* char tmp[100]; int len = socket->read(tmp, 49 - 34); // <== Ok, tmp[len] = 0; Assert::AreEqual(tmp, "I am the server"); */ // NO PASS, IS BLOKING /* char tmp[100]; int len = socket->read(tmp, 5); // <= OK len = socket->read(&tmp[5], 100-5); // <= BLOKING HERE, THE SECOND TIME tmp[len+5] = 0; Assert::AreEqual(tmp, "I am the server"); */ String res = socket->gets(); // <= BLOKING HERE TOO Assert::AreEqual(res, "I am the server"); .... socket->listen(10); // Server socket->nonblock(); <-- using noblock parameter Ptr<Socket> asock = Socket::create(Socket::SOCKET_STREAM); while (1) { if (socket->accept(asock)) { asock->puts("I am the server"); String res = asock->gets(); // <= BLOKING HERE .... ----------------------------------------------------------------------------------------------------------------------------------------------- /Roberto Socket01Trial.cpp
  16. About Web Request

    Hi I have not found any class that allows me to do a WebRequest. There is some way or is planning to create some class allow make Web Request. Thank you...
  17. Hi, I am using Unigine::Image to load tga files with rgb and rgba channels. The getFormat() does always return rgba8. How do I determine the correct number/format of color channels? Regards Sebastian
  18. Qt DirectX and Unigine

    Hi, we are using opengl at the moment for our project with a QOpenGLWidget which is working fine with the Qt composition of QWidget layers, which have transparency, on each other. We want to use directx because of some shader bugs ,which are not solved in opengl yet, and performance improvement. I also managed to get unigine working with directx but I can not overlay the used QWidget with any other QWidget based elements which have transparency. There is no blending in this case and the Unigine scene will not be visible. Do you already have a solution which works with the way Qt composites its UI elements and DirectX or is anything like that planned in the near future? Regards, Sebastian
  19. Lots of questions...

    Okay - so I know not exactly a good topic name... So thanks to the subscription for the entertainment version can play some more with the engine... However, ran into some major (for my project) issues that either I overlooked or cannot find in the documentation. Okay - so basic info for what I am making at this moment: galaxy... 1) so I need to be able to render potentially hundred of thousands of stars (scale is not important at the moment) - 1.1) while I have used - its been slow: Billboards & ObjectMeshClusterPtr 1.2) If not these, then maybe a dynamic mesh to represent the galaxy - however will need to make a dynamic texture (material) to make it look correct 2) In the future, will need to "zoom-in"/click on stars - I have it working with ObjectMeshClusterPtr, not the rest... 3) Future points that I will be working on that if I can get hints/notes - i.e. can/cannot do... 3.1) runtime (realtime) terrain generation - using this library http://libnoise.sourceforge.net/ 3.2) runtime (realtime) texture/material generation for previously listed item. 4.1) multiple textures - for stars - would like to put a "sun" texture on the surface and have it change color and appear to emit light - I am guessing that I will need to write my own shader for this? 5.1) What about merging multiple meshes into one? - Example: Say I have a tree with 4 meshes - the wood core, the bark, the branches and the leaves... Merge all 4 into 1 mesh (yes I could do this in the modeling software) then say in the fall "select" the leaves to change colors and fall? <- could be done with animations and particle systems. Sorry if my question is a little scatterbrained/not coherent... Mark
  20. Moving properties between projects

    Hi! I am wondering how to move properties between projects - lets say I would like to use the light switcher, switch receiver (light source going on/off) and the sun control available in the Superposition project in a new file. I have imported all the cpp. and headers from Superposotion data folder into my project´s data folder. I even tried to copy paste the code from the Superpositions light switcher into the switch property cpp of the vr template, adding all the headers and files included in the light switcher cpp, but I still dont get its funcionality in the new file. I think it could be a problem with inheritance, or maybe GUI? I only have a basic knowledge of programming, but I gues it cant be that hard! Please help:)
  21. in Docs, There is only way to do it with code. How add component to node by UnigineEditor? (not .prop) probably like mouse drag to node
  22. Create custom Widget element

    I have no idea, how to implement custom Widget element. In Qt i can do something like this: #include <QWidget> #include <QToolButton> #include <QLineEdit> #include <QSpacerItem> class CustomEditor : public QWidget { public: CustomEditor(QWidget *_parent = nullptr): QWidget(_parent) { m_btn = new QToolButton(this); m_btn->setText("Btn"); m_edit = new QLineEdit(this); QHBoxLayout *lt = new QHBoxLayout(this); setLayout(lt); lt->addWidget(m_edit); lt->addWidget(m_btn); } private: QToolButton *m_btn; QLineEdit *m_edit; }; And then use CustomEditor with layout manager or set for QTreeWidget, QTableWidget, QListWidget. But in Unigine i can't derive CustomEditor from Widget, in this case i must implement all of virtual functions. How i can implement complex ui element?
  23. C++ examples for Widget classes

    Hi community, the documentation for widget usages with c++ is not very big at the moment and most things I have to try by myself which is very time consuming because there are no examples. I hope this will get better. Currently I am stuck with WidgetHBox class. Can anybody tell me how to connect WidgetLabels to them with c++ code. A small example would be great. Thanks Sebastian
  24. openCV slow frame reading

    I'm using openCV in Unigine project. Function cv::VideoCapture::read() works pretty fast alone and within Unreal Engine. But calling it from Unigine::WorldLogic::update() is very slow (15 FPS). What are the possible reasons and how can I fix it?
  25. How can I set the WASD movement speed for a PlayerDummy object? There is an old question on the forums but that solution no longer applies (set min and max velocity in tools->camera). I can set the WASD speed in the editor bit that's saved in the editor config file not the .world
×
×
  • Create New...