Jump to content

Josh

Staff
  • Posts

    23,123
  • Joined

  • Last visited

Everything posted by Josh

  1. Fixed for next build, tested in editor console.
  2. Another small change I forgot to mention is that if the create object button in the toolbar is already selected and you click it again, it will open the object selection window. It's subtle, but improves the flow of the program.
  3. 0.9.6 Added "Load LOD" menu item in asset editor window.
  4. 0.9.6 Asset editor will now save colliders embedded in an Ultra model file instead of as a separate file. Asset editor now displays all materials a model uses, including external material files. Added "Appearance" settings group in asset editor limb properties. Added LOD distance setting in asset editor limb properties. Model::SetLodDistance parameters changed, up to four LODs are supported. Added World:GetEntitites to Lua API
  5. I am looking into it. In the meantime, version 0.9.4 is available to choose from in the application settings in Steam.
  6. Here is how colliders are stored. For tolerance and optimization, if you don't know just write 0.0 / 0: // Collider if (stream->ReadString(4) != "PHYS") { auto pos = stream->GetPosition() - 4; Print("Error: Expected PHYS tag at position " + String(pos)); return false; } int colliderdatasize = stream->ReadInt(); auto colliderstartposition = stream->GetPosition(); if (colliderdatasize) { Vec3 position, scale, euler; Quat rotation; std::vector<shared_ptr<Collider> > parts; int partcount = stream->ReadInt(); for (int n = 0; n < partcount; ++n) { if (stream->ReadString(4) != "PART") { auto pos = stream->GetPosition() - 4; Print("Error: Expected PART tag at position " + String(pos)); return false; } shared_ptr<Collider> part; auto tag = stream->ReadString(4); if (tag == "HULL") { float tol = stream->ReadFloat();// tolerance std::vector<Vec3> points; Vec3 p; int count = stream->ReadInt(); for (int n = 0; n < count; ++n) { p.x = stream->ReadFloat(); p.y = stream->ReadFloat(); p.z = stream->ReadFloat(); points.push_back(p); } part = CreateConvexHullCollider(points); part->tolerance = tol; } else if (tag == "MESH") { int opt = stream->ReadInt();// optimize flag int count = stream->ReadInt(); int vcount; std::vector<Vec3> face; Vec3 p; std::vector<std::vector<Vec3> > meshfaces; for (int n = 0; n < count; ++n) { vcount = stream->ReadInt(); face.clear(); for (int v = 0; v < vcount; ++v) { p.x = stream->ReadFloat(); p.y = stream->ReadFloat(); p.z = stream->ReadFloat(); face.push_back(p); } meshfaces.push_back(face); } part = CreateMeshCollider(meshfaces); part->optimizemesh = opt; } else { position.x = stream->ReadFloat(); position.y = stream->ReadFloat(); position.z = stream->ReadFloat(); rotation.x = stream->ReadFloat(); rotation.y = stream->ReadFloat(); rotation.z = stream->ReadFloat(); rotation.w = stream->ReadFloat(); scale.x = stream->ReadFloat(); scale.y = stream->ReadFloat(); scale.z = stream->ReadFloat(); if (tag == "BOX_") { part = CreateBoxCollider(scale, position, rotation.Euler()); } else if (tag == "CYLI") { part = CreateCylinderCollider(scale.x, scale.y, position, rotation.Euler()); } else if (tag == "CONE") { part = CreateConeCollider(scale.x, scale.y, position, rotation.Euler()); } else if (tag == "CCYL") { part = CreateChamferCylinderCollider(scale.x, scale.y, position, rotation.Euler()); } else if (tag == "CAPS") { part = CreateCapsuleCollider(scale.x, scale.y, position, rotation.Euler()); } else if (tag == "SPHE") { part = CreateSphereCollider(scale.x, position); } else { Print("Error: Unknown collider type \"" + tag + "\""); return false; } } if (part) parts.push_back(part); } if (parts.size()) { if (parts.size() == 1) { model->SetCollider(parts[0]); } else { auto c = CreateCompoundCollider(parts); model->SetCollider(c); } } stream->Seek(colliderstartposition + colliderdatasize); }
  7. This could be used to auto-generate LODs for a model: https://github.com/melax/sandbox/blob/master/bunnylod/progmesh.cpp
  8. Bone rotations are quaternions in local space (relative to the parent).
  9. What version does the editor show in the titlebar?
  10. Sun properties have been moved into a new dialog, available with the Edit > World Settings menu.
  11. Josh

    Imposter WIP

    This shows the normal map of the imposter material for this model.
  12. What version of the editor are you using? The version number appears in the title bar.
  13. Please upload your project so that we can try it out.
  14. It will be binary, although I have not added it yet.
  15. The physics properties in Blender have some rigid body shapes that map closely to Newton. Might be interesting to you:
  16. Josh

    POINT

    I just ran this in the console with no errors:
  17. 0.9.6 First build of 0.9.6 available on beta branch, adds saving to the asset editor for the new version of our model format. Embedded materials are saved as external files. They still get displayed the same way in the asset editor as embedded materials, and when you save the model it resaves the material files, so any changes you made will go into those files. This works out nicely.
  18. Here is my loading code. I think this is final. A new section was added for node attachments to bones ("ATCH"): G3DModelLoader.cpp
  19. Josh

    Locals

    I am not sure. Do you know how to set breakpoints in VSCode? That might allow you to view the global vars.
  20. I think it might be a good idea to render point and spot lights in this manner using a sphere or cone mesh with a special shader. You would need the material set to use blending, and the mesh would have to reference the light it belongs to. That would save you from stepping through a lot of empty space.
  21. Josh

    Locals

    Makes sense to me. The local variable goes out of scope when the function finishes, and the variable is collected and the value deleted. In Ultra, we can actually make use the Lua's garbage collection
  22. Changes: Animations block will be preceded with the tag "ASET" "COLL" tag renamed to "PHYS" Vertex stride must be 88
  23. Here is some code if you want to make a Lua module: https://github.com/UltraEngine/Lua/tree/main/Modules The simpler way is to create a C API for the lib and interface with that, maybe using the Ultra buffer class to construct a data structure in memory.
×
×
  • Create New...