Jump to content

Josh

Staff
  • Posts

    23,279
  • Joined

  • Last visited

Everything posted by Josh

  1. There is a problem with children in prefabs not being positioned correctly...stay tuned...
  2. Should brush texture coordinates be permanently locked when they are loaded from a prefab?
  3. This is happening because the executable you have is outdated. If you sync your project you will get the updated EXEs that support the newer model format version.
  4. I am not able to recreate this problem. Can you please upload an example that shows the problem?
  5. I am not able to recreate this problem. Can you please upload an example that shows the problem?
  6. Josh

    Viewport Bug

    So if you create a new project, this is what you see, and it also happens for all projects?
  7. Your game is not loading the map you have open in the editor.
  8. Josh

    Viewport Bug

    What version of Ultra are you using? What graphics card do you have? Does this happen in a brand new project? Is MSAA enabled in the program options?
  9. I fixed the issue with the box collider not being saved correctly. Can you please upload a map that shows the other problem? I am unable to make this happen: start.zip
  10. I don't think you can because it is part of a custom joint in Newton.
  11. Note that the collision type seems to not be loading from maps in the current build, so loaded maps will not have collision on mesh layers yet.
  12. It's called a "fixed joint" sometimes, and although Newton does not support this, it might be possible to implement a custom one. (Copying this code here for future reference) //http://newtondynamics.com/forum/viewtopic.php?f=15&t=4056 void NewtonDynamicsJoint::NewtonUserBilateralCallBack(const NewtonJoint* newtonjoint, dFloat timestep, int threadIndex) { dFloat matrix0[16]; dFloat matrix1[16]; Mat4 mat0,mat1; Vec3 desiredposition; float dpf[3]; Vec3 p0,p1; float pf0[3],pf1[3]; float dist=5000; float stiffness=1; const NewtonBody* childbody = NewtonJointGetBody0(newtonjoint); const NewtonBody* parentbody = NewtonJointGetBody1(newtonjoint); Mat4 identity; dFloat axis[3]; float trans[3]; NewtonDynamicsJoint* newtondynamicsjoint = (NewtonDynamicsJoint*)NewtonJointGetUserData(newtonjoint); NewtonBodyGetMatrix(parentbody, matrix0); NewtonBodyGetMatrix(childbody, matrix1); mat0=Mat4(matrix0); mat1=Mat4(matrix1); float row[4]; Vec3 mat0trans = mat0.GetTranslation(); Vec3 mat1trans = mat1.GetTranslation(); desiredposition = Transform::Point(newtondynamicsjoint->fixedjointchildrelativeposition,mat0,identity); dpf[0]=desiredposition.x; dpf[1]=desiredposition.y; dpf[2]=desiredposition.z; //Set the position - transform desired position from parent to world and add linear rows NewtonUserJointSetRowStiffness(newtonjoint,stiffness); axis[0]=1; axis[1]=0; axis[2]=0; NewtonUserJointAddLinearRow( newtonjoint, &matrix1[12], dpf, axis); NewtonUserJointSetRowStiffness(newtonjoint,stiffness); axis[0]=0; axis[1]=1; axis[2]=0; NewtonUserJointAddLinearRow( newtonjoint, &matrix1[12], dpf, axis); NewtonUserJointSetRowStiffness(newtonjoint,stiffness); axis[0]=0; axis[1]=0; axis[2]=1; NewtonUserJointAddLinearRow( newtonjoint, &matrix1[12], dpf, axis); //Set rotation p0 = mat0trans + Transform::Vector(newtondynamicsjoint->fixedjointparentrelativeaxes[2],mat0,identity) * dist; p1 = mat1trans + Transform::Vector(newtondynamicsjoint->fixedjointchildrelativeaxes[2],mat1,identity) * dist; pf0[0]=p0.x; pf0[1]=p0.y; pf0[2]=p0.z; pf1[0]=p1.x; pf1[1]=p1.y; pf1[2]=p1.z; NewtonUserJointSetRowStiffness(newtonjoint,stiffness); trans[0]=mat0.j.x; trans[1]=mat0.j.y; trans[2]=mat0.j.z; NewtonUserJointAddLinearRow(newtonjoint, pf1, pf0, trans ); NewtonUserJointSetRowStiffness(newtonjoint,stiffness); trans[0]=mat0.i.x; trans[1]=mat0.i.y; trans[2]=mat0.i.z; NewtonUserJointAddLinearRow(newtonjoint, pf1, pf0, trans ); p0 = mat0trans + Transform::Vector(newtondynamicsjoint->fixedjointparentrelativeaxes[1],mat0,identity) * dist; p1 = mat1trans + Transform::Vector(newtondynamicsjoint->fixedjointchildrelativeaxes[1],mat1,identity) * dist; pf0[0]=p0.x; pf0[1]=p0.y; pf0[2]=p0.z; pf1[0]=p1.x; pf1[1]=p1.y; pf1[2]=p1.z; NewtonUserJointSetRowStiffness(newtonjoint,stiffness); trans[0]=mat0.k.x; trans[1]=mat0.k.y; trans[2]=mat0.k.z; NewtonUserJointAddLinearRow (newtonjoint, pf1, pf0, trans ); } pHySiQuE Posts: 608 Joined: Fri Sep 02, 2011 9:54 pm fixedjointchildrelativeposition=Transform::Point(entity[0]->GetPosition(true),NULL,entity[1]); fixedjointchildrelativeaxes[0]=Transform::Vector(1,0,0,NULL,entity[0]); fixedjointchildrelativeaxes[1]=Transform::Vector(0,1,0,NULL,entity[0]); fixedjointchildrelativeaxes[2]=Transform::Vector(0,0,1,NULL,entity[0]); fixedjointparentrelativeaxes[0]=Transform::Vector(1,0,0,NULL,entity[1]); fixedjointparentrelativeaxes[1]=Transform::Vector(0,1,0,NULL,entity[1]); fixedjointparentrelativeaxes[2]=Transform::Vector(0,0,1,NULL,entity[1]); newtonjoint = NewtonConstraintCreateUserJoint(((NewtonDynamicsSimulation*)world->simulation)->newtonworld,6,NewtonUserBilateralCallBack,NULL,((NewtonDynamicsBody*)entity[0]->body)->body, ((NewtonDynamicsBody*)entity[1]->body)->body); NewtonJointSetUserData(newtonjoint, this);
  13. 0.9.6 Fixed Nvidia meshlayer / imposter bug. Small improvements to the terrain panel interface.
  14. 0.9.6 Mesh layer collision now works with terrain height. Mesh layers now work with navigation meshes. There are probably some bugs, but now I am switching over from "new implementation" mode to "make sure things work" mode so whatever needs fixing will get fixed.
  15. I forgot to include the terrain height in the instance positions in the physics thread, and it only works on flat terrain. Will finish it tomorrow.
  16. 0.9.6 Added support for collision with terrain mesh layers. For player collision, I spawned a bunch of temporary physics bodies around the player, which eliminates some of the issues Leadwerks has with player collision on vegetation. I forgot about mesh layers integrating into the navmesh pathfinding system, so that's the last part of this system that I will do tomorrow.
  17. In the next build that goes up, this will provide a good test of collision with mesh layers: #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; const WString remotepath = "https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/"; int main(int argc, const char* argv[]) { RegisterComponents(); //Get the primary display auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280*2, 720*2, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a rendering framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera //auto camera = CreateCamera(world); //camera->SetPosition(0, 2, 0); //camera->AddComponent<CameraControls>(); //camera->SetCollisionType(0); auto player = CreatePivot(world); player->SetPosition(0, 2, 0); auto component = player->AddComponent<FirstPersonControls>(); //component->camera->AddPostEffect(LoadPostEffect("Shaders/SSAO.fx")); //component->camera->SetClearColor(0.125); //Create a light auto light = CreateDirectionalLight(world); light->SetRotation(65, 35, 0); //Create a terrain auto terrain = CreateTerrain(world, 512, 512); //Add a mesh layer auto model = CreateBox(nullptr, 4); auto meshlayer = terrain->AddMeshLayer(model, 8.0f); meshlayer->Fill(); meshlayer->SetCollisionType(0, COLLISION_SCENE); meshlayer->SetShadows(0, true); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { /*if (window->KeyHit(KEY_SPACE)) { ball->SetPosition(player->position); ball->SetVelocity(0, 0, 0); ball->AddForce(TransformNormal(0,0,1, player, nullptr) * 200.0); }*/ world->Update(); world->Render(framebuffer); } return 0; }
  18. How do you know that layer1Amount equals 40? That seems very odd to hard-code the array size. You can use #uagc_clouds to get the array size.
  19. Try this: self.mesh2 = Model(self.mesh2) self.mesh2:SetSkeleton(self.mesh.skeleton)
  20. The user reported that the console is continuously printing "Invalid operation" errors while the game runs.
  21. Why is the image link broken?
  22. The false argument should prevent the null character from being written at the end.
  23. 0.9.6 Added terrain mesh layer picking, which means 3/4 of my tasks I listed for the week in Saturday's meeting are already finished. The PickInfo structure now has an integer for the index of the mesh layer and an iVec2 for the exact picked instance.
  24. 0.9.6 Foliage tool will now make use of slope and height constraints. Imposter generation will now remove a previously generated imposter, if it is found, so you don't have to manually delete those each time you update the imposter.
  25. Josh

    Test Tree

    I have been using this model a lot for testing the foliage system. oaktree_d.zip
×
×
  • Create New...