Jump to content

Search the Community

Showing results for tags 'vector'.

  • 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
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 9 results

  1. Я начинающий в этом движке и не как ни могу понять как узнать позицию обьекта в пространстве, всю документацию пересмотрел и так и не понял как это сделать. Может я просто не могу найти тот класс который мне нужен? using System; using System.Collections; using System.Collections.Generic; using Unigine; [Component(PropertyGuid = "5ff39bf967441504a8a79c93dfaf78d64f635a3d")] public class Test : Component { private void Update() { Node node = World.GetNodeByName("Cuboid"); float worldPos = (float)node.GetWorldDirection(MathLib.AXIS.X); if (Input.IsKeyUp(Input.KEY.E)) { float TransformX = worldPos + 1.0f; Log.Message("Глобальная позиция:" + worldPos + "\n"); Log.Message("Координаты оси X:" + TransformX +"\n"); node.WorldTranslate(TransformX, 0.0f, 0.0f); } } }
  2. Is it possible to delete buildings, roads, and other objects placed by vector data? We're working with a historical time period and will need to ensure that some modern-day roads and city expansions don't make it into our final product. Being unable to do so would mean that we'd have to edit the shape files - not the end of the world, but something important for us to know from a workflow perspective. Also, we plan to use actual geometry for buildings and place them via points. Not sure if that makes a difference. Thanks!
  3. Hi, All As the topic, we have to modify the object globalterrain, because our height data isn't satisfied with the building models some kind. And the vector files is more precise, it would meet our needs of urban planning system.
  4. Hi, I have a base class called Car. From Car class I have derived p21c class. Then I define a vector: Car cars[]; child = createEntity("p21c"); cars.append(child); When I try to append a child class to this vector in log file it says: Variable::operator<(): bad operands int and user class SOLVED: changing cars.append to car[1] = p21 worked
  5. Hello Short example: class T { string a; T(string value) { a = value; } }; class My { int _flag = 0; int _test[0]; T _test2 = new T("old"); void test() { log.message("before:\t" + string(_test.size()) + "\t" + _test2.a + "\n"); int local[] = (1); T local2 = new T("temp"); log.message("after:\t" + string(_test.size()) + "\t" + _test2.a + "\n"); local.append(10); _test = local; local2 = new T("new"); _test2 = local2; if (_flag == 0) { _flag = 1; test(); } } } Expected: before: 0 old after: 0 old before: 2 new after: 2 new Real result: before: 0 old after: 0 old before: 2 new after: 1 new
  6. So, I have a custom class MyClass. In an event handler I create a vector of these objects like : class EventHandler { MyClass mVector[0]; void addMyClass(MyClass aObject) { mVector.append(aObject). } int findObject(MyClass aObject) { int found = 0; if(mVector.find(aObject, NULL) != NULL) { found = 1; } return found; } }; Adding objects to the vector works with no problems. I can check this by giving each object a unique ID and printing those out. The problem is find(). If the MyObject I'm looking for is at index 0 it then Unigine will not find it. find() works as expected if the object is at any other index, well, so far as I can tell anyhow.
  7. So, I have a recursive class function with a map, a vector, and a problem Say the function looks like void foo(MyObject bar) { *do stuff with bar* MyObject childObjectMap[]; bar.getChildren(childObjectMap); // clears childObjectMap then copies all of the child objects into it foreach(MyObject obj; childObjectMap) { foo(obj); } } The expected result is that this will traverse each MyObject, do things with it, then get all it's children objects and repeat recursively. What actually happens is that it only does this with the first child. So, even if each MyObject has five children this will only recurse on the first child of the first child. What I found is happening is that each time the ID of ChildObjectMap remains the same so, in essense, it is static. Everytime I call MyObject::getChildren I'm clobbering it so on the return it has the data from the child. So, the question becomes, how do I create a new map or vector to keep a function from treating a map or vector like a static?
  8. Are there any examples of how to return a Unigine::vector<Type> back to UnigineScript? It doesn't appear to work in the way that I would expect. C++ ---MyClass.cpp Unigine::Vector<CustomStruct> &getStruct() { return my_struct; } ---Plugin.cpp ExternClass<MyClass> *my_class= MakeExternClass<MyClass>(); my_class->addConstructor(); my_class->addFunction("getStruct",&MyClass::getStruct); Interpreter::addExternClass("MyClass",my_class); UnigineScript MyClass my_class = new MyClass(); CustomStruct structs[] = my_class.getStruct(); Error: Interpreter::parse_expression_array(): "my_class" is not a user array
  9. [SOLVED] Problem with Reflection Class

    Hello. Why an error occurs during processing of user class with vector by Reflection Class? For example, I have the following class: class MyClass { private: int myVector[0] = (1, 2, 3); public: MyClass() {} void addItem(int value) { myVector.append(value); } int getItem(int num) { return myVector[num]; } int getNumItems() { return myVector.size(); } }; I use this class in Init() function: int init() { MyClass my_class = new MyClass(); my_class.addItem(4); forloop(int i = 0; my_class.getNumItems()) { log.message("item[%d] = %d;\n", i, my_class.getItem(i)); } /* Output: * item[0] = 1; * item[1] = 2; * item[2] = 3; * item[3] = 4; */ Reflection my_reflection = new Reflection(); my_reflection.reflect(my_class); // here is an error return 1; } And i have following error: Assertion: '(unsigned int)index < (unsigned int)length && "Vector::operator[](): bad index" ' Update: I initialize the vector in constructor, but the probled remained. Then I just declared a variable in the class and the problem disappeared. But this variable is unused. Code: class MyClass { private: int myVector[0]; int i; public: MyClass() { myVector = (1,2,3); } void addItem(int value) { myVector.append(value); } int getItem(int num) { return myVector[num]; } int getNumItems() { return myVector.size(); } };
×
×
  • Create New...